Skip to content

Instantly share code, notes, and snippets.

@dominikkaegi
Last active February 19, 2020 01:22
Show Gist options
  • Select an option

  • Save dominikkaegi/6698e2f84d0a60db74fc1e1907dbbfd8 to your computer and use it in GitHub Desktop.

Select an option

Save dominikkaegi/6698e2f84d0a60db74fc1e1907dbbfd8 to your computer and use it in GitHub Desktop.
PS1="🐑💨 \W doka$ "
# --------- GIT compleition ----------
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
# --------------- PYTHON ---------------
# Setting PATH for Python 3.6
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"
export PATH
# added by Anaconda2 5.2.0 installer
export PATH="/Users/dominikkagi/anaconda2/bin:$PATH"
# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH
# ------------ JAVA -----------
#Setting JAVA_HOME
export JAVA_HOME=$(/usr/libexec/java_home)
# ------------- NODE VERSION MANAGER ---------------
# NVM setup
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"
# ------------------- PORT UTILTIES ----------------------
# Find PID of process on a specific port
# param portNumber
# example: "findPortProcess 8080"
findPortProcess() {
portProcess="$(lsof -n -i4TCP:$1 | grep LISTEN)"
if [ "$portProcess" ]
then
echo $portProcess
else
echo "No Process on Port:$1"
fi
}
# Kills Process on a Port
# param portNumber
# example: "killPort 8080"
killPort() {
processPID="$(lsof -ti tcp:$1)"
if [ "$processPID" ]
then
kill $processPID
echo "Killed Process on Port:$1"
else
echo "No Process on Port:$1"
fi
}
# ------------------------ GIT UTILITIES ------------------
# deletes all merged branches except "master, develop, release"
deleteMergedBranches() {
git branch --merged | egrep -v "(^\*|master|develop|release)" | xargs git branch -d
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment