Featured Aliases

export MARKPATH=$HOME/.marks
function jump { 
    cd -P $MARKPATH/$1 2>/dev/null || echo "No such mark: $1"
}
function mark { 
    mkdir -p $MARKPATH; ln -s $(pwd) $MARKPATH/$1
}
function unmark { 
    rm -i $MARKPATH/$1 
}
function marks {
    ls -l $MARKPATH | sed 's/  / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo
}
 
function dim(){ sips $1 -g pixelWidth -g pixelHeight }
function m(){
  git add . -A
  if [ -z "$1" ]
    then
      N=0
      COMMITS=('Theme development' 'Module development' 'Upgrades' 'Misc development work')
      for i in "${COMMITS[@]}"
      do
        N=`expr $N + 1`
        echo "[${N}] ${i}"
      done
 
      read selection
 
      MESSAGE=${COMMITS[selection]}
      echo "${MESSAGE}"
      git commit -m "${MESSAGE}"
 
    else
      echo 'other'
      git commit -m $1
  fi
}
cleankernels() {
    dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get purge
}
rgc() {
    git commit -m"`curl -s http://whatthecommit.com/index.txt`"
}
cdb(){
        echo "CREATE DATABASE $1" | sudo mysql --defaults-extra-file=/etc/mysql/debian.cnf
}
alias json="python -mjson.tool"
alias dskload="ps faux|awk '\$8 ~ /D/{print}'"
alias gitsearch='git rev-list --all | xargs git grep -F'
alias hs='history | grep --color=auto'
devmode(){
drush vset preprocess_css 0 -y
drush vset preprocess_js 0 -y
drush vset page_compression 0 -y
drush vset cache 0 -y
drush vset block_cache 0 -y
drush vset less_devel 1 -y
}
alias github="chrome \`git remote -v | grep github.com | grep fetch | head -1 | field 2 | sed 's/git:/http:/g'\`"
function undozip(){
  unzip -l "$1" |  awk 'BEGIN { OFS="" ; ORS="" } ; { for ( i=4; i<NF; i++ ) print $i " "; print $NF "\n" }' | xargs -I{} rm -r {}
}

Pages