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
TarGZ = function(){}; | |
// Load and parse archive, calls onload after loading all files. | |
TarGZ.load = function(url, onload, onstream, onerror) { | |
var o = new TarGZ(); | |
o.onload = onload; | |
o.onerror = onerror; | |
o.onstream = onstream; | |
o.load(url); | |
return o; |
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
// node.js geo polygon map tile rendering! | |
// requires https://github.com/learnboost/node-canvas and GeoJSON data files | |
// e.g. | |
// data from naturalearthdata.com converted to GeoJSON with GDAL's ogr2ogr | |
// or from datasf.org, reprojected too: | |
// ogr2ogr -f GeoJSON sfbay.js sfbay.shp -t_srs EPSG:4326 | |
var Canvas = require('./vendor/node-canvas/lib/canvas'), | |
http = require('http'), | |
fs = require('fs'); |
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
#!/bin/bash | |
# | |
# This script installs and configures couchdb on a fresh Amazon Linux AMI instance. | |
# | |
# Must be run with root privileges | |
# Tested with Amazon Linux AMI release 2011.02.1.1 (ami-8c1fece5) | |
# | |
export BUILD_DIR="$PWD" |
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
function cloneObject(object) { | |
return extendObject({}, object); | |
} | |
function extendObject(base, object) { | |
var visited = [object]; | |
// http://en.wikipedia.org/wiki/Adjacency_list_model | |
var set = [{value: base}]; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="/socket.io/socket.io.js"></script> | |
<script> | |
(function () { | |
var onMessage = function (data) { | |
// Do something with the message data | |
}; |
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
worker_processes 4; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
default_type application/octet-stream; | |
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | |
'$status $body_bytes_sent "$http_referer" ' |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>OnDemand</key> | |
<false/> | |
<key>KeepAlive</key> | |
<true/> | |
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
#! /bin/bash | |
# -*- shell-script -*- | |
margin=4 | |
# XPDF gives its y coordinates in terms of the standard PDF coordinate | |
# system, where (0,0) is the bottom left corner and y increases going | |
# up. But pdftocairo uses Cairo coordinates, in which (0,0) is the top | |
# left corner and y increases going down. We can use pdfinfo to get | |
# the page size to translate between these conventions. |
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
function linkProgram(gl, vsource, fsource) | |
{ | |
if(gl == undefined) | |
{ | |
alert("Your browser does not support WebGL, try Google Chrome? Sorry."); | |
throw "Your browser does not support WebGL, try Google Chrome? Sorry."; | |
} | |
var program = gl.createProgram(), | |
vshader = createShader(gl, vsource, gl.VERTEX_SHADER), |
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
(function () { | |
// Implement debounce until backburner implements a proper debounce | |
var debouncees = [], | |
pop = Array.prototype.pop; | |
var debounce = function (target, method /*, args, wait */) { | |
var self = Ember.run.backburner, | |
args = arguments, | |
wait = pop.call(args), |
OlderNewer