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
| #!/bin/bash | |
| set -e | |
| # INSTALLATION OPTIONS | |
| TEST=yes | |
| SRC=yes | |
| UNPACK=yes | |
| die () { echo "Wrong argument: $@"; exit; } |
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
| bugs() { | |
| t.py --task-dir . --list=ISSUES --delete-if-empty -g BUG | |
| } | |
| bug-new() { | |
| t.py --task-dir . --list=ISSUES --delete-if-empty "BUG : $@" | |
| } | |
| bug-done() { | |
| t.py --task-dir . --list=ISSUES --delete-if-empty --done -g BUG |
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
| [alias] | |
| hist = log --pretty=format:'%C(yellow)%h %C(blue)%ad %Creset| %s%Cred%d [%an]' --graph --date=short |
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
| #!/bin/bash | |
| [[ $1 -eq -1 ]] && today=`date +%m/%d/%y` && echo $today | |
| [[ $1 -eq -2 ]] && today=`date +%m-%d-%y` && echo $today | |
| [[ $1 -eq -3 ]] && today=`date +%d/%m/%y` && echo $today | |
| [[ $1 -eq -4 ]] && today=`date +%d-%m-%y` && echo $today | |
| [ $# -ne 1 ] && | |
| cat <<-EOF | |
| Usage: today OPTION |
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
| tt () { | |
| TASK_DIR=$HOME/tasks | |
| if [[ $# = 0 ]]; then | |
| t.py --task-dir=$TASK_DIR --list=tasks | |
| elif [[ $# -ge 1 ]]; then | |
| if [[ -f $TASK_DIR/$1 ]]; then | |
| t.py --task-dir=$TASK_DIR --list=$* | |
| fi | |
| fi | |
| } |
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! VG(pattern) | |
| silent exe "vimgrep /" . a:pattern . "/ %" | |
| silent exe "copen" | |
| silent exe "setlocal cul" | |
| endfunction | |
| function! VGAdd(pattern) | |
| silent exe "vimgrepadd /" . a:pattern . "/ %" | |
| silent exe "copen" | |
| silent exe "setlocal cul" |
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
| export ZSH=$HOME/.zsh | |
| # Usage: init_config CONFIG_FILE | |
| # Description: Source the configuration file, and create an alias to edit it | |
| init_config() { | |
| local CONFIG_FILE=$1 | |
| if [[ -r $CONFIG_FILE ]] | |
| then | |
| source $CONFIG_FILE |
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
| # Usage: init_config CONFIG_FILE | |
| # Description: Source the configuration file, and create an alias to edit it | |
| init_config() { | |
| local CONFIG_FILE=$1 | |
| if [[ -r $CONFIG_FILE ]] | |
| then | |
| source $CONFIG_FILE | |
| CONFIG_ALIAS=".$(basename $CONFIG_FILE)" | |
| alias $CONFIG_ALIAS="vi $CONFIG_FILE" |
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
| pipl () { | |
| yolk -a | awk '{printf("%s (%s)\n", $1, $3) }' | grep -v pyobjc | |
| } |
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
| # Functions for displaying git branch and status | |
| function get_git_branch { | |
| git branch | awk '/^\*/ { print $2 }' | |
| } | |
| function get_git_dirty { | |
| git diff --quiet || echo '*' | |
| } | |
| function get_git_prompt { | |
| git branch &> /dev/null || return 1 | |
| echo "[$(get_git_branch)$(get_git_dirty)] " |