Last active
May 5, 2017 19:02
-
-
Save zouhenry/4e28a90cc6c2a98b651a25f931ab78b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gitopen(){ | |
REPO="$1"; | |
if [ -z "$1" ]; then REPO="origin" ; fi | |
python -m webbrowser -t $(git config --get remote.$REPO.url) | |
} | |
function gitpull(){ | |
slush isc:updateApp; | |
} | |
function gitpush(){ | |
REPO="$1"; | |
if [ -z "$1" ]; then REPO="origin" ; fi | |
echo "git push $REPO $(mybranch)" | |
git push $REPO $(mybranch); | |
gitopen $REPO; | |
} | |
function updateAllCore(){ | |
for project in `cat ~/projects`; do | |
cd $HOME/$project; | |
git stash save "update core"; | |
slush hs:updateCore --no-serve; | |
git stash apply; | |
done; | |
cd $HOME; | |
} | |
#git commands | |
alias hspd='cd ~/git/hs-uifw-provider-directory' | |
alias master='git checkout master' | |
alias npmlist='npm list --depth=0 -g' | |
alias gitpull='git pull origin $(mybranch)' | |
alias gitfetch='git fetch --all' | |
alias mybranch='git rev-parse --abbrev-ref HEAD' | |
alias gitprune='git branch --merged | grep -v "\*" | grep -v master | grep -v dev | xargs -n 1 git branch -d' | |
alias test='gulp test' | |
alias format='gulp jsformat' | |
alias pd='cd ~/git/hs-uifw-provider-directory' | |
serve(){ | |
PROJ="$1"; | |
if [ -z "$1" ]; then PROJ="."; fi | |
cd $PROJ | |
clear; | |
gulp serve; | |
} | |
gitnewbr(){ git checkout -b $1; git branch; } | |
#helpers | |
alias lsa='ls -lsah' | |
alias chromex='/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security' | |
alias backend="cd ${PWD/ui/backend};nodemon server.js;" | |
alias ui="cd ${PWD/backend/ui}" | |
alias textedit='open -a TextEdit' | |
alias bbedit='open -a BBEdit' | |
alias adiff='open -a Araxis\ Merge' | |
alias ffind='find . -name' | |
alias filefind='find . -name' | |
alias n='open -a BBEdit' | |
alias ll='ls -l' | |
alias dir='ls -l' | |
alias rd='rmdir' | |
alias ..='cd ..' | |
alias ...='cd ../..' | |
alias ....='cd ../../..' | |
alias .....='cd ../../../../' | |
d() { cd ../$1; } | |
mcd() { mkdir $1; cd $1; } | |
line() { echo -; echo -; echo --------------------------------------------------; echo -; echo -; } | |
grepr() { | |
find . -type f -iname "$2" -exec grep -Hn $3 "$1" "{}" \; | |
} | |
grepir() { | |
echo find . -type f -iname \"$2\" -exec grep -Hni $3 \"$1\" \"{}\" \\\; | |
find . -type f -iname "$2" -exec grep -Hni $3 "$1" "{}" \; | |
} | |
alias grepri='grepir' | |
alias findstr='grepir' | |
alias deepgrep='grepir' | |
psup () { | |
if [ $1 ]; | |
then | |
ps -ax -o etime,command -c | grep $1 ; | |
else | |
ps -ax -o etime,command -c | less ; | |
fi | |
} | |
alias now='date "+The time is %A %D %H:%M:%S (%I:%M %p)"' | |
ulimit -n 65536 65536 | |
source ~/.bashrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment