Skip to content

Instantly share code, notes, and snippets.

@mlawrie
Last active October 11, 2015 14:08
Show Gist options
  • Save mlawrie/3870733 to your computer and use it in GitHub Desktop.
Save mlawrie/3870733 to your computer and use it in GitHub Desktop.
My .bash_profile
#Android SDK
M2_HOME=/usr/local/apache-maven
ANDROID_HOME=/usr/local/android-sdk-macosx
PATH=$PATH:$M2_HOME:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools
#RVM
PATH=$PATH:$HOME/.rvm/bin
#Local bin
PATH=$PATH:$HOME/bin
#Long bash history, no duplicate entries, ignore commands with leading space
export HISTCONTROL=ignoreboth
export HISTSIZE=20000
alias ll="ls -laG"
alias ls="ls -G"
alias hg='history | grep -i'
alias sourcetree="/Applications/SourceTree.app/Contents/MacOS/SourceTree"
alias sbp='source ~/.bash_profile'
alias grep='grep --color=auto'
#Chrome for debugging localhost apps making JSON requests
alias insecure_chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security"
alias mysql_start="cd /usr/local/opt/mysql ; /usr/local/opt/mysql/bin/mysqld_safe &"
alias st="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n"
alias o='open'
#Start unicorn if configured, otherwise start rails server
alias rs='echo -e "\033];Rails ${PWD##*/}\007"; if [ -f config/unicorn.rb ]; then unicorn -c config/unicorn.rb; else rails s; fi; echo -e "\033];\007";'
alias rc='echo -e "\033];RCon ${PWD##*/}\007"; rails c; echo -e "\033];\007";'
alias rdl='echo -e "\033];Log ${PWD##*/}\007"; tail -f log/development.log; echo -e "\033];\007";'
alias rdr='rake db:rollback'
alias rdm='rake db:migrate'
alias rdtp='rake db:test:prepare'
alias bers='bundle exec rspec spec'
alias rgm='rails generate migration'
alias gca='git commit --amend'
alias gd='git diff | /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -w'
alias gdc='git diff --cached | /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -w'
alias gr='git reset'
alias gs='git status'
alias gst='git stash'
alias gstp='git stash pop'
alias gc='git commit -m'
alias ga='git add'
alias gl='git pull'
alias gpr='git pull --rebase'
alias gri='git rebase -i'
alias gh='git push'
alias glm='git pull origin master'
alias ghm='git push origin master'
alias gpsm='git push staging master'
alias gppm='git push production master'
# Convention for heroku app deployments: hs info instead of heroku info my-amazing-app-staging where the app is stored in 'my-amazing-app'
function hs() { heroku "$@" -a ${PWD##*/}-staging ;}
function hp() { heroku "$@" -a ${PWD##*/}-production ;}
#Nice prompt
PS1='\[\e[0;36m\]\u\[\e[m\] \[\e[0;36m\]\w\[\e[m\] \[\e[0;35m\]\$\[\e[m\] \[\e[0;37m\]'
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment