#!/usr/bin/env python3
from plistlib import *
import mutagen as m
import urllib.parse
import pprint
import sys
import csv
import os
#! /bin/bash
set -e
[ -z $1 ] && dir='/tmp/foo' || dir=$1
chromedev="/Applications/Google Chrome"
runChromeDev() {
View gist:4704578
#! /bin/bash
if [[ $EUID -ne 0 ]]; then
echo 'This script must be run as root'
exit 1
launchctl unload -w /System/Library/LaunchDaemons/org.postfix.master.plist
mkdir -p /Library/Server/Mail/Data/spool/maildrop
/usr/sbin/postfix set-permissions
View gist:2989520
* Allow Shortcodes to be validated as normal phone numbers in OpenVBX
* Open the file `OpenVBX/libraries/PhoneNumber.php` and replace the function
* `PhoneNumbers::normalizePhoneNumbertoE164` with the function definition below.
* Then replace the `$shortcodes` array members with a list of numbers to
* be considered valid shortcodes.
View gist:2418607
# I used to spend a lot of time installing wordpress versions...
# Wordpress, importer, vip
_install() {
case $1 in
'wordpress' | 'wp')
if ! [ $2 ]; then
View gist:2338920

Format JSON returned from an API request

curl http://api-that-returns/json | python -mjson.tool

Quickly copy a file to a new name

cp filename{,.bak}

List of most used terminal commands

View .vimrc
" just a few common things that I'm always setting up
" add to the runtime path to include plugins
set runtimepath+=$HOME/.vim/vim-markdown
" highlight syntax
syntax on
" always show line numbers
set number
View gist:2118767
# TextMate 2 Default Settings:
# exclude = "{$exclude,*.tmproj,.DS_Store,.git,.svn,.gitignore}"
# excludeDirectories = "{$excludeDirectories,.git,.svn}"
# excludeInBrowser = "{$excludeInBrowser,.gitignore}"
# excludeInFolderSearch = "{$excludeInFolderSearch,log,logs,vendor,tmp}"
windowTitle = "$TM_DISPLAYNAME — ${TM_DIRECTORY/^.*\///}"
[ text ]
showInvisibles = false
View gist:2051192
# longer history
export HISTSIZE=10000
# ignore commands that lead with a space, ignore dups
export HISTCONTROL=ignoreboth,ignoredups
shopt -s histappend
#ignore some files for tab completion
export FIGNORE=$FIGNORE:.hi:.pyc:.o:.beam:.dSYM:.un~
# colorize the prompt
View gist:2022615
#! /bin/bash
if [ ! $mpg ]; then
echo "Enter a man page to convert: ";
read mpg;
if [ ! $mpg ]; then
man -t $mpg | open -f -a /Applications/;