readline = require "readline"
rl = readline.createInterface
input: process.stdin
output: process.stdout
You could use named functions to better read callbacks instead of deeply nested
license: gpl-3.0 |
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); |
<!DOCTYPE html> | |
<body id="body" class="abc"><script src="Array.prototype.slice.js"></script><script src="testing-Array.prototype.slice.js"></script> | |
</body> |
this.EventEmmiter = (function() { | |
var events = {}; | |
var UUID = -1; | |
// Function to publish/trigger events | |
function trigger(evt, args) { | |
if (!events[evt]) { | |
return false; |
#define HTTP_STATUS_100 "100 Continue" | |
#define HTTP_STATUS_101 "101 Switching Protocols" | |
#define HTTP_STATUS_102 "102 Processing" | |
#define HTTP_STATUS_200 "200 OK" | |
#define HTTP_STATUS_201 "201 Created" | |
#define HTTP_STATUS_202 "202 Accepted" | |
#define HTTP_STATUS_203 "203 Non-Authoritative Information" | |
#define HTTP_STATUS_204 "204 No Content" | |
#define HTTP_STATUS_205 "205 Reset Content" | |
#define HTTP_STATUS_206 "206 Partial Content" |
var car_options = 0x5; // binary 0101 | |
var LEATHER_SEATS = 0x1; // 0001 | |
var TURBO = 0x2; // 0010 | |
var HID_LIGHTS = 0x4; // 0100 | |
var SPORT_KIT = 0x8; // 1000 | |
var daves_car = LEATHER_SEATS | HID_LIGHTS | SPORT_KIT; // 0001 | 0100 | 1000 => 1011 // 1 + 4 + 8 = 13 |
/** | |
* Author: Michael Weibel <michael.weibel@gmail.com> | |
* License: MIT | |
*/ | |
var passport = require('passport') | |
, StrategyMock = require('./strategy-mock'); | |
module.exports = function(app, options) { | |
// create your verify function on your own -- should do similar things as |
var delay = (function(){ | |
var timer = 0; | |
return function(callback, ms){ | |
clearTimeout (timer); | |
timer = setTimeout(callback, ms); | |
}; | |
})(); | |
var checkIfMobile = function() { |