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
const co = require('co') | |
const Benchmark = require('benchmark') | |
const suite = new Benchmark.Suite | |
const Generate = () => new Promise(resolve => { | |
// resolve(1) | |
setImmediate(() => resolve(1)) | |
// setTimeout(() => resolve(1), 10) | |
}) |
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
(function(i) { | |
function q(e) { | |
var j = e.originalEvent.changedTouches[0], | |
f = ""; | |
switch (e.type) { | |
case "touchmove": | |
f = "mousemove"; | |
break; | |
case "touchend": | |
f = "mouseup"; |
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
[].forEach.call(document.all,function(e){-1!==e.constructor.name.indexOf("-")&&(e.style.border="3px solid red")}); |
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 primes = [2]; | |
var n = 3; // The number we are testing. Will be incremented. | |
function checkNextNumber() { | |
// It's sufficient to check if there are any prime factors up to sqrt(n) | |
n++; | |
var limitForChecking = Math.floor(Math.sqrt(n)); |
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
/** | |
* A `tail -f` implementation in Node.js. | |
* | |
* Original author : Bratish Goswami <bratishgoswami AT gmail DOT com> | |
* Modified by : Michel Bartz <michel.bartz AT manwin DOT com> | |
* | |
*/ | |
var sys = require("sys"), | |
fs = require('fs'), |
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
IMPORTANT: this is outdated, go to https://github.com/netroy/Lockets | |
"npm install socket-io" & you are ready to go |