dotfiles

Author: Kyle Fuller <inbox@kylefuller.co.uk> 2012-03-28 10:21:25 +0100 +0100
Committer: Kyle Fuller <inbox@kylefuller.co.uk> 2012-04-11 20:13:06 +0100 +0100
Commit: b549dd9690a9b0e29688c92bf88aa438e39cc158
Parent: 4a400e43e69d0312993d858b4a9da8c6011233dd


Add a json and mac function to .rc
diff --git a/.rc b/.rc
index 4cd1ddfc0ec82f12ec527ca7e7e7bbe6f75910ef..848e520ad153b269203d206d8f9af07db0798682 100644
--- a/.rc
+++ b/.rc
@@ -8,9 +8,16 @@   # django.contrib.admin > $PYTHONPATH/django/contrib/admin
   cd $(python -c "import $1; print $1.__file__" | xargs dirname)
 }
 
+json () {
+  if [ -p /dev/stdin ]; then
+    python -mjson.tool | pygmentize -l javascript
+  else
+    python -mjson.tool <<< "$*" | pygmentize -l javascript
+  fi
+}
+
 alias v=$EDITOR
 alias gdiff='git diff | $EDITOR -R -'
-alias grev='git rev'
 
 ssha() {
   ssh $1 -t tmux attach
@@ -33,6 +40,8 @@ alias gsnip='git diff | snip'
 gapp() {
   curl $1 | git apply
 }
+
+alias mac="openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'"
 
 # Source a local .profile if it exists
 [[ -s "$HOME/.profile" ]] && source "$HOME/.profile"