Skip to content

Instantly share code, notes, and snippets.

// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@FugueNation
FugueNation / checker.js
Created December 19, 2012 10:50
checker.js
var _ = require('underscore');
var Seq = require('seq');
var request = require('request');
var crypto = require('crypto');
var fs = require('fs');
fs.readFile('manifest.json', function (err, data) {
if (err) return console.log(err.message);
var manifest = JSON.parse(data);
@FugueNation
FugueNation / almost a module
Created December 10, 2011 14:56
Ultra fast Metrics with Node.js & Redis's bitmaps
var EventEmitter = require("events").EventEmitter,
redis = require("redis"),
dateformat = require("dateformat");
function population32(x)
{
x -= ((x >> 1) & 0x55555555);
x = (((x >> 2) & 0x33333333) + (x & 0x33333333));
x = (((x >> 4) + x) & 0x0f0f0f0f);
x += (x >> 8);
@FugueNation
FugueNation / main.js
Created December 4, 2011 05:14
Super Simple Node.js server
var simpleServer = require('simpleServer');
simpleServer({
tiemout : 1000,
router : {
hello : {
world : function( data, client ) {
client.reply( null, { you : data.name } );
},
},