Skip to content

Instantly share code, notes, and snippets.

🚀
rockets

Hamish Campbell hamishcampbell

🚀
rockets
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
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:
https://www.dia.govt.nz/diawebsite.nsf/wpg_URL/Resource-material-Information-We-Provide-All-Venues-and-Numbers-by-Territorial-AuthorityDistrict
Geocoded with addy.co.nz 13th March 2019 by Hamish Campbell
There are a few unfound addresses and no manual checking of other results has been done.
@hamishcampbell
hamishcampbell / SoT2015.md
Created Aug 7, 2015
SoT Hackfest API Suff
View SoT2015.md

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

View keybase.md

Keybase proof

I hereby claim:

  • I am hamishcampbell on github.
  • I am polemic (https://keybase.io/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
hamishcampbell / polyomino-obfus.py
Created Sep 7, 2013
Highly readable Polyomino solution
View polyomino-obfus.py
import sys, itertools
class Polyomino(tuple):
def __hash__(_):return(getattr(_,'',''))or[setattr(_,'',setattr(_,'_',map(min,zip(
*(setattr(_,'p',_.__class__((c[1],m-c[0]-1)for(c)in(_.p))if'p'in(_.__dict__)else(_))
or(getattr(_,'p'))))))or(min(getattr(_,'',hash(tuple(sorted(setattr(_,'p',_.__class__(
[(x-_._[0],y-_._[1])for(x,y)in(_.p)])if(_._[0]or(_._[1]))else(_.p))or(_.p))))),
hash(tuple(sorted(_.p))))))for(m)in(itertools.repeat(max(max(_,key=max)),4))]and(getattr(_,''))
def __eq__(*_):return(1&len(set(map(hash,_))))
def __call__(_,__):return[_.__class__(((__,__),))]if(not(1%__))else(set(itertools.chain(*[set([_.__class__
(_+tuple([a]))for(a)in(set((c[0]+x,c[1]+y)for(c,(x,y))in(itertools.product(
@hamishcampbell
hamishcampbell / polyomino.py
Created Sep 6, 2013
Polyomino Reference Source - PyCon 2013
View polyomino.py
# -*- 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
hamishcampbell / gist:4133562
Created Nov 23, 2012
Dojo 1.8 / AMD Style Gmaps Loader
View gist:4133562
/**
* Dojo AMD Google Maps Loader Plugin
*/
define([
"dojo/_base/kernel",
"dojo/topic"
], function(kernel, topic) {
var w = kernel.global;
w._googleApiLoadCallback = function() {
View polyomino.py
# -*- coding: utf-8 -*-
#!/usr/bin/env python
"""Finds n-order Polyominos
https://en.wikipedia.org/wiki/Polyomino
Hamish Campbell <hn.campbell@gmail.com>
http://polemic.net.nz
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'):
l.save()"
python -c "
from dandelion.datasources.models import *
for o in Origin.objects.all().order_by('pk'):
print o.pk, o.name
View gist:1174775

Poppy V2

Re-factor proposal.

Queries

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