2017-04-27 03:00:30 +00:00
|
|
|
#!/usr/local/bin/zsh
|
2017-05-08 18:04:27 +00:00
|
|
|
|
|
|
|
# Aliases
|
|
|
|
alias adg="workon addgene-core"
|
|
|
|
alias adocs='cd $ADDGENE_CORE_REPO_DIR/docs && make html && open $ADDGENE_CORE_REPO_DIR/docs/build/html/index.html'
|
|
|
|
alias aenv='env | sort | grep ADDGENE'
|
2016-11-21 15:40:44 +00:00
|
|
|
alias ag='\ag --pager="less"'
|
|
|
|
alias cg='cd "$(git rev-parse --show-toplevel)"'
|
2017-05-25 04:24:08 +00:00
|
|
|
alias ctags="`brew --prefix`/bin/ctags"
|
2017-05-08 18:04:27 +00:00
|
|
|
alias dots="cd $(dirname `readlink ~/.vim`)"
|
2016-11-21 15:40:44 +00:00
|
|
|
alias g='git'
|
2017-05-08 18:04:27 +00:00
|
|
|
alias gp='git push'
|
2016-11-21 15:40:44 +00:00
|
|
|
alias pdb="python -m pdb"
|
|
|
|
alias ppjson="python -m json.tool"
|
2017-05-08 18:04:27 +00:00
|
|
|
alias shrug="echo -n '¯\_(ツ)_/¯' | pbcopy"
|
|
|
|
alias sl="source local.env"
|
|
|
|
alias stabbats='sudo killall VDCAssistant && open https://appear.in/stab-bats'
|
2017-02-02 19:11:17 +00:00
|
|
|
|
|
|
|
if [[ $OSTYPE == darwin* ]]; then
|
|
|
|
alias rm=trash;
|
|
|
|
fi;
|
2017-04-27 03:00:30 +00:00
|
|
|
|
2017-05-08 18:04:27 +00:00
|
|
|
# Functions
|
2017-04-27 03:00:30 +00:00
|
|
|
function adtest () {
|
|
|
|
no_slashes="$(echo "$1" | sed -e 's/\//\./g')";
|
|
|
|
a_test="$(echo "$no_slashes" | sed -e 's/.py//g')";
|
|
|
|
a_project=$(echo -n "$a_test" | python -c "import sys; print sys.stdin.read().split('.', 1)[0]");
|
|
|
|
run_test=$(echo "bin/manage_$a_project.py test $a_test");
|
|
|
|
echo "Evaling $run_test";
|
|
|
|
eval $run_test;
|
|
|
|
}
|
|
|
|
function cpbr () {
|
|
|
|
if branch=$(git symbolic-ref --short -q HEAD)
|
|
|
|
then
|
|
|
|
printf "$branch" | pbcopy
|
|
|
|
osascript -e "display notification \"$branch copied to clipboard\" with title \"cpbr\""
|
|
|
|
else
|
|
|
|
echo "no branch, can't copy"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
function hidden() { ls -a "$@" | grep '^\.'; }
|
2017-04-27 03:02:08 +00:00
|
|
|
function h () {
|
|
|
|
if [ -z "$*" ]
|
|
|
|
then
|
|
|
|
history
|
|
|
|
else
|
|
|
|
history | egrep "$@"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2017-05-26 14:20:57 +00:00
|
|
|
|
|
|
|
# options
|
|
|
|
export LESS=-RFX
|
|
|
|
export PAGER="less"
|