Skip to content

Instantly share code, notes, and snippets.

@yilenpan
Created March 12, 2017 08:40
Show Gist options
  • Save yilenpan/257916e410c7c042402a32ab60d9bcca to your computer and use it in GitHub Desktop.
Save yilenpan/257916e410c7c042402a32ab60d9bcca to your computer and use it in GitHub Desktop.
bash_profil
# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
source ~/.bash_git
# GO PATH
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:/usr/local/opt/go/libexec/bin
# Set color variables
BLACK="\[\e[0;30m\]"
DARK_GRAY="\[\e[1;30m\]"
RED="\[\e[0;31m\]"
YELLOW="\[\e[0;33m\]"
PURPLE="\[\e[1;34m\]"
BLUE="\[\e[0;34m\]"
LIGHT_BLUE="\[\e[1;34m\]"
GREEN="\[\e[0;32m\]"
LIGHT_GREEN="\[\e[1;32m\]"
CYAN="\[\e[0;36m\]"
LIGHT_CYAN="\[\e[1;36m\]"
LIGHT_RED="\[\e[1;31m\]"
PURPLE="\[\e[0;34m\]"
LIGHT_PURPLE="\[\e[1;35m\]"
BROWN="\[\e[0;33m\]"
LIGHT_GRAY="\[\e[0;37m\]"
WHITE="\[\e[1;37m\]"
source /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-prompt.sh
NAME=YiPz
PROMPT_COLOR='\e[00m\e[38;05;166m'
export EDITOR='vim'
export [email protected]
export PS1="${LIGHT_BLUE}\W:${LIGHT_RED}\$(__git_ps1)${LIGHT_GRAY} ${NAME}\$ "
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
alias subl="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
alias vim="/usr/local/Cellar/vim/7.4.1864_1/bin/vim"
alias cdvim='cd ~/.vim'
alias etchost='sudo vim /etc/hosts'
alias dkm='docker-machine'
alias experiments="vim /usr/local/Cellar/nginx/1.10.1/~/minixperiment/experiments.json"
alias dk='docker'
alias apps='cd ~/Applications'
alias downloads='cd ~/Downloads'
alias documents='cd ~/Documents'
alias a='sublime ./'
alias c="clear"
alias shutdown30="sudo shutdown -h +30"
alias shutdown45="sudo shutdown -h +45"
alias shutdown60="sudo shutdown -h +60"
alias r="source ~/.bash_profile"
alias editbash='vim ~/.bash_profile; r'
alias ll="ls -l"
alias li="live-server"
alias pyServer="python -m SimpleHTTPServer 8000"
alias desktop="clear;cd ~/Desktop"
alias o="open ."
alias s="vim"
alias shutdown="sudo shutdown -h now"
alias tmuxkill="tmux kill-session -a"
alias insecure-chrome="'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' --ignore-certificate-errors &> /dev/null"
tmuxa () {
tmux a -t $1
}
mkcd () {
mkdir "$1"
cd "$1"
}
update-experiments () {
d=`pwd`
cd /usr/local/Cellar/nginx/1.10.1/~/minixperiment
mv experiments.json experiments.json.bak
wget http://www.twitch.tv/experiments.json
cd $d
}
mockmin () {
cp /usr/local/etc/nginx/nginx.conf.minixperiment /usr/local/etc/nginx/nginx.conf
etchost
sudo nginx
experiments
}
killmockmin () {
killnginx
}
killnginx () {
sudo nginx -s stop
etchost
}
mockplayer () {
cp /usr/local/etc/nginx/nginx.conf.mockplayer /usr/local/etc/nginx/nginx.conf
etchost
sudo nginx
playerui
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' --ignore-certificate-errors &> /dev/null
}
addalias () {
echo "alias $1=\"$2\"" >> ~/.bash_profile;r
}
gitrebase () {
git checkout master; git pull --rebase upstream master; git checkout $1; git merge master
}
gitsquash () {
git rebase -i $1;
}
dkme () {
eval "$(docker-machine env $1)"
}
dkrm () {
docker rm -f $(docker ps -a -q)
}
test-groovy () {
c
curDir=$(pwd)
cp ./jenkins.groovy /Users/yilenpan/Desktop/jenkins-jobs/jobs/
cd /Users/yilenpan/Desktop/jenkins-jobs/
./gradlew test
cd $curDir
}
pathogenInstall () {
curDir=$(pwd)
cdvim
cd bundle
git clone $1
echo "$1 is now ready to use"
cd $curDir
}
export LLVM="`brew --prefix`/opt/emscripten/libexec/llvm/bin"
alias rmf="rm -rf"
alias algos="desktop;cd hackreactor-meetup"
alias spotify="open /Applications/Spotify.app"
alias loip="ifconfig en0 | grep -oE '((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])' | head -1"
alias ip="curl -s ipinfo.io | grep -oE '((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])' | head -1"
alias playerui="desktop; cd player-ui"
alias hist="history"
alias playerflash="desktop; cd player-flash"
export JAVA_HOME="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home"
alias notes="desktop; cd notes"
alias gitpush="git push -u origin HEAD"
alias testlint="npm test; npm run-script lint"
alias notok="npm test | grep 'not ok'"
alias editvim="vim ~/.vimrc"
alias uitest="playerui; npm run-script test-watch"
alias smoca="desktop; cd smoca"
alias playeruistart="playerui; npm start"
eval "$(rbenv init -)"
alias editnginx="cd /usr/local/etc/nginx/;vim /usr/local/etc/nginx/nginx.conf"
alias webcli="desktop; cd dev/web-client"
alias wat="cat ~/.bash_profile | grep -bash"
alias dev="desktop;cd dev"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment