Skip to content

Instantly share code, notes, and snippets.

@mmlindeboom
Last active October 12, 2017 20:35
Show Gist options
  • Save mmlindeboom/ff7fea4f8ef99e6d088122546d2c16e3 to your computer and use it in GitHub Desktop.
Save mmlindeboom/ff7fea4f8ef99e6d088122546d2c16e3 to your computer and use it in GitHub Desktop.
my bashrc
################################################################
######################### ALIASES ##############################
################################################################
## a quick way to get out of current directory ##
alias ..='cd ..'
alias ...='cd ../../../'
alias ....='cd ../../../../'
alias .....='cd ../../../../'
alias .4='cd ../../../../'
alias .5='cd ../../../../..'
alias ll='ls -aGh'
alias gs='git status'
alias ga='git add'
alias gcb='git checkout -b'
alias gco='git checkout'
alias gc='git commit'
alias gcm='git commit -m'
alias gpo='git push origin $(git symbolic-ref HEAD 2>/dev/null)'
alias gpu='git pull origin $(git symbolic-ref HEAD 2>/dev/null)'
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias bc='bc -l'
alias mkdir='mkdir -pv'
alias diff='colordiff'
alias h='history'
alias j='jobs -l'
alias ping='ping -c 5'
# Do not wait interval 1 second, go fast #
alias fastping='ping -c 100 -s.2'
# get web server headers #
alias header='curl -I'
# find out if remote server supports gzip / mod_deflate or not #
alias headerc='curl -I --compress'
alias repow='touch tmp/restart.txt'
alias redpill='sh /usr/local/bin/redpill.sh'
################################################################
###################### FUNCTIONS ###############################
################################################################
todo() {
todo_file=~/.todo_file.txt
if test ! -f "$todo_file"
then
touch "$todo_file"
fi
case "$1" in
"list")
cat "$todo_file"
;;
"add")
echo "$2" >> "$todo_file"
echo "added $2"
;;
"complete")
to_write=$(grep -v "$2" "$todo_file")
echo "$to_write" > "$todo_file"
echo "$2 completed"
;;
*)
echo "OTHER"
;;
esac
}
################################################################
####################### VARIABLES ##############################
################################################################
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ "
. /usr/local/bin/z.sh
export NVM_DIR="/Users/mattl/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
MYSQL=/usr/local/mysql/bin
export PATH=$PATH:$MYSQL
JAVA_HOME=/usr/bin/java
ES_HOME=/usr/local/bin/elasticsearch
export PATH=$PATH:$ES_HOME
export PATH=$PATH:$JAVA_HOME
export DLYD_LIBRARY_PATH=/usr/local/mysql/lib
export PATH="$HOME/.yarn/bin:$PATH"
export PATH=$HOME/cmus/bin:$PATH
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment