Skip to content

Instantly share code, notes, and snippets.

Michael Wills michaelwills

Block or report user

Report or block michaelwills

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
michaelwills /
Created Feb 17, 2018 — forked from piscisaureus/
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

michaelwills /
Last active Feb 23, 2016
sphinx 4 audio preparation snippets
# use ffmpeg to extract audio from video file
% ffmpeg -i infile.mp4 -acodec pcm_s16le -ac 1 -ar 16000 outfile.wav
# use sox to convert to raw
sox infile.wav -b 16 -s -c 1 -r 16k -t raw outfile.raw
# use ffmpeg to extract RAW! audio from video file
ffmpeg -i input -f s16le -acodec pcm_s16le output.raw
% ffmpeg -i infile.mp4 -f s16le -acodec pcm_s16le -ac 1 -ar 16000 outfile.raw
michaelwills /
Created Dec 11, 2015
JAWS (now) serverless/serverless handling of SNS events

@kfreytag responding to @Nopik

Responding to your question from early this morning about SNS-triggered lambdas. In my experience, you only get one message / Record at a time. Here’s my revised JAWS handler wherein I always deal with a JobId

michaelwills /
Last active Dec 11, 2015
serverless/serverless framework testing .env file
NPM_BIN="/path/to/node /path/to/npm"
michaelwills / jquery-lodash-injector.js
Created Dec 10, 2015
Inject jquery and lodash into current page
View jquery-lodash-injector.js
javascript: (function () { var jv = '2.1.4'; var lv = '3.9.3'; var el = document.createElement('pre'), b = document.getElementsByTagName('body')[0], otherjQuery = false, msg = '', libs = [ function loadjQuery() { if (typeof jQuery != 'undefined') { showMsg('This page already using jQuery v' + jQuery.fn.jquery); } else { if (typeof $ == 'function') { otherjQuery = true; } getScript('//' + jv + '/jquery.js', function () { if (typeof jQuery == 'undefined') { showMsg('Sorry, but jQuery wasn\'t able to load') } else { showMsg('This page is now jQuerified with v' + jQuery.fn.jquery + otherjQuery ? ' and noConflict(). Use $jq(), not $().' : ''); } }); } }, function loadLodash() { if (typeof _ != 'undefined') { showMsg('This page already using lodash v' + _.VERSION); } getScript('//cdnjs
michaelwills / append-commit.js
Created Dec 9, 2015
append git commit to index.html with gulp
View append-commit.js
var gulp = require('gulp'),
git = require('gulp-git'),
cheerio = require('gulp-cheerio');
var gitHash;
gulp.task('hash', function(cb) {
return git.revParse({args:'--short HEAD'}, function(err, hash) {
michaelwills / inject.js
Last active Nov 24, 2015 — forked from timnew/gist:3137257
Inject Javascript to current page
View inject.js
javascript:var s = ''; var b=document.body;if(b){void(z=document.createElement('script'));void(z.type='text/javascript');void(z.src=s);void(b.appendChild(z));}else{}
michaelwills / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.