Skip to content

Instantly share code, notes, and snippets.

@ihower
Created August 20, 2014 07:31
Show Gist options
  • Save ihower/326d64eb846404f914f4 to your computer and use it in GitHub Desktop.
Save ihower/326d64eb846404f914f4 to your computer and use it in GitHub Desktop.
alias s="subl3"
alias x="exit"
export LC_ALL=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
export LANG='en-US'
export EDITOR="subl"
export GOPATH="/Users/ihower/code/go"
PATH=$HOME/activator-1.2.3:$HOME/bin:$HOME/.rvm/bin:/usr/local/bin:$PATH # Add RVM to PATH for scripting
function pr() {
base=$1;
if [ "$1" == "" ]; then
base="develop"
fi
hub pull-request -b eduvo:"$base" -h team:`git rev-parse --abbrev-ref HEAD`;
}
function git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return;
echo "("${ref#refs/heads/}") ";
}
function git_since_last_commit {
now=`date +%s`;
last_commit=$(git log --pretty=format:%at -1 2> /dev/null) || return;
seconds_since_last_commit=$((now-last_commit));
minutes_since_last_commit=$((seconds_since_last_commit/60));
hours_since_last_commit=$((minutes_since_last_commit/60));
days_since_last_commit=$((hours_since_last_commit/24));
minutes=$((minutes_since_last_commit%60));
hours=$((hours_since_last_commit%24));
echo "${hours_since_last_commit}h${minutes}m ";
}
function ruby_version {
#echo "$(rbenv version | sed -e 's/ .*//')";
echo "$(~/.rvm/bin/rvm-prompt)";
}
PS1="[\[\033[1;32m\]\w\[\033[0m] \[\033[0m\]\[\033[1;36m\]\$(git_branch)\[\033[0;33m\]\$(ruby_version)\[\033[0m\]$ "
# if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
# The next line updates PATH for the Google Cloud SDK.
source '/Users/ihower/google-cloud-sdk/path.bash.inc'
# The next line enables bash completion for gcloud.
source '/Users/ihower/google-cloud-sdk/completion.bash.inc'
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment