Skip to content

Instantly share code, notes, and snippets.

Alex Early aearly

Block or report user

Report or block aearly

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
@aearly
aearly / async1.js
Created Apr 27, 2017
Async exaxmple 1
View async1.js
async.eachLimit(files, 3, function (file, callback) {
fs.readFile(file, function(err, contents) {
if (err) return callback(err)
doSomethingWith(contents)
callback();
})
}, function (err) {
// hooray we're done
})
View keybase.md

Keybase proof

I hereby claim:

  • I am aearly on github.
  • I am aearly (https://keybase.io/aearly) on keybase.
  • I have a public key ASCYWSsEQQlBwEa7eM-I42XwIs3UcAMkYuJXEyIpai5R8go

To claim this, I am signing this object:

@aearly
aearly / index.js
Last active Aug 29, 2015
requirebin sketch
View index.js
var async = require("async");
var functions = [];
for(var i = 0; i < 10000; i++) {
functions.push(function leaky(next) {
function func1(cb) {return cb(); }
function func2(callback) {
if (true) {
@aearly
aearly / Gruntfile.js
Last active Jun 24, 2016
Annotated Browserify Gruntfile
View Gruntfile.js
/**
* Annotated Gruntfile.
* This builds a Backbone/Marionette application using Dust.js (Linkedin fork) as a
* templating system, as well as some helpers from Foundation, with Browserify.
* It also configures a watcher and static server with live reload.
*/
module.exports = function (grunt) {
// This automatically loads grunt tasks from node_modules
require("load-grunt-tasks")(grunt);
@aearly
aearly / Gruntfile.js
Last active Dec 22, 2015
Yeoman modified for CommonJS/Browserify
View Gruntfile.js
"use strict";
var LIVERELOAD_PORT = 35729;
var lrSnippet = require("connect-livereload")({port: LIVERELOAD_PORT});
var mountFolder = function (connect, dir) {
return connect.static(require("path").resolve(dir));
};
// # Globbing
// for performance reasons we"re only matching one level down:
// "test/spec/{,*/}*.js"
@aearly
aearly / mapFunctions.js
Created May 21, 2013
async.mapFunctions - map a list of functions to a single item
View mapFunctions.js
function asyncify(fn) {
return function (option, callback) {
var res;
try {
res = fn(option);
} catch (err) {
return callback(err);
}
callback(null, res);
}
You can’t perform that action at this time.