Skip to content

Instantly share code, notes, and snippets.

View cspanring's full-sized avatar

Christian Spanring cspanring

  • Crewbook
  • Somerville, MA
View GitHub Profile
@cspanring
cspanring / index.html
Created August 8, 2013 19:14
via:geojson.io
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
.marker-properties {
border-collapse:collapse;
@cspanring
cspanring / shp2pgsql.sh
Created August 15, 2013 14:47
Shapefile to PostGIS batch import bash script
#!/bin/bash
EPSG_CODE=<EPSG_CODE>
DATABASE_NAME=<DATABASE_NAME>
DATABASE_SCHEMA=<DATABASE_SCHEMA>
DATABASE_USER=<DATABASE_USER>
for f in *.shp
do
shp2pgsql -I -s $EPSG_CODE -d $f $DATABASE_SCHEMA.`basename $f .shp` > `basename $f .shp`.sql
done
@cspanring
cspanring / nginx.conf
Created August 15, 2013 19:24 — forked from mbertrand/nginx.conf
GeoNode nginx configuration (with supervisor)
server {
listen 80;
server_name mydomain.edu localhost;
location /static {
alias /www/geonode/src/GeoNodePy/geonode/static_root;
}
#GEOSERVER
@cspanring
cspanring / index.html
Last active December 26, 2015 19:39
Basic CartoDB, Leaflet, UTFGrid example.
<!DOCTYPE html>
<html>
<head>
<title>Leaflet CartoDB Example</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
@cspanring
cspanring / index.html
Last active December 27, 2015 16:49
Basic Leaflet CartoDB Core Example
<!DOCTYPE html>
<html>
<head>
<title>Leaflet CartoDB Core Example</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
@cspanring
cspanring / app.js
Created November 10, 2013 02:18
Ember CartoDB Leaflet Example
App = Ember.Application.create();
App.IndexView = Ember.View.extend({
cartoDbUser: 'cspanring',
cartoDbSql: 'SELECT * FROM cambridge_neighborhoods',
cartoDbCartoCss: '#cambridge_neighborhoods { \
polygon-fill: yellow; \
polygon-opacity: 0.2; \
line-width: 2; \
L.Control.Button = L.Control.extend({
options: {
position: 'bottomleft'
},
initialize: function (options) {
this._button = {};
this.setButton(options);
},
@cspanring
cspanring / add_openfilegdb_drv.diff
Created May 7, 2014 15:55
Adds OpenFileGDB GDAL driver to QGIS 2.2
From c54e2a8f30d3755550c61fc7a2f55df928c1cf50 Mon Sep 17 00:00:00 2001
From: Christian Spanring <cspanring@gmail.com>
Date: Wed, 7 May 2014 11:40:09 -0400
Subject: [PATCH] Add OpenFileGDB read-only driver option to OGR directory
drivers
available in gdal-1.11.0.
See https://github.com/qgis/QGIS/commit/a096cf45e4ad2fe9dc35fdb3d4453c73e26e7621 for details in QGIS master.
---
src/providers/ogr/qgsogrprovider.cpp | 4 ++++
@cspanring
cspanring / map.geojson
Last active August 29, 2015 14:01
Somerville Porchfest 2014, the plan. (full map and listing: http://www.somervilleartscouncil.org/porchfest/map/2014)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cspanring
cspanring / isodate.js
Created August 19, 2014 15:46
Ember Data Isodate Transform (requires moment.js)
import DS from 'ember-data';
export default DS.Transform.extend({
deserialize: function(serialized) {
if (serialized) {
return moment(serialized).toDate();
}
return serialized;
},