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
| 'use strict'; | |
| var extend = require('xtend'), | |
| Pool = require('./pool'), | |
| RateLimiter = require('./ratelimiter'); | |
| module.exports = InputQueue; | |
| function InputQueue(opts) { | |
| opts = opts || { }; |
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 getDockerStuff() { | |
| return new Promise((resolve, reject) => { | |
| let data = ''; | |
| foo.create(name, template, config, function onComplete(exitCode, errors) { | |
| if (exitCode !== null) { | |
| reject(errors); | |
| } else { | |
| resolve(data); | |
| } |
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 Transform = require('stream').Transform; | |
| var util = require('util'); | |
| function AggregateStream(reducer) { | |
| Transform.call(this, { readableObjectMode: true }); | |
| if (typeof reducer !== 'function') { | |
| throw new Error('Must supply a reducer'); | |
| } | |
| this.aggregated = void 0; | |
| this.reducer = reducer; |
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 dumpMemory(port) { | |
| return getMemSize(port) | |
| .then(function (size) { | |
| var result = new Buffer(size); | |
| return copyChunkLoop(result, 0, size) | |
| }); | |
| } |
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 readFileAsync = Promise.promisify(fs.readFile, fs); | |
| module.exports = { | |
| init: function(env) { | |
| if (!env) throw new Error(ERRENV); | |
| var self = this; | |
| if (!env.proto) env.proto = 'http'; | |
| self.env = env; | |
| self.url = str.url(env); |
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
| project/node_modules/loader - can require('foo') but not require('bar') | |
| project/node_modules/foo | |
| project/node_modules/foo/node_modules/bar |
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
| private String cleanHTML(String str) { | |
| Element element = Jsoup.parse(str); | |
| final StringBuilder buffer = new StringBuilder(); | |
| new NodeTraversor(new NodeVisitor() { | |
| boolean isNewline = true; | |
| @Override | |
| public void head(Node node, int depth) { |
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
| 'use strict'; | |
| var assert = require('assert'), | |
| debug = require('debug')('get-connection'), | |
| FibonacciBackoff = require('simple-backoff').FibonacciBackoff; | |
| module.exports = function (opts) { | |
| opts = opts || { }; | |
| assert(opts.hasOwnProperty('net'), 'getConnection: opts.net is required'); |
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
| "use strict"; | |
| function bagGenerator(pieces, exclusions) { | |
| var buf = pieces.slice(), | |
| size = pieces.length, | |
| ptr = -1; | |
| var shuffle = function () { | |
| for (var t, j, i = 1; i < size; i++) { | |
| j = Math.random() * (i+1) |0; | |
| t = buf[i]; |
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
| string | |
| = a:(token / quotedtoken)* { return a; } | |
| quotedtoken | |
| = '"' foo:(token+) '"' space* { return foo.join(' '); } | |
| token | |
| = foo:chars space* { return foo.join(''); } | |
| chars = foo:[a-z]+ { return foo; } |