Skip to content

Instantly share code, notes, and snippets.

View emgeee's full-sized avatar

Matt Green emgeee

View GitHub Profile
### Keybase proof
I hereby claim:
* I am emgeee on github.
* I am mlgreen (https://keybase.io/mlgreen) on keybase.
* I have a public key ASBSm4Da7Kyb6JmN43y1tNq_9La1mYh8kMXRqJoEf32XUQo
To claim this, I am signing this object:
Verifying that "matt_green.id" is my Blockstack ID. https://onename.com/matt_green
@emgeee
emgeee / angular-decorator-example.js
Last active December 12, 2015 20:16
angular-decorator-example.js
app.config(function ($provide) {
$provide.decorator('Widget', function ($delegate) {
$delegate.prototype.sing = function () {
console.log('LA LA LA LA LA')
}
return $delegate
})
})
var N = 50
function asyncFunc (cb) {
setTimeout(() => cb(Math.random()), 100)
}
function loop (N, results, done) {
// Recursion base-case
if (results.length >= N) return done(results)
@emgeee
emgeee / download-mixpanel-people.js
Last active August 29, 2015 14:16
ES6 Generator example
'use strict';
/*
* This gist is meant to accompany the blog post at
* https://emgeee.com/making-multiple-ajax-requests-with-es6-generators
*/
var request = require('request')
var Promise = require('bluebird')
var fs = require('fs')
var crypto = require('crypto')
@emgeee
emgeee / gulpfile.js
Created November 9, 2014 02:25
Sample gulpfile to blow up gulp-uglify.js
'use strict';
var gulp = require('gulp');
var gulpUglify = require('./index.js');
var through = require('through2');
var errorStream = through.obj(function(file, encoding, callback) {
// Do something improper
var b = a.c;
callback();
@emgeee
emgeee / archive-google-voice
Last active August 29, 2015 14:05
Script for auto-archive texts in Google Voice
'use strict';
var checkXPath = '//*[@id="gc-appbar"]/div/div[2]/div[1]/div[1]/span/div';
var archiveXPath = '//*[@id="gc-appbar"]/div/div[2]/div[2]';
function check() {
var click = new MouseEvent('click', {
'view': window,
'bubbles': true,
'cancelable': false
Verifying myself: My Bitcoin username is +matt_green. https://onename.io/matt_green
var gulp = require('gulp');
var gutil = require('gulp-util');
var livereload = require('gulp-livereload');
var watch = require('gulp-watch');
var http = require('http');
var ecstatic = require('ecstatic');
var watchGlob = 'www/**/*.{js,html,css}';
var iosDest = "platforms/ios/www/";
@emgeee
emgeee / web-audio-test.html
Last active August 29, 2015 14:01
Buffering Audio in Parallel on Mobile with Web Audio API
<html>
<head>
<title>Fun test</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/async/0.9.0/async.js"></script>
<script>