Skip to content

Instantly share code, notes, and snippets.

require 'net/http'
require 'json'
#hamilton RegionId
hamilton = 16
waikato = 14
# make a query to the Residential endpoiint of the trademe search api
#
# @param argument_hash Hash
@ebuckley
ebuckley / gist:fe86d02552fd487c0829
Last active August 29, 2015 14:03
Daily programmer
/**
* Daily programmer weekly challenge http://www.reddit.com/r/dailyprogrammer/comments/2a3pzl/weekly_1_handling_console_input/
*/
package main
import (
"bufio"
"log"
"os"
"strconv"
@ebuckley
ebuckley / prettyprintpythonchortcut
Last active December 20, 2015 04:59
Just a handy little pattern
# shortcuts
import pprint
printer = pprint.PrettyPrinter(indent=4)
pp = printer.pprint
@ebuckley
ebuckley / gist:6254097
Created August 16, 2013 22:39
Template for nz programming competition
# template for starting a programming contest question
# shortcuts
import pprint
printer = pprint.PrettyPrinter(indent=4)
pp = printer.pprint
def do_work(data):
""" after reading a file data is passed into this function"""
set nocompatible
set list nolist
inoremap jj <esc>
runtime bundle/pathogen.vim
silent! call pathogen#helptags()
silent! call pathogen#runtime_append_all_bundles()
filetype plugin indent on
syntax on
Code Review Checklist
Understand the change
Read Pull Request description and Ticket
Functional Test
Does it work from a clean install?
Does it solve the problem and satisfy the AC?
(Green Path) Does everything work if you go through the intended steps?
(Red Path) Does the application help you and make sense when things go wrong?
@ebuckley
ebuckley / goodtest.component.spec.ts
Last active October 2, 2017 22:07
Fast tests are the best
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { By } from '@angular/platform-browser';
import { NO_ERRORS_SCHEMA } from '@angular/core';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
@ebuckley
ebuckley / gist:5c7399ba9f36ca0bc954731304419216
Created February 15, 2018 06:54
test_waikato_dcat_output.json
{
"@context": "https://www.data.govt.nz/catalog.jsonld",
"@id": "ersin.nz/data.json",
"@type": "dcat:Catalog",
"conformsTo": "https://www.data.govt.nz/toolkit/schema",
"dataset":[
{
"title": "Rivers and streams: monitoring and reporting",
"description": "Waikato Regional Council regularly monitors and reports on the quality of our region's river and stream resources, and the pressures that face these waterbodies and the plants and animals that rely on them for habitat.",
"identifier": "https://www.waikatoregion.govt.nz/Environment/Environmental-information/Environmental-indicators/River-and-streams/",
@ebuckley
ebuckley / stewards.py
Created March 7, 2018 04:23
graph stewards using jupyter notebook
stewards = [
("Steve", "Alice"),
("Alice", "Boris"),
("Boris", "Einstein"),
("Einstein", "Linus"),
("Linus", "Steve")
]
from graphviz import *
g = Digraph(name='stewards', engine='neato')
@ebuckley
ebuckley / data.json
Last active June 20, 2018 07:12
test-fixture-gis-pieshops
{
"@context": "https://project-open-data.cio.gov/v1.1/schema/catalog.jsonld",
"@type": "dcat:Catalog",
"conformsTo": "https://project-open-data.cio.gov/v1.1/schema",
"dataset": [
{
"@type": "dcat:Dataset",
"accessLevel": "public",
"contactPoint": {
"@type": "vcard:Contact",