This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe Contact do | |
it "has a valid factory" do | |
expect(build(:contact)).to be_valid | |
end | |
it { should validate_presence_of :first_name } | |
it { should validate_presence_of :last_name } | |
it { should validate_presence_of :email } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'faker' | |
FactoryGirl.define do | |
factory :contact do |f| | |
f.first_name { Faker::Name.first_name } | |
f.last_name { Faker::Name.last_name } | |
f.email { Faker::Internet.email } | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Assume: | |
1. You have already installed Homebrew. | |
2. /usr/local/bin is your $PATH. | |
3. You are on Yosemite or El Capitain. | |
Solution: At first, run the following script on Terminal app to create specific symlink. | |
$ ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl | |
Then, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. lsof -wni tcp:3000 | |
2. kill -9 PID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew services start postgresql | |
brew services stop postgresql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# connect to postgres | |
psql postgres | |
# list databases | |
\list | |
# connect to database | |
\connect database_name | |
# show tables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://rubystyle.guide/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# color schemes | |
To use the below, open iTerm then hit cmd+i, go to colours panel and import the colour scheme file. | |
lovelace: https://raw.githubusercontent.com/mbadolato/iTerm2-Color-Schemes/master/schemes/lovelace.itermcolors | |
# ~/bash_profile | |
export PS1="👾 > " | |
eval "$(rbenv init -)" | |
# status bar enabled with current directory and git state. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Atom UI theme: Mermaid Dark | |
Atom Syntax theme: Mermaid Dark |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run `postgres -D /usr/local/var/postgres` to diagnose issue | |
If it returns error: | |
``` | |
FATAL: database files are incompatible with server | |
DETAIL: The data directory was initialized by PostgreSQL version 9.2, which is not compatible with this version 9.0.4. | |
``` | |
Then run `brew postgresql-upgrade-database` |
OlderNewer