Skip to content

Instantly share code, notes, and snippets.

mike pearson mjpearson

Block or report user

Report or block mjpearson

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
View toq_answer.js
#!/usr/bin/env node
refs [interview question](
@author michael pearson <>
To turn on debugging, from shell : `export NODE_DEBUG=1`
If execute bit set on toq_answer.js, run with `cat input.txt | ./toq_answer.js`

Code Question --- Pattern-Matching Paths

I Was A Moron For Answering In This Way


Problem Description

View twilio_pod_inline.js
#!/usr/bin/env node
var pod = require('bip-pod-twilio');
function(msg, level) {
mjpearson / gist:5f2b8ded61dd9879779a
Created Oct 14, 2014
ldapjs client example - heapdump + gc
View gist:5f2b8ded61dd9879779a
#!/usr/bin/env node
var memwatch = require('memwatch'),
heapdump = require('heapdump'),
_ = require('underscore'),
ldap = require('ldapjs');
function dump() {
var f = '/tmp/node_' + + '_' + + '.heapsnapshot';
console.log('Writing Heap Snapshot ' + f);
mjpearson / foundationshim.js
Last active Dec 14, 2015
foundation.js shim into requirejs example
View foundationshim.js
baseUrl : "/static/js",
paths: {
jquery: 'vendor/jquery-bundle-min',
foundation : 'vendor/foundation.min'
shim : {
foundation : {
deps : ["jquery" ],
mjpearson / saucyparser.php
Created Apr 30, 2012
selenium test result retriever for saucelabs
View saucyparser.php
#!/usr/bin/env php
// Retrieves all selenium screenshot/video test results from saucelabs in a useful way
// quick and dirty, deal with it.
// cache is in /cache/{job_id} : remove any job and rerun to reprocess the job
// usable output is in /data/{domain name}/[s|v]_[html_file_name]_[browser][version][job_id][operating_system][_screenshot.png|_video.flv].
// @author michael pearson
mjpearson / sc-dl.js
Created Mar 5, 2012 — forked from pheuter/sc-dl.js
Bookmarklet that generates download link for a Soundcloud upload
View sc-dl.js
(function(d) {
var dl = d.createElement('a');
dl.innerText = 'Download MP3';
dl.href = ""+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1]; = d.querySelector('em').innerText+".mp3";
d.querySelector('.primary').appendChild(dl); = '10px'; = 'red'; = 700;
mjpearson / Zend_Plugin_Controller_AcceptDetect
Created Dec 21, 2011
zend xml/json rest predispatch plugin
View Zend_Plugin_Controller_AcceptDetect
* Detects an XHTML or JSON request type based on the Accept request header
* Can optionally detect whether the request is an XHR request type for further
* routing or rendering decisions (JSONP wrappers for example)
* How to use (put in application/Bootstrap.php):
You can’t perform that action at this time.