Skip to content

Instantly share code, notes, and snippets.

@zxhfighter
Last active June 11, 2019 09:32
Show Gist options
  • Save zxhfighter/72b6cbb814dedc34beab4a0f9bb7f82e to your computer and use it in GitHub Desktop.
Save zxhfighter/72b6cbb814dedc34beab4a0f9bb7f82e to your computer and use it in GitHub Desktop.
common bash_profile setting

cat ~/.bash_profile

CLICOLOR=1
LSCOLORS=gxfxcxdxegedabagacad
export PS1="\[\e[31;1m\]\u @ \[\e[36;1m\]\w \[\e[33;1m\]\t $ \[\e[37;1m\]\n"
export TERM=xterm-color

# git alias
alias gs="git status"
alias tao="npm install --registry=https://registry.npm.taobao.org"
alias s="npm run start"
alias b="npm run build"
alias crmaster="git push origin HEAD:refs/for/master"
alias crdev="git push origin HEAD:refs/for/develop"
# alias pull="git pull origin --rebase "
alias pys="python3 -m http.server 9999"
alias un="npm uninstall -S "
alias in="npm install -S "

# component
function comp() {
  ng g c $1 --flat --spec=false --lintFix=false --changeDetection=OnPush;
}

# code review
function cr() {
  git push origin HEAD:refs/for/omni-static_1-1-$1_BRANCH;
}

function g() {
  ng g @xxx/omni-ng-schematics:$1;
}

# lookup port used status
function port() {
  lsof -i :$1;
}

function killportpid() {
    lsof -i :$1 | grep -v 'PID' | awk '{print $2}' | xargs kill -9;
	# ps -ef | grep /usr/local/bin/node | grep -v grep | awk '{print $2}' | xargs kill -9
}

function pull() {
    if [ -z $1 ];then
        echo 'please input the branch no.';
        echo 'usage: pull <branch_no>';
        echo 'e.g. pull 17';
    else
        git pull origin omni-static_1-1-$1_BRANCH --rebase;
    fi
}

# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/mysql/bin:${PATH}"
export PATH

export ICODING_HOME=/Users/ccc/projects/icoding
export PATH="${PATH}:$ICODING_HOME"
# iterm2 colors
CLICOLOR=1
LSCOLORS=gxfxcxdxegedabagacad
export PS1="\[\e[31;1m\]\u @ \[\e[36;1m\]\w \[\e[33;1m\]\t $ \[\e[37;1m\]\n"
export TERM=xterm-color

# git alias
alias gs="git status"
alias tao="npm install --registry=https://registry.npm.taobao.org"
alias s="npm run start"
alias b="npm run build"
alias crmaster="git push origin HEAD:refs/for/master"
alias crdev="git push origin HEAD:refs/for/develop"
alias pull="git pull origin --rebase "

# component
function comp() {
  ng g c $1 --flat --spec=false --lintFix=false --changeDetection=OnPush;
}

# code review
function cr() {
  git push origin HEAD:refs/for/omni-static_1-0-$1_BRANCH
}

# lookup port used status
function port() {
  lsof -i :$1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment