Skip to content

Instantly share code, notes, and snippets.

@benjaminparnell
Created December 27, 2013 17:47
Show Gist options
  • Save benjaminparnell/8150277 to your computer and use it in GitHub Desktop.
Save benjaminparnell/8150277 to your computer and use it in GitHub Desktop.
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
export PATH=/usr/local/bin:/usr/local/bin/sublime:~/bin:/node_modules/coffee-script/bin:$PATH
export CLASSPATH=/jars/junit-4.10.jar:/jars/spock-core-0.6.jar:/usr/local/Cellar/antlr/4.2/antlr-4.2-complete.jar:$CLASSPATH
alias antlr4='java -jar /usr/local/Cellar/antlr/4.2/antlr-4.2-complete.jar'
alias grun='java -cp /usr/local/Cellar/antlr/4.2/antlr-4.2-complete.jar:. org.antlr.v4.runtime.misc.TestRig'
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
ORANGE=$(tput setaf 214)
GREEN=$(tput setaf 002)
PINK=$(tput setaf 005)
D=$(tput setaf 007)
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ on \(\1\)/'
}
function u_name() {
echo $(whoami) | tr '[:upper:]' '[:lower:]'
}
PS1='${GREEN}$(u_name)${D} at ${PINK}\h ${D}in ${ORANGE}\W${D}$(parse_git_branch " (%s)") ${D}\n$ '
alias reload='source ~/.bash_profile && saveprofile'
# make copy to clipboard default on gist
alias gist='gist -c'
# an alias for the windows version of traceroute
alias tracert='traceroute'
# displays all the colors using tput
alias allthecolors='( x=`tput op` y=`printf %$((${COLUMNS}-6))s`;for i in {0..256};do o=00$i;echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}$x;done; )'
# basically I am bad. Probably more of these to come.
alias claer='clear'
alias celar='clear'
alias caler='clear'
alias cls='clear'
# lock computer from terminal
alias lock='pmset sleepnow'
alias ls='ls'
# open chrome from terminal
alias chrm='open /Applications/Google\ Chrome.app'
# git made simple
alias gst='git status'
alias gco='git checkout'
alias gci='git commit'
alias grb='git rebase'
alias gbr='git branch'
alias glg='git log --date-order --all --graph --format="%C(green)%h%Creset %C(yellow)%an%Creset %C(blue bold)%ar%Creset %C(red bold)%d%Creset%s"'
alias glg2='git log --date-order --all --graph --name-status --format="%C(green)%H%Creset %C(yellow)%an%Creset %C(blue bold)%ar%Creset %C(red bold)%d%Creset%s"'
# go up n levels
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
# simple ip
alias ip='ifconfig | grep "inet " | grep -v 127.0.0.1 | cut -d\ -f2'
# more details
alias ip1="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'"
# external ip
alias ip2="curl ipecho.net/plain; echo"
alias grep='grep --color=auto'
[[ -s "$HOME/.rvm/src/rvm/scripts/rvm" ]] && source "$HOME/.rvm/src/rvm/scripts/rvm" # Load RVM into a shell session *as a function*
saveprofile() { gist ~/.bash_profile -u 8150277; }
# fun stuff
eatwhat() { echo "Pizza,Chinese,Indian" | tr ',' '\n' | gshuf | head -1; }
alias eatwhat='eatwhat'
randomfact() { elinks -dump randomfunfacts.com | sed -n '/^| /p' | tr -d \|; }
alias randomfact='randomfact'
randomquote() { elinks -dump quotability.com | sed -n '/^| /p' | tr -d \|; }
alias randomquote='randomquote'
alias asciiworld='curl -s http://artscene.textfiles\.com/vt100/globe.vt | pv -L9600 -q'
# ha...
alias ha='chrm http://www.hahgay.com'
# crunch berries
alias crunchberries='chrm http://www.youtube.com/watch?v=VK33Dj9kptM'
export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"
#THIS MUST BE AT THE END OF THE FILE FOR GVM TO WORK!!!
[[ -s "/Users/Ben/.gvm/bin/gvm-init.sh" ]] && source "/Users/Ben/.gvm/bin/gvm-init.sh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment