export PS1="\[\033[01;32m\]\u@\h \W \\$ \[$(tput sgr0)\]\[\033[0m\]" export PATH="/opt/anaconda/bin:$PATH" export VISUAL=vim export EDITOR="$VISUAL" # --- functions ----------------------------------------------------------------------------------- function countdown(){ secs=$(($1 * 60)); date1=$((`date +%s` + "$secs")); while [ "$date1" -ge `date +%s` ]; do echo -ne "$(date -u --date @$(($date1 - `date +%s`)) +%H:%M:%S)\r"; sleep 0.1 done } function git-commit-with-timestamp(){ pwd git remote update git pull if ! git diff --quiet then echo "COMMITING" git add --all git commit -m "$(date +"%Y-%m-%d %H:%M")" git push fi } function git-sync-all(){ print-line cd ~/org; git-commit-with-timestamp; print-line cd ~/dotfiles; git-commit-with-timestamp; } function print-yellow { YELLOW='\033[0;33m' NC='\033[0m' # No Color printf "${YELLOW}$*${NC}\n" } function print-line { print-yellow "%`tput cols`s"|tr ' ' '#' }