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 a = somestream | |
| var b = somestream2 | |
| var c = somestream3 | |
| a.on('error', onerror) | |
| b.on('error', onerror) | |
| c.on('error', onerror) | |
| // ^ :( |
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
| 1 middleware | |
| 9901.58 | |
| 5 middleware | |
| 9482.36 | |
| 10 middleware | |
| 9052.52 | |
| 15 middleware |
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
| tobi = { name = 'tobi' } | |
| loki = { name = 'loki' } | |
| # equality | |
| same = |a, b| a.name == b.name | |
| print(same(tobi, loki)) | |
| # greeting | |
| greet = |user| 'Hello ' .. user.name |
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 params(fn) { | |
| var str = fn.toString(); | |
| var sig = str.match(/\(([^)]*)\)/)[1]; | |
| if (!sig) return []; | |
| return sig.split(', '); | |
| } | |
| console.api = function(obj){ | |
| console.log(); | |
| var proto = Object.getPrototypeOf(obj); |
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
| # get an event stream | |
| $ GET http://localhost:3030/events | |
| ["event_id","XA2GXiI8sW"] | |
| # subscribe to a stream and item | |
| $ POST http://tobi:Dev1@localhost:3030/events/XA2GXiI8sW/cem4XEqBOs6 | |
| $ POST http://tobi:Dev1@localhost:3030/events/XA2GXiI8sW/iC0tgUrzUWG |
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
| tag = this._readTag(ifdType, offset); | |
| this._tags[tag.name] = { | |
| 'value': tag.value, | |
| 'description': tag.description | |
| }; | |
| _results.push(offset += 12); | |
| } | |
| return _results; | |
| }; | |
| ExifReader.prototype._readTag = function(ifdType, offset) { |
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 co = require('..'); | |
| var join = co.join; | |
| var fs = require('fs'); | |
| function size(file) { | |
| return function(fn){ | |
| fs.stat(file, function(err, stat){ | |
| if (err) return fn(err); | |
| fn(null, stat.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 thread = require('./'); | |
| var join = thread.join; | |
| var redis = require('redis'); | |
| var db = redis.createClient(); | |
| function get(key) { | |
| return function(done){ | |
| db.get(key, done); |
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
| $ cat example.txt | sum | |
| => 10 | |
| $ sum example.txt | |
| => 10 |
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 = [ { names: [ 'Clipper', 'XBase' ], | |
| matches: [ /^.+\.PRG$/, /^.+\.prg$/ ] }, | |
| { names: [ 'Cucumber', 'cucumber', 'Gherkin', 'gherkin' ], | |
| matches: [ /^.+\.feature$/ ] }, | |
| { names: [ 'RobotFramework', 'robotframework' ], | |
| matches: [ /^.+\.txt$/ ] }, | |
| { names: [ 'abap' ], matches: [ /^.+\.abap$/ ] }, | |
| { names: [ 'ada', 'ada95ada2005' ], | |
| matches: [ /^.+\.adb$/, /^.+\.ads$/, /^.+\.ada$/ ] }, | |
| { names: [ 'ahk' ], matches: [ /^.+\.ahk$/, /^.+\.ahkl$/ ] }, |