Skip to content

Instantly share code, notes, and snippets.

View springmeyer's full-sized avatar

Dane Springmeyer springmeyer

View GitHub Profile
@jlivni
jlivni / gist:2925302
Created June 13, 2012 17:08
binary data for webgl
#appengine python
values = [1,2,3,4]
values = array('f',values)
response.out.write(values.tostring())
//JS loading
var xhr = new XMLHttpRequest();
xhr.open('GET', '/path/to/file', true);
xhr.responseType = 'arraybuffer';
@ranchodeluxe
ranchodeluxe / gist:2920609
Created June 12, 2012 22:47
data for debugging mapserver hanging processes
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
@jedschneider
jedschneider / gh-pages-tips.md
Created June 7, 2012 17:59
github pages tips for jekyll wiki

Working With Github Pages

The FAQ maintained by Github covers most stumbling blocks, some other tips and tricks supplied here.

Gitignore

Add _site to .gitignore. The generated site should not be uploaded to Github since its gets generated by github.

Working With Code Partials

@jboner
jboner / latency.txt
Last active May 12, 2025 05:04
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@brendangregg
brendangregg / gist:2670942
Created May 13, 2012 02:42
node.js fs.readFile analysis
Here's some more perf analysis: what was the limiter for node.js in the original fs.readFile benchmark,
causing large performance difference?
Examining thread microstates using prstat (SmartOS):
# prstat -mLcp 92432 1
Please wait...
[...]
PID USERNAME USR SYS TRP TFL DFL LCK SLP LAT VCX ICX SCL SIG PROCESS/LWPID
92432 root 90 10 0.0 0.0 0.0 0.0 0.0 0.0 7 9 42K 0 node/1
@tschaub
tschaub / split.js
Created May 4, 2012 14:21
quick implementation of polygon splitting process
// Execute method for js:split process expects polygon and line geometries as input
run: function(inputs) {
var merger = new LineMerger();
merger.add(inputs.poly._geometry);
merger.add(inputs.line._geometry);
var collection = merger.getMergedLineStrings();
var union = new UnaryUnionOp(collection).union();
var polygonizer = new Polygonizer();
polygonizer.add(union);
var cluster = require('cluster')
if (cluster.isMaster) {
// spawn worker bees
cluster.fork()
cluster.fork()
cluster.fork()
cluster.fork()
} else {
// worker bees only need root to listen, and then downgrade
@perrygeo
perrygeo / nearest_features.py
Created April 25, 2012 21:51
Find the nearest point features in a shapefile to a given coordinate
import numpy as np
from scipy.spatial import KDTree
from fiona import collection
def nearest_features(datasource, x, y, n=1):
"""
datasource: The ogr datasource path
x, y: coordinates to query for nearest
n: number of features (default = 1 or the single nearest feature)
@mojodna
mojodna / gist:2473893
Created April 23, 2012 21:10
Backup GitHub issues
"use strict";
var fs = require("fs"),
https = require("https"),
url = require("url"),
zlib = require("zlib");
/**
* Process HTTP responses. Handle compressed streams and convert to objects as
* appropriate.
// run with "node --expose_gc"
var weak = require('weak')
, util = require('util')
var count = 0
, countGc = 0
function dec () {
count--