Number of responses by zip code from the USGS' site from the 2011-11-05 3.2 quake near Piedmont, CA, USA, via Yahoo! Pipes.
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
web: node app.js |
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
void setup() { | |
size(640,480); | |
frame.setResizable(true); | |
} | |
void draw() { | |
background(frameCount); | |
} |
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
// preserve Twitter's style of JSON string encoding... | |
// escape higher value unicode (lowercase hex) | |
// escape < and > (uppercase hex) | |
// escape / in strings (\/) | |
// hugs! https://gist.github.com/1306986 | |
// http://stackoverflow.com/questions/4901133/json-and-escaping-characters | |
function escapedStringify(s, emit_unicode) { | |
var json = JSON.stringify(s); | |
return emit_unicode ? json : json.replace(/\//g, | |
function(c) { |
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
CC = clang | |
MAIN = main | |
SRCS = main.o | |
default: $(MAIN) | |
$(MAIN): $(SRCS) | |
$(CC) -O0 -Wall -o $(MAIN) $(SRCS) -framework Foundation |
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 http = require('http') | |
https = require('https'), | |
url = require('url'); | |
// proxy json requests to Twitter API, round-trip through JSON.parse/stringify: | |
http.createServer(function (req, res) { | |
if (req.url.indexOf('.json') == req.url.length - '.json'.length) { | |
var options = { host: 'api.twitter.com', path: req.url } | |
https.get(options, function(got) { |
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
/*jshint node:true globalstrict:true*/ | |
"use strict"; | |
var assert = require('assert'); | |
// | |
// Convenience function for building a simple UPDATE/SET/WHERE/RETURNING statement. | |
// | |
// e.g. | |
// |
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
uniform sampler2D camTex; | |
uniform sampler2D xTex; | |
uniform sampler2D yTex; | |
// HSL functions from http://code.google.com/p/glmixer/source/browse/trunk/shaders/imageProcessing_fragment.glsl?spec=svn195&r=195 | |
float HueToRGB(in float f1, in float f2, in float hue) | |
{ | |
if (hue < 0.0) | |
hue += 1.0; |
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
--- | |
BUNDLE_WITHOUT: "" |
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
// TODO: options parser with overrides for projection, area etc. | |
if (process.argv.length != 4) { | |
console.error("usage: node convert.js <input.json> <output.json>"); | |
process.exit(1); | |
} | |
require('d3') | |
require('./node_modules/d3-plugins/simplify/simplify.js') | |
var fs = require('fs'); |