Skip to content

Instantly share code, notes, and snippets.

Drinking tea

Matt Walker walkermatt

Drinking tea
Block or report user

Report or block walkermatt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
walkermatt / map_reduce.js
Last active Aug 29, 2015
Toy map / reduce functions in JavaScript
View map_reduce.js
// Define reduce, fn and list are required, init is an optional initial value
// which will be passed to fn with the first item in list
function reduce(fn, list, init) {
var val = init,
start = 0;
if (val === undefined) {
if (list.length > 1) {
val = list[0];
start = 1;
} else {
walkermatt /
Last active Aug 29, 2015
GNU Parallel all the things!
find /var/data/osmm/ -type f -print0 | \
parallel -0 python loader.config "src_dir={}"
walkermatt / osgis.geojson
Last active Aug 29, 2015
Location map for OSGIS 2014
View osgis.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
walkermatt /
Last active Aug 29, 2015
Set up OSGeo Live Xubuntu instance for OL3 & Leaflet workshop
setxkbmap gb && sudo apt-get install git-core gedit && cd && git clone ; cd osgis-ol3-leaflet ; gedit ol3/ol3.js & firefox &
View map2.js
// Extent of the map in units of the projection (these match our base map)
var extent = [-3276800, -3276800, 3276800, 3276800];
// Fixed resolutions to display the map at (pixels per ground unit (meters when
// the projection is British National Grid))
var resolutions = [1600,800,400,200,100,50,25,10,5,2.5,1,0.5,0.25,0.125,0.0625];
// Define WGS84 projection (copied from
proj4.defs("EPSG:3857","+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 +wktext +no_defs");
View create_index.sql
SELECT 'CREATE INDEX ' || quote_ident(f_table_name || '_geom_idx') || ' ON ' || quote_ident(f_table_schema) || '.' || quote_ident(f_table_name) || ' USING GIST (' || quote_ident(f_geometry_column) || ');' AS SQL
FROM geometry_columns
WHERE f_table_name IN ('topographicarea',
View gist:7594cf5e82a70f2c3fd7
function hexToRgb(hex) {
return 'rgb(' + hex.slice(1).match(/../g).map(c => parseInt(c, 16)) +')'
walkermatt / gist:1383021
Created Nov 21, 2011 — forked from eriwen/gist:187610
Pythonic site monitor
View gist:1383021
#!/usr/bin/env python
# sample usage:
import pickle, os, sys, logging
from httplib import HTTPConnection, socket
from smtplib import SMTP
def email_alert(message, status):
fromaddr = ''
walkermatt / disaggregate_postgis_complex_contents.sql
Created Nov 25, 2011
Disaggregate MultiLineStrings using ST_Dump PostGIS
View disaggregate_postgis_complex_contents.sql
SELECT *, ST_GeometryType(geom) as geom_type, ST_AsEWKT(geom) as geom_wkt from complex;
walkermatt / loader.config
Created Jun 4, 2012
Loader config for AddressBase Plus on Windows into PostgreSQL
View loader.config
ogr_cmd=ogr2ogr -append -skipfailures -f PostgreSQL PG:'dbname=test active_schema=public host=localhost port=5432 user=postgres password=******' $file_path
prep_cmd=python $file_path prep_osgml.prep_addressbase
You can’t perform that action at this time.