Skip to content

Instantly share code, notes, and snippets.

View springmeyer's full-sized avatar

Dane Springmeyer springmeyer

View GitHub Profile
From 6bbccf1fe0e000fd73e945368466cd27291483e3 Mon Sep 17 00:00:00 2001
From: Igor Zinkovsky <[email protected]>
Date: Thu, 1 Mar 2012 12:11:12 -0800
Subject: [PATCH] windows: return UV_ENOTSOCK when doing uv_pipe_connect to a
file
---
src/win/error.c | 1 +
src/win/pipe.c | 6 ++++++
test/test-list.h | 2 ++
Building GDAL 1.9 with MDB (PGeo) support on OS X Lion
- Download and install the "Java for Mac OS X 10.7 Update 1 Developer Package" from https://developer.apple.com/downloads/index.action
- Download jackcess-1.2.6.jar from http://sourceforge.net/projects/jackcess/files/jackcess/1.2.6/jackcess-1.2.6.jar/download
- Download http://mdb-sqlite.googlecode.com/files/mdb-sqlite-1.0.2.tar.bz2 to get commons-lang-2.4.jar and commons-logging-1.1.1.jar. They will go alongside jackcess in the $CLASSPATH after it builds.
- In the GDAL source root, edit the configure.in and replace it with https://gist.github.com/1975654
@ry
ry / fib.js
Created March 12, 2012 00:17
a proper fibonacci server in node. it will light up all your cores.
var http = require('http')
var fork = require('child_process').fork;
function fib(n) {
if (n < 2) {
return 1;
} else {
return fib(n - 2) + fib(n - 1);
}
}
@bwreilly
bwreilly / after_layer.js
Created March 16, 2012 20:06
openlayers with some backbone
Layer = Backbone.Model.extend();
Layer.prototype.initialize = function() {
var lyr = new olCls(this.get('name'), this.get('url'), opts);
this.set({ olLayer: lyr });
};
LayerView.prototype.render = function() {
var view = this;
var trucks = new Layer({name: 'Vehicles');
view.map.addLayer(trucks);
// refresh the vehicles and turn them into markers
@artemp
artemp / generate_metatiles.py
Created March 19, 2012 19:13
Render metatiles
#!/usr/bin/env python
from math import pi,cos,sin,log,exp,atan
import sys, os
DEG_TO_RAD = pi/180
RAD_TO_DEG = 180/pi
def minmax (a,b,c):
a = max(a,b)
@GothAck
GothAck / index.js
Created March 20, 2012 18:33
Parsing BIG compressed XML data (OpenStreetMap) with Node.js
#!/usr/bin/env node
/*
* Parsing BIG compressed data with Node.js and SAX
* Probably some bugs, but worked fine for OpenStreetMap Great Britain bz2
* Greg Miell 2012
*/
// Simple string trim prototype extension
String.prototype.trim = function() {
<?xml version="1.0" encoding="utf-8"?>
<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs" background-color="rgb(255,255,255)">
<Style name="drainage">
<Rule>
<Filter>([HYC]=8)</Filter>
<CompositingSymbolizer fill="rgb(153,204,255,127)" smooth="1" comp-op="exclusion"/>
</Rule>
</Style>
<Style name="highway-border">
<Rule>
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@perrygeo
perrygeo / gist:2279331
Created April 1, 2012 23:10
pep8 tricks
pep8 --statistics -qq --filename=*.py /usr/local/src/madrona/madrona/
pep8 --select=E202,E201 --repeat . > ~/pep8.txt
vim -q ~/pep8.txt
# :map z :cn
# type z to cycle through all instances; puts your cursor right on the spot
/*
In a child process, each of the stdio streams may be set to
one of the following:
1. A new file descriptor in the child, dup2'ed to the parent and
exposed to JS as a Stream object.
2. A copy of a file descriptor from the parent, with no other
added magical stuff.
3. A black hole - no pipe created.