Skip to content

Instantly share code, notes, and snippets.

View sjwilliams's full-sized avatar

Josh Williams sjwilliams

View GitHub Profile
@sjwilliams
sjwilliams / gist:11191701
Created April 22, 2014 19:39
Simple file renaming with mmv
# http://stackoverflow.com/questions/417916/how-to-do-a-mass-rename
brew install mmv
mmv "*.mustache.html" "#1.jst.html"
@sjwilliams
sjwilliams / dropaudio
Last active August 29, 2015 14:00
Use FFmpeg to drop audio from video
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

Keybase proof

I hereby claim:

  • I am sjwilliams on github.
  • I am sjwilliams (https://keybase.io/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:

{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@sjwilliams
sjwilliams / git-go.js
Last active September 1, 2015 20:08 — forked from gka/git-go.js
#!/usr/bin/env node
var cmds = [];
if (process.argv.length < 3) {
console.log('You need to provide a commit message!');
process.exit(-1);
}
cmds.push('git add -A');
cmds.push('git add -u');
@sjwilliams
sjwilliams / gist:2051376
Created March 16, 2012 17:43 — forked from brianboyer/gist:1696819
Lion dev environment notes
Homebrew (https://github.com/mxcl/homebrew/wiki/installation)
brew install postgres
brew install gdal --with-postgres (EDIT THE FORMULA FIRST, see https://github.com/mxcl/homebrew/issues/8301)
brew install postgis
edit /etc/paths to put /usr/local/bin on top, so that lion's psql doesnt win
PostGIS templates (based on https://wiki.archlinux.org/index.php/PostGIS)
createdb template_postgis -E UTF8
createlang plpgsql template_postgis
psql -d template_postgis -f /usr/local/share/postgis/postgis.sql
@sjwilliams
sjwilliams / gist:3901349
Created October 16, 2012 19:15
iOS hardware/software detection. iOS versions and apple hardware type. in javascript.
/*
IOS CHECK
Based on: http://stackoverflow.com/questions/8348139/detect-ios-version-less-than-5-with-javascript
*/
(function(){
NYTD.NYTMM.iOS = false;
NYTD.NYTMM.iOSInfo = {
userAgent: null,
version: null, // major versions of iOS: 4,5,6
minor: null, // minor versions: 1, for 5.1
@sjwilliams
sjwilliams / gist:4114955
Created November 19, 2012 23:47
jQuery, remove classes by regex match
this.$portfolioItems.removeClass(function(index, cssClass){
return (cssClass.match (/(?:(?:row|col)-[\d]|last-row|first-row)/) || []).join(' ');
})
@sjwilliams
sjwilliams / sublime_text_2_useful_shortcuts.md
Created November 21, 2012 00:02 — forked from nuxlli/sublime_text_2_useful_shortcuts.md
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
brew install ffmpeg --with-libvorbis --with-nonfree --with-gpl --with-libvpx --with-pthreads --with-libx264 --with-libfaac --with-libtheora