Skip to content

Instantly share code, notes, and snippets.

View tnightingale's full-sized avatar

Tom Nightingale tnightingale

  • Test Double
  • Vancouver, Canada
View GitHub Profile
@tnightingale
tnightingale / gpsd_client_timeout_patch.py
Created October 8, 2013 02:00
Monkey-patching gpsd's Python client module to add rudimentary support for socket timeouts. Yay for redefining object methods at runtime! Python++
import socket, sys, time
import gps
from gps import GPSD_PORT
DEFAULT_TIMEOUT=5
def __init__(self, host="127.0.0.1", port=GPSD_PORT, verbose=0, timeout=DEFAULT_TIMEOUT):
self.sock = None # in case we blow up in connect
self.linebuffer = ""
self.verbose = verbose
!AIVDM,2,2,1,A,0000004,2*21
!AIVDM,1,1,,A,37f`Kf1P02O1:9T5IwJCEwv<0>`<,0*6B
!AIVDM,1,1,,B,15Mo710P00GRV?nCCKRHoOv@0>`<,0*62
!AIVDM,1,1,,2,34SLF05P000eVG0N`MR:N?vB0>`<,0*36
!AIVDM,1,1,,B,H3HfEhPu8<40000000000000000,2*4A
!AIVDM,3,1,6,A,507pS201v8hMHTE@p4m0i>r18DLU,0*2A
!AIVDM,3,2,6,A,=@E:1@v1E<D10@2110Au`0B3hj2C,0*3D
!AIVDM,3,3,6,A,BCR888888888888,2*41
!AIVDM,1,1,,B,1819kDh002JA;ld>rFr1T5PB0>`<,0*01
!AIVDM,1,1,,A,13aC4dPP000D=A>Mdv100?v>0>`<,0*2B
!AIVDM,2,2,1,A,0000004,2*21
!AIVDM,1,1,,A,37f`Kf1P02O1:9T5IwJCEwv<0>`<,0*6B
!AIVDM,1,1,,B,15Mo710P00GRV?nCCKRHoOv@0>`<,0*62
!AIVDM,1,1,,2,34SLF05P000eVG0N`MR:N?vB0>`<,0*36
!AIVDM,1,1,,B,H3HfEhPu8<40000000000000000,2*4A
!AIVDM,3,1,6,A,507pS201v8hMHTE@p4m0i>r18DLU,0*2A
!AIVDM,3,2,6,A,=@E:1@v1E<D10@2110Au`0B3hj2C,0*3D
!AIVDM,3,3,6,A,BCR888888888888,2*41
!AIVDM,1,1,,B,1819kDh002JA;ld>rFr1T5PB0>`<,0*01
!AIVDM,1,1,,A,13aC4dPP000D=A>Mdv100?v>0>`<,0*2B
!AIVDM,1,1,,B,B6:fN?@0@220cJ3:tS5?LwS61P06,0*
48
@tnightingale
tnightingale / map.geojson
Created August 13, 2013 20:55
via:geojson.io
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<?php
// drupal_flush_all_caches();
$resource = geojson_load(geojson_info_load('all-tus-values'));
$start = microtime(TRUE);
enable_xhprof();
$geojson = $resource->geojson();
disable_xhprof('Resource::geojson()');
$end = microtime(TRUE);
$geojson_time = $end - $start;
@tnightingale
tnightingale / README.md
Last active December 12, 2015 05:58
Introduction to D3js: Examples
@tnightingale
tnightingale / LICENSE.txt
Last active October 25, 2019 16:50
Christchurch 2010 Timeline
The MIT License (MIT)
Copyright (c) 2014 Tom Nightingale
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@tnightingale
tnightingale / README.md
Last active December 12, 2015 04:08
Graffiti in Vancouver

Hexbin layer showing locations of sites with graffiti as identified by Vancouver City staff.

Data from the City of Vancouver's Open Data Catalogue.

@tnightingale
tnightingale / README.md
Last active October 25, 2019 16:51
Christchurch Earthquakes

This map shows earthquakes (magnitude 3.0 or greater) that occurred in the Canterbury region of New Zealand during the month of September, 2010.

The map is created using Leaflet. The earthquake layer is a custom Leaflet layer which uses d3js to generate a svg overlay.

Earthquake data sourced from GeoNet.