Skip to content

Instantly share code, notes, and snippets.

@burtlo
Last active December 16, 2015 08:48
Show Gist options
  • Save burtlo/5408144 to your computer and use it in GitHub Desktop.
Save burtlo/5408144 to your computer and use it in GitHub Desktop.
export CLICOLOR=1
export TERM=xterm-color
export LSCOLORS=fxfxcxdxbxegedabagacad
export HISTCONTROL=ignoredups:erasedups
export PATH=/usr/local/bin:/usr/local/sbin:$PATH
export PATH=/usr/local/Cellar/wkhtmltopdf/0.9.9:$PATH
export PATH=/usr/local/share/npm/bin:$PATH
export PATH=.:$PATH
export NODE_PATH=/usr/local/lib/node_modules
export GEM_OPEN_EDITOR="subl"
export BUNDLER_EDITOR="subl"
export SVN_EDITOR="vim"
export GIT_EDITOR="vim"
#
#
#
alias ll='ls -l'
alias work="cd ~/glacier/git"
alias dir='ls -l'
# Application
alias chrome="open -a /Applications/Google\ Chrome.app --args --disable-enforced-throttling"
alias psd="open -a /Applications/Adobe\ Photoshop\ CS5.1/Adobe\ Photoshop\ CS5.1.app/ $@"
# Git & Hub
alias hb="hub browse"
function pull-request {
hub pull-request -h $(__github_remote_origin):$(__github_current_branch)
}
alias gitsuball="git submodule foreach --recursive git submodule sync && git submodule update --init --recursive"
function __github_current_branch {
echo "$1`git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`"
}
function __github_remote_origin {
# Finds the origin on github if it is https or git
echo "$1`git remote -v | grep -e "^origin.* (push)" | sed "s#origin[[:blank:]]https://github.com/\([^/]*\)\/.*#\1#" | sed "s#origin.*:\([^/]*\).*push.*#\1#"`"
}
function __current_branch_action {
echo "git $1`git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`"
eval "git $1`git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`"
}
function gmox {
__current_branch_action "merge origin/"
}
function gmux {
__current_branch_action "merge upstream/"
}
function gprox {
__current_branch_action "pull --rebase origin "
}
function gprux {
__current_branch_action "pull --rebase upstream "
}
function grox {
__current_branch_action "rebase origin/"
}
function grux {
__current_branch_action "rebase upstream/"
}
function gpox {
__current_branch_action "push origin "
}
function gpux {
__current_branch_action "push upstream "
}
function gphm {
git push heroku master
}
# Ruby - Rails Aliases
alias start_project="cp -R ~/glacier/git/basic-project/* . && git init && bundle"
alias rs='ruby script/server'
alias rsc='ruby script/console'
alias rsp='ruby script/server -e production'
# Image Magick - flip all png files
alias flippngs="find *.png -exec convert -flop {} {} \;"
#
# Personal Website
#
alias bluehost="ssh [email protected]"
alias newpost="cd ~/glacier/git/octopress"
# Services
## Postgres Database
alias pgstart="pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start"
alias pgstop="pg_ctl -D /usr/local/var/postgres stop -s -m fast"
## MySQL Database
alias msqlstart="mysql.server start"
alias msqlstop="mysql.server stop"
## Redis
alias redisstart=""
alias redisstop=""
export GEM_PRIVATE_KEY=/Users/frank/.ssh/gem-private_key.pem
export GEM_CERTIFICATE_CHAIN=/Users/frank/.ssh/gem-public_cert.pem
# Bash Prompt
function prompt {
local LIGHT_RED="\[\033[1;31m\]"
local LIGHT_GREEN="\[\033[1;32m\]"
local NO_COLOUR="\[\033[0m\]"
local TITLEBAR='\[\033]0;\u@\h\007\]'
source ~/.git-completion.bash
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
export GIT_PS1_SHOWUPSTREAM=auto
export GIT_PS1_SHOWSTASHSTATE=true
PS1="$TITLEBAR\n\w/$LIGHT_GREEN\$(__git_ps1 ' (%s)') $LIGHT_RED\$(~/.rvm/bin/rvm-prompt i v g)\n$NO_COLOUR$ "
}
#call the prompt function to set things in motion
prompt
# RVM
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
if test -s "/Users/burtlo/.bashrc" ; then . "/Users/burtlo/.bashrc" ; fi
# [ -s `brew --prefix`/etc/autojump.sh ]] && . `brew --prefix`/etc/autojump.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment