Skip to content

Instantly share code, notes, and snippets.


Hamish Campbell hamishcampbell

Block or report user

Report or block hamishcampbell

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
hamishcampbell / description.txt
Created Mar 13, 2019
Mostly Geocoded NZ Pokie Machine Locations December 2018
View description.txt
Pokie machies by location (Dec 2018), CC-BY DIA NZ from:
Geocoded with 13th March 2019 by Hamish Campbell
There are a few unfound addresses and no manual checking of other results has been done.
hamishcampbell /
Created Aug 7, 2015
SoT Hackfest API Suff

SoT Hackfest Auckland 2015

Welcome! This is a brief, opinionated guide to getting started building a browser-based web app with RESTful APIs. The intention is to provide a starting point for building stuff for SoT Hackfest 2015, and provides just one approach. It is not the only approach, nor is it necessarily the best approach for a production system, but it's a good way to jumpstart your hack.

Useful references


Keybase proof

I hereby claim:

  • I am hamishcampbell on github.
  • I am polemic ( on keybase.
  • I have a public key whose fingerprint is DAD5 7EEC 292E 8C9E B5DA 3CF8 63D3 ADE1 5625 3865

To claim this, I am signing this object:

hamishcampbell /
Created Sep 7, 2013
Highly readable Polyomino solution
import sys, itertools
class Polyomino(tuple):
def __hash__(_):return(getattr(_,'',''))or[setattr(_,'',setattr(_,'_',map(min,zip(
def __eq__(*_):return(1&len(set(map(hash,_))))
def __call__(_,__):return[_.__class__(((__,__),))]if(not(1%__))else(set(itertools.chain(*[set([_.__class__
hamishcampbell /
Created Sep 6, 2013
Polyomino Reference Source - PyCon 2013
# -*- coding: utf-8 -*-
#!/usr/bin/env python
import sys
class Polyomino(object):
def __init__(self, iterable):
self.squares = tuple(sorted(iterable))
def __repr__(self):
View sha.js
console.log(require('crypto').createHash('sha1').update('blob 14\0Hello, World!').digest('hex'));
$> d4fcfe4d339d4e59d168fdf3c0ad445fa980a7d6
hamishcampbell / gist:4133562
Created Nov 23, 2012
Dojo 1.8 / AMD Style Gmaps Loader
View gist:4133562
* Dojo AMD Google Maps Loader Plugin
], function(kernel, topic) {
var w =;
w._googleApiLoadCallback = function() {
# -*- coding: utf-8 -*-
#!/usr/bin/env python
"""Finds n-order Polyominos
Hamish Campbell <>
License: CC-BY 2012, use it for good, not for evil.
View gist:1260675
django-admin migrate
python -c "
from dandelion.metadata.models import *
for l in Layer.objects.filter(is_deleted=False, state='PUBLISHED'):"
python -c "
from dandelion.datasources.models import *
for o in Origin.objects.all().order_by('pk'):
View gist:1174775

Poppy V2

Re-factor proposal.


  • BaseQuery
    • PointQuery
      • VectorPointQuery
      • RasterPointQuery
You can’t perform that action at this time.