Skip to content

Instantly share code, notes, and snippets.

@johntran
Last active September 10, 2018 18:37
Show Gist options
  • Save johntran/26799bbbf5f2dca5746151f124f07789 to your computer and use it in GitHub Desktop.
Save johntran/26799bbbf5f2dca5746151f124f07789 to your computer and use it in GitHub Desktop.
John bash 2018 09 10
alias bashdir='cd ~'
alias prof='code ~/.bash_profile'
alias cassandra='cd ~/Documents/apache-cassandra-3.11.3/bin && ./cassandra'
alias ms='cd ~/ONEHOPEWINE/microservice'
alias hc='cd ~/ONEHOPEWINE/hopecommerce'
alias devWatch='hc && npm run relayWatch'
alias devApp='hc && npm run dev-a'
alias devGQL='hc && npm run dev-g'
alias msDev='ms && npm run dev'
alias wipe5='rm -rf node_modules && rm -rf .happypack && rm -rf package-lock.json && rm -rf yarn.lock'
function tab () {
local cmd=""
local cdto="$PWD"
local args="$@"
if [ -d "$1" ]; then
cdto=`cd "$1"; pwd`
args="${@:2}"
fi
if [ -n "$args" ]; then
cmd="; $args"
fi
osascript &>/dev/null <<EOF
tell application "iTerm"
tell current window
set newTab to (create tab with default profile)
tell newTab
tell current session
write text "cd \"$cdto\"$cmd"
end tell
end tell
end tell
end tell
EOF
}
function reboot () {
tab msDev
tab devGQL
tab devApp
tab devWatch
}
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment