This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var document = require('dom-lite').document | |
, htmlparser = require('htmlparser2') | |
var el_proto = Object.getPrototypeOf(document.createElement('p')) | |
, node_proto = Object.getPrototypeOf(el_proto) | |
Object.defineProperty(el_proto, 'innerHTML', { | |
get: get_html | |
, set: set_html | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = debounce | |
function debounce(fn, delay, at_start) { | |
var timeout | |
if(typeof delay === 'undefined') { | |
delay = 0 | |
} | |
return function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tape = require('tape') | |
module.exports = setup | |
function setup(up, down, run) { | |
return function add_test(name, fn) { | |
var test_state = {} | |
var test = tape(name, function(t) { | |
test_state = up ? up(test_state) : test_state |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var format = require('util').format | |
, ldap = require('ldapjs') | |
, fs = require('fs') | |
module.exports = setup | |
function setup(unpm) { | |
var base_options = { | |
url: unpm.config.ldap.uri | |
, tlsOptions: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add_commas(args, change) { | |
return function(val) { | |
var regex = /(\d+)(\d{3})/ | |
val = val.toString() | |
while(regex.test(val)) { | |
val = val.replace(/(\d+)(\d{3})/, '$1,$2') | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = Batch | |
function Batch(sync) { | |
if(!(this instanceof Batch)) { | |
return new Batch(sync) | |
} | |
this.jobs = [] | |
this.sync = sync | |
this.frame = null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function upload_file(file) { | |
var fd = new FormData | |
, self = this | |
fd.append('file', file) | |
var xhr = request.post(url, {}, fd, function(err, response, headers) { | |
if(err) { | |
// non 200 resonse will be an error | |
// handle error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var TransfromStream = require('stream').Transform | |
module.exports = Parser | |
function Parser(row, col) { | |
TransfromStream.call(this) | |
this._writableState.objectMode = false | |
this._readableState.objectMode = true | |
this.row_delim = row || '\r\n' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express') | |
var app = express(); | |
var sub = express.Router() | |
var sub2 = express.Router() | |
sub2.get('/c', function(req, res, next, base) { | |
res.send('sub test!!') | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 357ac14276b19fd760a9c3441a81ba2469e4e42a Mon Sep 17 00:00:00 2001 | |
From: Michael Hayes <[email protected]> | |
Date: Fri, 10 Oct 2014 13:49:15 -0700 | |
Subject: [PATCH] wip | |
--- | |
lib/instrumentation/express.js | 71 ++++++++++++++++++++++++++++++++++-------- | |
1 file changed, 58 insertions(+), 13 deletions(-) | |
diff --git a/lib/instrumentation/express.js b/lib/instrumentation/express.js |