This file contains 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
let count = 0 | |
let id = setInterval(() => { | |
if (count > 10) { | |
return clearInterval(id) | |
} | |
console.log(count++) | |
}, 1000) | |
console.log(Promise) |
This file contains 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 bufferjoiner = require('bufferjoiner') | |
/** | |
* Consumes and buffers a file stream | |
* @param {ReadStream} fileStream The readable file stream | |
* @param {Function} callback The done callback | |
*/ | |
module.exports = function consumeFileStream(fileStream, callback) { | |
if (undefined === callback) return consumeFileStream.bind(null, fileStream) |
This file contains 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
describe('#*', function () { | |
it('should return a continuable if a callback is not passed', function () { | |
Object.keys(Db.prototype).forEach(function (functionName) { | |
var params = introspect(db[functionName]) | |
if (params.pop() === 'callback') { | |
var fnStr = db[functionName].toString() | |
var line = f('if (undefined === callback) return this.%s.bind(this, %s)', functionName, params.join(', ')) | |
assert.isFunction(db[functionName](), functionName) |
This file contains 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
/* | |
Firmata.cpp - Firmata library | |
Copyright (C) 2006-2008 Hans-Christoph Steiner. All rights reserved. | |
This library is free software; you can redistribute it and/or | |
modify it under the terms of the GNU Lesser General Public | |
License as published by the Free Software Foundation; either | |
version 2.1 of the License, or (at your option) any later version. | |
See file LICENSE.txt for further informations on licensing terms. |
This file contains 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
/*! | |
* TweenLite jQuery plugin v0.0.1 | |
* | |
* Copyright (c) 2011 Kilian Ciuffolo, [email protected] | |
* | |
* Licensed under the MIT license. | |
* Permission is hereby granted, free of charge, to any person | |
* obtaining a copy of this software and associated documentation | |
* files (the "Software"), to deal in the Software without | |
* restriction, including without limitation the rights to use, |
This file contains 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
require('http').IncomingMessage.prototype.makeBuffered = function () { | |
var self = this | |
var unluckyChunks = [] | |
var isPaused = false | |
var isEnded = false | |
var originalResume = self.resume | |
var originalPause = self.pause | |
var originalEmit = self.emit | |
var currentEmit = originalEmit |