Skip to content

Instantly share code, notes, and snippets.

@hgarcia
hgarcia / server.js
Created October 12, 2011 00:25
Vanilla exec and response
var http = require('http');
var exec = require('child_process').exec;
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
exec('curl www.yahoo.com', function (error, stdout, stderr) {
//Parse stdout/stderr if/as needed
@tmpvar
tmpvar / opengl-learning.md
Created August 13, 2011 23:00
Opengl factoids
@nrabinowitz
nrabinowitz / quantize.js
Created July 25, 2011 17:19
Javascript module for color quantization, based on Leptonica
/*!
* quantize.js Copyright 2008 Nick Rabinowitz.
* Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
*/
// fill out a couple protovis dependencies
/*!
* Block below copied from Protovis: http://mbostock.github.com/protovis/
* Copyright 2010 Stanford Visualization Group
* Licensed under the BSD License: http://www.opensource.org/licenses/bsd-license.php
@joshgillies
joshgillies / bespin-bookmarklet-4-mysource-matrix.js
Created January 11, 2011 01:07
WIP: Enable the Bespin Bookmarklet to enable fancy editing of MySource Matrix design parse files
javascript:(function(){var%20elem=document.createElement('script');elem.setAttribute('src','https://bespin.mozillalabs.com/bookmarklet/bookmarklet.js');document.getElementById('main_frameset').getElementsByTagName('frame')[2].contentWindow.document.body.appendChild(elem);})()
// Alternative JavaScript Syntax
Person = :(name, address) { @name!, @address! }
Person::inspect = :{ <: "{@name} lives at {@address}" }
tj := Person('TJ', '314 Bessborough ave')
bob := Person('Bob', 'Some place')
[tj, bob].each(:(person){ print(person.inspect()) })