Skip to content

Instantly share code, notes, and snippets.

@ytspar
Created February 20, 2012 01:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ytspar/1867017 to your computer and use it in GitHub Desktop.
Save ytspar/1867017 to your computer and use it in GitHub Desktop.
My bash_profile
alias ls='ls -G'
# Color details - http://wiki.archlinux.org/index.php/Color_Bash_Prompt
txtblk='\[\e[0;30m\]' # Black - Regular
txtred='\[\e[0;31m\]' # Red
txtgrn='\[\e[0;32m\]' # Green
txtylw='\[\e[0;33m\]' # Yellow
txtblu='\[\e[0;34m\]' # Blue
txtpur='\[\e[0;35m\]' # Purple
txtcyn='\[\e[0;36m\]' # Cyan
txtwht='\[\e[0;37m\]' # White
bldblk='\[\e[1;30m\]' # Black - Bold
bldred='\[\e[1;31m\]' # Red
bldgrn='\[\e[1;32m\]' # Green
bldylw='\[\e[1;33m\]' # Yellow
bldblu='\[\e[1;34m\]' # Blue
bldpur='\[\e[1;35m\]' # Purple
bldcyn='\[\e[1;36m\]' # Cyan
bldwht='\[\e[1;37m\]' # White
unkblk='\[\e[4;30m\]' # Black - Underline
undred='\[\e[4;31m\]' # Red
undgrn='\[\e[4;32m\]' # Green
undylw='\[\e[4;33m\]' # Yellow
undblu='\[\e[4;34m\]' # Blue
undpur='\[\e[4;35m\]' # Purple
undcyn='\[\e[4;36m\]' # Cyan
undwht='\[\e[4;37m\]' # White
bakblk='\[\e[40m\]' # Black - Background
bakred='\[\e[41m\]' # Red
badgrn='\[\e[42m\]' # Green
bakylw='\[\e[43m\]' # Yellow
bakblu='\[\e[44m\]' # Blue
bakpur='\[\e[45m\]' # Purple
bakcyn='\[\e[46m\]' # Cyan
bakwht='\[\e[47m\]' # White
txtrst='\[\e[0m\]' # Text Reset
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \[\033[0m\]$(parse_git_branch)$ '
# PS1="\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\]\$(git branch 2>/dev/null | grep '^*' | colrm 1 2) "
export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"
export PATH=$PATH:/usr/local/mysql/bin
## RAILS SPECIFIC
alias devlog="tail -f -n 100 log/development.log"
alias testlog="tail -f -n 100 log/test.log"
alias console="script/console --debugger"
alias debug="touch tmp/debug.txt;touch tmp/restart.txt"
alias migrate="bundle install && bundle exec rake db:migrate && bundle exec rake db:test:prepare"
## PROJECT SPECIFIC
alias projects="cd /Users/ytspar/projects"
alias odf="cd /Users/ytspar/projects/odf2"
# The essential git commands.
alias gs='git status'
alias g='git'
alias gb='git checkout -b'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gd='git diff | $EDITOR'
alias ga='git add'
alias gl='git log'
alias gp='git push'
alias gh='git push heroku master'
alias be='bundle exec'
alias clone='cd ~/projects && git clone $1'
# Capistrano
alias capd='cap deploy'
alias capp='cap production deploy'
alias caps='cap staging deploy'
#generate a random pass
alias randpass="openssl rand -base64 8"
set complete="enhance"
#Color for mac leopard bash terminal
export CLICOLOR=1
export TERM=xterm-color
export LSCOLORS=ExFxCxDxBxegedabagacad
#Rails autotest
export AUTOFEATURE=true
export RSPEC=true
##function parse_git_branch {
## git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
##}
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
function mkdircd () { mkdir -p "$@" && eval cd "\"\$$#\""; }
export TODO=~/Dropbox/todo
function todo() { if [ $# == "0" ]; then cat $TODO; else n=$(($(tail -1 $TODO | cut -d ' ' -f 1)+1)); echo "$n ⇾ $@" >> $TODO; fi }
function todo-list() { cat $TODO; }
function todone() { sed -i -e "/^$*/d" $TODO; }
# source /usr/bin/node/lib/node_modules/npm/lib/utils/completion.sh
export NODE_PATH="/usr/local/Cellar/node/"
export PATH=$PATH:/usr/local/bin/npm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment