Batch clean up of local git branches

I usually add an alias in my .zshrc file so that I can run a single command to clean up feature branches that are merged into master or develop.

alias gbclean="git branch --merged | egrep -v '(^\*|master|develop)' | xargs git branch -d"

But if you run:

git branch --merged | egrep -v '(^\*|master|develop)' | xargs git branch -d

This will remove all branches that are merged into master or develop.

How to speed up bundle install on a Mac

Most new laptops/computers come with multiple cores standard.

So assuming you do have a system with multiple cores why not use them.

# How many cores are on your system?
> sysctl -n hw.ncpu
24
> bundle config --global jobs 24

* This might work on any *nix system just find the appropriate commands.

Creating a new rails app

How to create a new project withouttest unit and with postgresql database

# in shell

rails new myapp -T --database=postgresql

# edit Gemfile and add: rspec, haml, etc.
gem 'rspec-rails'
gem 'haml'
gem 'haml-rails'
gem 'factory_girl_rails'

bundle install

# init rspec
rails generate rspec:install

# convert layout to haml
rails generate haml:application_layout convert