Skip to content

Instantly share code, notes, and snippets.

@dperrymorrow
Created January 25, 2012 00:25
Show Gist options
  • Save dperrymorrow/1673751 to your computer and use it in GitHub Desktop.
Save dperrymorrow/1673751 to your computer and use it in GitHub Desktop.
bash_profile.sh
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
export PATH=/usr/local/bin:$PATH # Postgres installed via homebrew on os x lion fix
export PGDATA=/usr/local/var/postgres # Postgresql cluster variables
export CI_TSDIR=$PGDATA # Postgresql cluster variables
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
export PATH=$PATH:~/Documents/ci_git/git_support/bin
export CC=gcc-4.2
export cc=gcc-4.2
source /usr/local/etc/bash_completion.d/git-completion.bash
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo " "${ref#refs/heads/}" "
}
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo " "${ref#refs/heads/}" "
}
function rvm_version {
local gemset=$(echo $GEM_HOME | awk -F'@' '{print $2}')
[ "$gemset" != "" ] && gemset="@$gemset"
local version=$(echo $MY_RUBY_HOME | awk -F'-' '{print $2}')
[ "$version" != "" ] && version="$version"
local full="$version$gemset"
[ "$full" != "" ] && echo " $full"
}
function parse_git_dirty {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "•"
}
BLACK='\[\033[0;30m\]'
RED='\[\033[0;31m\]'
GREEN='\[\033[0;32m\]'
YELLOW='\[\033[0;33m\]'
BLUE='\[\033[0;34m\]'
PURPLE='\[\033[0;35m\]'
CYAN='\[\033[0;36m\]'
WHITE='\[\033[0;37m\]'
NORMAL="\[\033[0m\]"
WHITE="\[\033[0;37;40m\]"
MAGENTA="\[\033[0;43;40m\]"
BRIGHTBLUE="\[\033[0;31;40m\]"
BRIGHTWHITE="\[\033[1;37;40m\]"
BRIGHTMAGENTA="\[\033[0;33;40m\]"
export PS1="$WHITE\w$YELLOW\$(rvm_version)$PURPLE\$(parse_git_branch)$RED\$(parse_git_dirty) $BLUE\$ "
function ssh-setup {
cat ~/.ssh/id_rsa.pub | ssh $1 'cat - >> ~/.ssh/authorized_keys'
}
# resart with clean db
alias zapdb='rake db:drop db:create db:migrate db:seed'
# alias pg-start='pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start'
alias pg-start='pg_ctl start'
alias pg-running='ps aux | grep postgres'
alias start-autotest='RSPEC=true autotest -c'
alias mysql-stop='killall -9 mysqld'
alias pg-stop='killall -9 postgres'
alias reload='source ~/.bash_profile'
alias edit-bash='mate ~/.bash_profile'
# rm /usr/local/var/postgres/postmaster.pid
# alias pg_ctl start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment