Skip to content

Instantly share code, notes, and snippets.

// Does this stackoverflow NodeJS
function readMessage (queue, callback) {
setTimeout(function() { callback(queue); }, 0);
}
function testIt(count) {
readMessage(count, function (data) {
console.log(data);
testIt(data + 1);
});
@bernieperez
bernieperez / gist:9983330
Created April 4, 2014 21:17
Quick way to dump your transitive licenses from your node app.
'use strict';
var checker = require('license-checker');
// Example of how to use:
// cd to the node app directory
// node license.js ./ > ~/Desktop/app-name.csv
console.log("Name@version, repo, licenses");
@bernieperez
bernieperez / cookiebot.js
Last active December 25, 2015 01:19 — forked from jeresig/cookiebot.js
CookieBot = {
start: function() {
this.clickInterval = setInterval(function(){
// Click the large cook as fast as possible!
$("#bigCookie").click();
}, 1);
this.goldenCookieInterval = setInterval(function(){
// Make the golden cookie show up
Game.goldenCookie.delay=1;
// Click the large cook as fast as possible!
@bernieperez
bernieperez / touch.js
Last active January 3, 2019 08:48
Zepto's touch.js but working with jQuery and also removing the 300ms delay
// ************************************************************************
// You shouldn't use this anymore.
// http://updates.html5rocks.com/2013/12/300ms-tap-delay-gone-away
//
// Basically, disable double tap to zoom in on sites on a mobile device.
// <meta name="viewport" content="width=device-width">
//
// If you want to also disable pinch-zooming
// <meta name="viewport" content="width=device-width, user-scalable=no">
//
/*
This is a attempted at coding this up: http://blog.jazzychad.net/2012/08/01/array-iteration-problem.html
Did it in about 15 mins... I might use this for a phone screen questions.
I did use Sublime Text... but that's fine I think.
*/
public class Main {
public static void main(String[] args) {
// # add1 [1,4,1,5,1], 1, 0 -> [2,4,2,5,2]