Skip to content

Instantly share code, notes, and snippets.

@guykisel
Last active August 29, 2015 14:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guykisel/64f371271e4c6e4a7df8 to your computer and use it in GitHub Desktop.
Save guykisel/64f371271e4c6e4a7df8 to your computer and use it in GitHub Desktop.
export PATH=~/bin:/usr/local/bin:/usr/local/mysql/bin:/usr/local/sbin:$PATH
# virtualenv config
export WORKON_HOME=~/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
GIT_PS1_SHOWDIRTYSTATE=true
export PS1='[\u@mbp \w$(__git_ps1)]\$ '
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
# Avoid succesive duplicates in the bash command history.
export HISTCONTROL=ignoredups
# Append commands to the bash command history file (~/.bash_history)
# instead of overwriting it.
shopt -s histappend
# Append commands to the history every time a prompt is shown,
# instead of after closing the session.
PROMPT_COMMAND='history -a'
# Add bash aliases.
if [ -f ~/.bash_aliases ]; then
source ~/.bash_aliases
fi
source /Users/gkisel/.oh-my-git/prompt.sh
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
GIT_PROMPT_ONLY_IN_REPO=1
# if [ -f "$(brew --prefix bash-git-prompt)/share/gitprompt.sh" ]; then
# GIT_PROMPT_THEME=Default
# source "$(brew --prefix bash-git-prompt)/share/gitprompt.sh"
# fi
alias ls='ls -FHG'
alias wget='wget --content-disposition'
alias speedtest='curl -o /dev/null http://cachefly.cachefly.net/100mb.test; true'
function restart-shell() { exec $SHELL $SHELL_ARGS "$@"; }
export NOSE_REDNOSE=1
export NOSE_WITH_STOPWATCH=1
export NOSE_WITH_XTRACEBACK=1
alias rmpyc='find . -name "*.pyc" -delete'
alias please='sudo `fc -n -l -1`'
function cd() {
builtin cd "${@}"
if [ "$( ls | wc -l )" -gt 30 ] ; then
ls | awk 'NR < 16 { print }; NR == 16 { print " (... snip ...)" }; { buffer[NR % 14] = $0 } END { for( i = NR + 1; i <= NR+14; i++ ) print buffer[i % 14] }'
else
ls
fi
}
alias rehash=' . ~/.bashrc'
function extract() # Handy Extract Program
{
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf "$1" ;;
*.tar.gz) tar xvzf "$1" ;;
*.bz2) bunzip2 "$1" ;;
*.rar) unrar x "$1" ;;
*.gz) gunzip "$1" ;;
*.tar) tar xvf "$1" ;;
*.tbz2) tar xvjf "$1" ;;
*.tgz) tar xvzf "$1" ;;
*.zip) unzip "$1" ;;
*.Z) uncompress "$1" ;;
*.7z) 7z x "$1" ;;
*) echo "'$1' cannot be extracted via >extract<" ;;
esac
else
echo "'$1' is not a valid file!"
fi
}
function update(){
git checkout master && git pull --rebase && git checkout - && git rebase master
}
function get(){
git stash && git pull --rebase && git stash pop
}
alias chrome='open -a "Google Chrome"'
..() { if [ $1 -ge 0 2> /dev/null ]; then x=$1; else x=1; fi; for (( i = 0; i < $x; i++ )); do cd ..; done; }
export NVM_DIR="/Users/gkisel/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment