Skip to content

Instantly share code, notes, and snippets.

# app/models/person.rb
class Person < ActiveRecord::Base
has_many :person_role
end
# app/models/role.rb
class Role < ActiveRecord::Base
has_many :person_roles
end

Git commands

git add file # add files for index

git add -i # add files iteratively

git add ignored_file -f # when want add ignored file for commit

git rm --cached file # remove files from index, when doesn't exists on repository yet

# === EDITOR ===
Pry.editor = 'vim'
# == Pry-Nav - Using pry as a debugger ==
Pry.commands.alias_command 'c', 'continue' rescue nil
Pry.commands.alias_command 's', 'step' rescue nil
Pry.commands.alias_command 'n', 'next' rescue nil
Pry.commands.alias_command 'r!', 'reload!' rescue nil
Pry.config.color = true

Ubuntu 16.04

Dependencies

  • sudo apt-get update
  • sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev libv8-dev libcurl3-dev nodejs ssh libgmp3-dev libmysqlclient-dev libpq-dev libev-dev libgdbm-dev libncurses5-dev automake libtool bison libqt4-dev xvfb cmake libjpeg-dev libpng-dev libtiff-dev libwebp-dev

Install RVM:

  • sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
  • gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3