Skip to content

Instantly share code, notes, and snippets.


Josh Williams sjwilliams

View GitHub Profile
sjwilliams / gist:11191701
Created Apr 22, 2014
Simple file renaming with mmv
View gist:11191701
brew install mmv
mmv "*.mustache.html" "#1.jst.html"
sjwilliams / dropaudio
Last active Aug 29, 2015
Use FFmpeg to drop audio from video
View dropaudio
ffmpeg -i [input_file] -vcodec copy -an [output_file]
# or on a bunch of files
for i in *; do ffmpeg -i $i -vcodec copy -an ~/path/to/out/$i; done
View gist:a565012044323170e4e7
I have marked with a * those which I think are absolutely essential
Items for each section are sorted by oldest to newest. Come back soon for more!
* In bash, 'ctrl-r' searches your command history as you type
- Input from the commandline as if it were a file by replacing
'command <' with 'command <<< "some input text"'
- '^' is a sed-like operator to replace chars from last command

Keybase proof

I hereby claim:

  • I am sjwilliams on github.
  • I am sjwilliams ( on keybase.
  • I have a public key whose fingerprint is 7D91 C398 0D0A BB03 0767 F3C6 DB12 92DB A0ED B42D

To claim this, I am signing this object:

View states_hash.json
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
View git-go.js
#!/usr/bin/env node
var cmds = [];
if (process.argv.length < 3) {
console.log('You need to provide a commit message!');
cmds.push('git add -A');
cmds.push('git add -u');
sjwilliams / gist:2051376
Created Mar 16, 2012 — forked from brianboyer/gist:1696819
Lion dev environment notes
View gist:2051376
Homebrew (
brew install postgres
brew install gdal --with-postgres (EDIT THE FORMULA FIRST, see
brew install postgis
edit /etc/paths to put /usr/local/bin on top, so that lion's psql doesnt win
PostGIS templates (based on
createdb template_postgis -E UTF8
createlang plpgsql template_postgis
psql -d template_postgis -f /usr/local/share/postgis/postgis.sql
sjwilliams / gist:3901349
Created Oct 16, 2012
iOS hardware/software detection. iOS versions and apple hardware type. in javascript.
View gist:3901349
Based on:
NYTD.NYTMM.iOS = false;
userAgent: null,
version: null, // major versions of iOS: 4,5,6
minor: null, // minor versions: 1, for 5.1
sjwilliams / gist:4114955
Created Nov 19, 2012
jQuery, remove classes by regex match
View gist:4114955
this.$portfolioItems.removeClass(function(index, cssClass){
return (cssClass.match (/(?:(?:row|col)-[\d]|last-row|first-row)/) || []).join(' ');

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
You can’t perform that action at this time.