Last active
January 18, 2016 06:29
-
-
Save eliangcs/96d47ba0540221164576 to your computer and use it in GitHub Desktop.
Shell shortcuts
This file contains 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
# Clear local merged branches | |
function clearbranches(){ | |
cur_branch=`git rev-parse --abbrev-ref HEAD` | |
if [[ "$cur_branch" == "master" ]]; then | |
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d | |
else | |
echo "Not on master branch!" | |
fi | |
} | |
# Delete *.pyc | |
alias clearpyc="find . -name '*.pyc' -delete" | |
# Start a static web server (Twisted required) | |
function httpserver(){ | |
if [[ "$1" != "" ]]; then | |
twistd -n web --path "$1" | |
else | |
twistd -n web --path . | |
fi | |
} | |
# World time | |
# Put timezones in ~/.worldclock.zones. Example: | |
# US/Pacific | |
# UTC | |
# Europe/Moscow | |
# Asia/Taipei | |
function wt(){ | |
while read zone | |
do echo $(TZ=$zone date "+%Y-%m-%d %H:%M:%S %z %Z") "($zone)" | |
done < "$HOME/.worldclock.zones" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment