Skip to content

Instantly share code, notes, and snippets.

@lucwj
Last active November 8, 2018 15:58
Show Gist options
  • Save lucwj/b0890f215e7d3fc02ac3c4585e211854 to your computer and use it in GitHub Desktop.
Save lucwj/b0890f215e7d3fc02ac3c4585e211854 to your computer and use it in GitHub Desktop.

X-Code

xcode-select --install

iTerm2 + zsh

Download iTerm2

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Brew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Git

brew install git tig

vi ~/.gitconfig
	[alias]
	    st     = status
	    ci     = commit -v
	    co     = checkout
	    up     = pull origin
	    info   = remote -v
	    d      = diff
	    df     = diff
	    dfc    = diff --cached
	    dc     = diff --cached
	    staged = diff --cached
	    log    = log -v
	    lp     = log -p
	    lg     = log -p --graph
	    a      = add
	    br     = branch
	    b      = branch
	    tree   = log --graph --pretty=oneline --abbrev-commit --decorate
	    unst   = reset HEAD
	[color]
	  	ui = auto
	[core]
	    excludesfile = /Users/yo/.gitignore_global
	    editor = emacs
	[push]
		default = matching
	[credential]
	    helper = osxkeychain
    [user]
    	name = "Your Name"
    	email = "[email protected]"

Create and add SSH key to github account

ssh-keygen -t rsa -C [email protected]

cat ~/.ssh/id_rsa.pub

Ruby

brew install rbenv ruby-build

rbenv install 2.2.3

rbenv global 2.2.3

echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile

source ~/.bash_profile

gem install bundler

If you are using zsh

echo 'source ~/.bash_profile' >> ~/.zshrc

Postgresql

brew install postgresql

MySQL

brew install mysql

mkdir -p ~/Library/LaunchAgents ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

Edit pog_hba.conf

vi /usr/local/var/postgres/pg_hba.conf host all all 0.0.0.0/0 md5 ## Add new line to the end

launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

psql postgres -c "create role nykdev with createdb login password 'nykdev';"

Setup nykgear-server

brew install qt ImageMagick openssl ffmpeg

brew link openssl --force

git clone [email protected]:vietgurus/nykgear-server.git

cd nykgear-server

cd config

cp database.example.yml database.yml

vi database.yml

	change localhost => 127.0.0.1
	change username => nykdev
	change password => nykdev

bundle install

rake db:create

rake db:migrate

rake db:seed

Start the server

bundle exec unicorn -p 3000

Open another window

bundle exec rake jobs:work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment