The default evaluator will automatically load Node.js core modules into the REPL environment when used... https://nodejs.org/api/repl.html
$ node
> querystring.parse("")
{}
Easy peezy lemon sqeezy!
// http://stackoverflow.com/a/2117523/1983554 | |
function createId() { | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' | |
.replace(/[xy]/g, function(c) { | |
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); | |
return v.toString(16); | |
}); | |
} |
function secretary(people, weekNumber){ | |
var index = weekNumber % people.length; | |
return people[index]; | |
} |
#!/usr/bin/env node | |
// 1. add shebang above | |
// 2. make file executable | |
// $ chmod +x pipeToMe.js | |
// 3. pipe from file | |
// $ cat file | ./pipeToMe.js | |
// 4. pipe from echo | |
// $ echo -n one two | ./pipeToMe.js | |
// 5. just pass some args |
The default evaluator will automatically load Node.js core modules into the REPL environment when used... https://nodejs.org/api/repl.html
$ node
> querystring.parse("")
{}
Easy peezy lemon sqeezy!
.listen
process.env.NODE_ENV
function errorHandler(err, req, res, next) {
// err is either obj or string
http://gsgd.co.uk/sandbox/jquery/easing/jquery.easing.1.3.js https://github.com/gdsmith/jquery.easing/blob/master/jquery.easing.js#L21
Relevant parts
// Preserve the original jQuery "swing" easing as "jswing"
$.easing['jswing'] = $.easing['swing'];
$.extend( $.easing,
Array.prototype.indexOff = function(x) { | |
if (this.length === 0) { | |
return -1 | |
} | |
for (var i = 0; i < this.length; i++) { | |
if (this[i] === x) { | |
return i | |
} | |
} | |
return -1 |
Meaures from fast.com
$ npm i -g fast-cli
$ fast [> file]
Meaures from speedtest.net