Skip to content

Instantly share code, notes, and snippets.

View netroy's full-sized avatar

कारतोफ्फेलस्क्रिप्ट™ netroy

View GitHub Profile
@netroy
netroy / generators-vs-asyncawait-vs-native-promises.js
Last active November 14, 2018 13:50 — forked from MarkHerhold/generators-vs-asyncawait.js
Generators VS Async/Await Performance
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)
})
(function(i) {
function q(e) {
var j = e.originalEvent.changedTouches[0],
f = "";
switch (e.type) {
case "touchmove":
f = "mousemove";
break;
case "touchend":
f = "mouseup";
@netroy
netroy / 140bytes.js
Last active August 29, 2015 14:01 — forked from ebidel/highlight_custom_elements.js
highlight all custom elements in dom
[].forEach.call(document.all,function(e){-1!==e.constructor.name.indexOf("-")&&(e.style.border="3px solid red")});
@netroy
netroy / primes.js
Created September 16, 2013 21:24 — forked from rakeshpai/primes.js
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));
@netroy
netroy / git tutorials.md
Created October 27, 2011 10:09
Awesome git tutorials I am finding here and there
/**
* 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'),
IMPORTANT: this is outdated, go to https://github.com/netroy/Lockets
"npm install socket-io" & you are ready to go