Last active
March 6, 2019 16:14
-
-
Save cajun-code/1384203 to your computer and use it in GitHub Desktop.
bash profile for rails development
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source /usr/local/git/contrib/completion/git-completion.bash | |
complete -C "/usr/bin/gemedit --complete" gemedit | |
export WORKON_HOME=~/.env | |
export JAVA7_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home | |
export JAVA6_HOME=/Library/Java/Home | |
export JAVA_HOME=$JAVA6_HOME | |
export PATH=$JAVA_HOME/bin:$PATH | |
export SBT_OPTS="-XX:MaxPermSize=256M" | |
# SBT_OPTS="-XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M" | |
export GRADLE_HOME=~/gradle-1.10 | |
export PATH=$GRADLE_HOME/bin:$PATH | |
export COCOS_CONSOLE_ROOT=/Users/alley/lib/cocos2d-x-3.3/tools/cocos2d-console/bin | |
export PATH=$COCOS_CONSOLE_ROOT:$PATH | |
export NDK_ROOT=/Users/alley/android-ndk-r10d | |
export ANDROID_SDK_ROOT=/Users/alley/android-sdk-macosx | |
export ANT_ROOT=/usr/local/Cellar/ant/1.9.3/bin | |
export RUBYMOTION_ANDROID_SDK=$ANDROID_SDK_ROOT | |
export RUBYMOTION_ANDROID_NDK=$NDK_ROOT | |
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.7 | |
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv | |
#source /Library/Frameworks/Python.framework/Versions/3.3/bin/virtualenvwrapper.sh | |
source /usr/local/bin/virtualenvwrapper.sh | |
export ANDROID_SDK_HOME=$ANDROID_SDK_ROOT | |
export ANDROID_NDK_HOME=$NDK_ROOT | |
export PATH=$ANDROID_SDK_HOME/tools:$ANDROID_SDK_HOME/platform-tools:$ANDROID_NDK_HOME:$PATH | |
#export PLAY_HOME=~/lib/play-2.1.1 | |
#export PATH=$PLAY_HOME:$PATH | |
# Setting PATH for Python 3.3 | |
# The orginal version is saved in .bash_profile.pysave | |
PATH="/Library/Frameworks/Python.framework/Versions/3.3/bin:${PATH}" | |
export PATH | |
export PATH=/usr/local/share/npm/bin:$PATH | |
# Adding PostgreSQL to Path | |
export PATH=/Applications/Postgres.app/Contents/Versions/9.3/bin:$PATH | |
alias komodo='open -a "Komodo Edit"' | |
alias gemi='gem install --no-ri --no-rdoc' | |
alias sgemi='sudo gem install --no-ri --no-rdoc' | |
alias gemu='gem uninstall' | |
alias sgemu='sudo gem uninstall' | |
alias ls='ls -GF' | |
alias ll='ls -alh -GF' | |
alias ..='cd ..' | |
alias deploy='ssh deploy.nor.primedia.com' | |
alias flush='dscacheutil -flushcache' | |
alias rs='rake spec' | |
alias r='rails' | |
# launching console/server | |
sc () { | |
if [ -f ./script/rails ]; then | |
rails c $@ | |
else | |
./script/console $@ | |
fi | |
} | |
# launching script generate | |
sg () { | |
if [ -f ./script/rails ]; then | |
rails g $@ | |
else | |
./script/generate $@ | |
fi | |
} | |
# launching server | |
ss () { | |
if [ -f ./script/rails ]; then | |
rails s $@ | |
else | |
./script/server $@ | |
fi | |
} | |
alias gca='git commit -v -a' | |
alias gd='git diff' | |
alias gpl='git pull' | |
alias gpr='git pull --rebase' | |
alias gf='git fetch origin' | |
alias gst='git status' | |
alias glp='git log -p' | |
alias glo='git log --oneline --decorate' | |
alias gl='git log' | |
alias gitk='gitk --all >/dev/null 2>/dev/null &' | |
alias github="open \`git config -l | grep 'remote.origin.url' | sed -En \ | |
's/remote.origin.url=git(@|:\/\/)github.com(:|\/)(.+)\/(.+).git/https:\/\/github.com\/\3\/\4/p'\`" | |
alias gindex='git ls-files -z --deleted | git update-index -z --remove --stdin' | |
function __git_dirty { | |
git diff --quiet HEAD &>/dev/null | |
[ $? == 1 ] && echo "!" | |
} | |
function __git_branch { | |
__git_ps1 "(%s)" | |
} | |
bash_prompt() { | |
local NONE="\[\033[0m\]" # unsets color to term's fg color | |
# regular colors | |
local K="\[\033[0;30m\]" # black | |
local R="\[\033[0;31m\]" # red | |
local G="\[\033[0;32m\]" # green | |
local Y="\[\033[0;33m\]" # yellow | |
local B="\[\033[0;34m\]" # blue | |
local M="\[\033[0;35m\]" # magenta | |
local C="\[\033[0;36m\]" # cyan | |
local W="\[\033[0;37m\]" # white | |
local UC=$W # user's color | |
[ $UID -eq "0" ] && UC=$R # root's color | |
PS1="$M\$(~/.rvm/bin/rvm-prompt v g) $C\w $Y\$(__git_branch)$R\$(__git_dirty)${NONE}\n$ " | |
} | |
bash_prompt | |
unset bash_prompt | |
# rvm-install added line: | |
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm" ; fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment