Skip to content

Instantly share code, notes, and snippets.

View springmeyer's full-sized avatar

Dane Springmeyer springmeyer

View GitHub Profile
@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
@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);
}
}
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
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 ++
@kkaefer
kkaefer / README.md
Created February 29, 2012 21:05
Missing Tiles

Usage:

node missingtiles.js database.bigtiles > missing.txt node filter_blank.js database.bigtiles missing.txt > missing_filtered.txt node generate_coords.js missing_filtered.txt > missing.json

Note: the first task takes pretty long, like a couple of hours.

missingtiles.js and filter_blank.js output tms coordinates

@perrygeo
perrygeo / gist:1903033
Created February 24, 2012 19:09
Sed scripts to fix blank lines and whitespace; helps code comply with PEP8
# Removes whitespace chars from blank lines
pep8 -r --select=W293 -q --filename=*.py /usr/local/src/madrona/madrona/ | xargs sed -i 's/^[ \r\t]*$//'
# Removes trailing blank lines from files
pep8 -r --select=W391 -q --filename=*.py /usr/local/src/madrona/madrona/ | xargs sed -i -e :a -e '/^\n*$/{$d;N;ba' -e '}'
# Squashes consecutive blanks lines into one
pep8 -r --select=E303 -q --filename=*.py /usr/local/src/madrona/madrona/ | xargs sed -i '/./,/^$/!d'
# confirm
/* If you compile with -O2 the code will print "Wrong behavior", compiling
* with -O0 the code will print "Correct behavior".
*
* Tested with:
* Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)
* Target: x86_64-apple-darwin11.3.0
* Thread model: posix
*/
#include <stdio.h>

TileMill/Carto painting order hierarchy

Mapnik draws shapes using a painter's algorithm. Objects that are drawn first may be visually obstructed by objects that are painted later.

The paint order of objects is first controlled by the order of the layers - in a TileMill project, layers at the bottom of the list are drawn first and layers at the top of the list are drawn last.

Within each layer, you can control the order of group of styles via Carto attachments. If you don't explicitly create any attachments in Carto, a single default group will be created behind the scenes for all the rules in a layer.

Within each style rule the paint order of objects is defined by the order they are pulled from the datasource. For example, the first result from a database query is painted first, the second result is painted second, and so on. For file-based sources such as GeoJSON or Shapefiles you would have to edit the file in an external program to control this or

From 5e4425c51a6548562a20f310de329b74ab560985 Mon Sep 17 00:00:00 2001
From: Microsoft Interop Team <[email protected]>
Date: Wed, 15 Feb 2012 11:07:00 -0800
Subject: [PATCH] 64bit build on vcexpress
---
vcbuild.bat | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/vcbuild.bat b/vcbuild.bat
@creationix
creationix / jsonparse.js
Created February 13, 2012 23:20
event-only version of jsonparse
// Named constants with unique integer values
var C = {};
// Tokenizer States
var START = C.START = 0x11;
var TRUE1 = C.TRUE1 = 0x21;
var TRUE2 = C.TRUE2 = 0x22;
var TRUE3 = C.TRUE3 = 0x23;
var FALSE1 = C.FALSE1 = 0x31;
var FALSE2 = C.FALSE2 = 0x32;
var FALSE3 = C.FALSE3 = 0x33;