I hereby claim:
- I am anthonyserious on github.
- I am anthonyserious (https://keybase.io/anthonyserious) on keybase.
- I have a public key ASASuIUilOzQ08H0pyuegMhuOSjvIiGRVSbRYr2MncGRXgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
"use strict"; | |
module.exports = function stagger(fn, ms) { | |
let queue = []; | |
let running = false; | |
let flush = () => { | |
if (queue.length === 0) { | |
running = false; | |
return; |
var Q = require("q"); | |
var arr = [1,2,3,4]; | |
arr.reduce(function(prev, item) { | |
return prev.then(function(p) { | |
console.log(item); | |
return Q.delay(0); | |
}); | |
}, Q.resolve(1)); |
// Recursively strip out fields in objects and subobjects | |
function stripFields(schema, obj) { | |
var newObj = {}; | |
var schemaType = schema.constructor.name; | |
var objType = obj.constructor.name; | |
// If types match and this property is not an Object, return the value | |
if (schemaType !== "Object") { | |
if(schemaType === objType) { |
function mbeanToObject (mbean) { | |
var obj = {}; | |
var a = mbean.split(":"); | |
obj.domain = a[0]; | |
obj.properties = []; | |
a[1].split(",").forEach(function(propPair) { | |
var pair = propPair.split("="); | |
obj.properties[pair[0]] = pair[1]; | |
}); | |
return obj; |