Skip to content

Instantly share code, notes, and snippets.

View eightysteele's full-sized avatar

Aaron Steele eightysteele

View GitHub Profile
$ node examples/readme_server.js
node.js:116
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'tilelive-mapnik'
at Function._resolveFilename (module.js:290:11)
at Function._load (module.js:242:25)
at require (module.js:318:19)
at Object.<anonymous> (/home/eighty/Dropbox/windshaft/Windshaft/lib/windshaft/render_cache.js:9:1)
$ npm install Windshaft/
> hiredis@0.1.12 preinstall /home/eighty/Dropbox/windshaft/node_modules/windshaft/node_modules/grainstore/node_modules/hiredis
> make || gmake
cd deps/hiredis && make static
make[1]: Entering directory `/home/eighty/Dropbox/windshaft/node_modules/windshaft/node_modules/grainstore/node_modules/hiredis/deps/hiredis'
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb net.c
> srs@0.2.7 install /home/eighty/Dropbox/windshaft/node_modules/windshaft/node_modules/grainstore/node_modules/srs
Build failed:
-> task failed (err #1):
{task: cxx mapnik_geometry.cpp -> mapnik_geometry_1.o}
-> task failed (err #1):
{task: cxx mapnik_image.cpp -> mapnik_image_1.o}
npm ERR! error installing mapnik@0.5.5 Error: mapnik@0.5.5 install: `node-waf -v configure build`
npm ERR! error installing mapnik@0.5.5 `sh "-c" "node-waf -v configure build"` failed with 1
npm ERR! error installing mapnik@0.5.5 at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing mapnik@0.5.5 at ChildProcess.emit (events.js:45:17)
npm ERR! error installing mapnik@0.5.5 at ChildProcess.onexit (child_process.js:171:12)
@eightysteele
eightysteele / gist:1201349
Created September 7, 2011 18:39
Patch for caching OAuth 2.0 credentials
Index: src/ftclient.py
===================================================================
--- src/ftclient.py (revision 22)
+++ src/ftclient.py (working copy)
@@ -15,6 +15,12 @@
import authorization.oauth
except: pass
+import httplib2
+from oauth2client.file import Storage
@eightysteele
eightysteele / data.csv
Created August 27, 2011 01:05
Unicode DictReader and DictWriter
id name age
0 aaron 34
1 tina 36
2 noah ©
INFO:root:Performing a dry run...
INFO:root:Processing source directories: ['iucn', 'jetz']
INFO:root:Collections in iucn: ['mammals', 'amphibians']
INFO:root:Processing 1 layers in the mammals collection
INFO:root:Extracting DBF fields from abditomys_latidens.shp
INFO:root:All collection metadata saved to collection.csv.txt
INFO:root:Dry run complete!
json = simplejson.dumps(dict((k, v) for k,v in simplejson.loads(recjson) if k is not None))
python_preamble:
- import: base64
- import: re
- import: google.appengine.ext.bulkload.transform
- import: google.appengine.ext.bulkload.bulkloader_wizard
- import: google.appengine.ext.db
- import: google.appengine.api.datastore
- import: bulkload_helper
transformers:
@eightysteele
eightysteele / gist:1145809
Created August 15, 2011 06:40
Bulkload post_import_function that shims in a repeated StructuredProperty.
def add_polygons(input_dict, instance, bulkload_state_copy):
"""Bulkload post_import_function that shims in a repeated StructuredProperty.
This function allows us to bulkload a StructuredProperty model using the App
Engine bulkloader by adding the following lines to the bulkload.yaml
configuration file:
- kind: LayerIndex
connector: csv
connector_options:
from ndb import model
class LayerPolygon(model.Model):
polygonid = model.StringProperty('p', required=True)
areaid = model.StringProperty('a', required=True)
specieslatin = model.StringProperty('s', required=True)
source = model.StringProperty('r', required=True)
class LayerIndex(model.Expando):
polygons = model.StructuredProperty(LayerPolygon, repeated=True)