Skip to content

Instantly share code, notes, and snippets.

@ebuckley
ebuckley / gist:1842461
Created February 16, 2012 05:55
python code to encode/decode morse code
morseAlphabet ={
"A" : ".-",
"B" : "-...",
"C" : "-.-.",
"D" : "-..",
"E" : ".",
"F" : "..-.",
"G" : "--.",
"H" : "....",
"I" : "..",
@ebuckley
ebuckley / data.json
Created May 29, 2018 01:10
Ministry of silly walks test data
{
"@context": "https://www.data.govt.nz/catalog.jsonld",
"@id": "https://www.ministry-of-silly-walks.govt.nz/data.json",
"@type": "dcat:Catalog",
"conformsTo": "https://www.data.govt.nz/toolkit/schema",
"dataset":
[
{
"title": "Convention Activity Survey",
"description": "The Convention Activity Survey (CAS) monitors and benchmarks the performance of more than 300 professional conferencing and meeting venues in New Zealand. The CAS is the 'supply-side' component of the Convention Research Programme.",
{
"@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",
{
"@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",
"describedBy": "https://project-open-data.cio.gov/v1.1/schema/catalog.json",
"dataset": [
{
"@type": "dcat:Dataset",
"identifier": "http://data-niwa.opendata.arcgis.com/datasets/a2582b1eb3584237a3b50418f379ca84",
"title": "NZ Bathymetry 250m",
{
"@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",
@ebuckley
ebuckley / -
Last active October 2, 2018 02:50
{
"@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": [{
"identifier": "https://geodata.nzdf.mil.nz/layer/7866-sw-pacific-military-installation-areas/",
"title": "SW Pacific Military Installation Areas",
"description": "Show an installation designed for military use.",
"license": "https://creativecommons.org/licenses/by/4.0/",
"keywords": ["Population"],
@ebuckley
ebuckley / tehpwnerer.js
Last active September 27, 2018 09:11
A clashjs bot
import * as utils from '../lib/utils.js'
function distance(lhs, rhs) {
return Math.abs(Math.sqrt((lhs[0] - rhs[1]) **2 + (lhs[1] - rhs[1])**2))
}
function closestAmmo(thing, ammoPosition) {
return ammoPosition.map(ammo => {
const d = distance(thing.position, ammo)
@ebuckley
ebuckley / abalone_data.csv
Created July 16, 2018 01:54
Some sample CSV's
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 8 columns, instead of 9. in line 1.
Sex, Length, Diameter, Height, Whole weight, Viscera weight, Shell weight, Rings
M,0.455,0.365,0.095,0.514,0.2245,0.101,0.15,15
M,0.35,0.265,0.09,0.2255,0.0995,0.0485,0.07,7
F,0.53,0.42,0.135,0.677,0.2565,0.1415,0.21,9
M,0.44,0.365,0.125,0.516,0.2155,0.114,0.155,10
I,0.33,0.255,0.08,0.205,0.0895,0.0395,0.055,7
I,0.425,0.3,0.095,0.3515,0.141,0.0775,0.12,8
F,0.53,0.415,0.15,0.7775,0.237,0.1415,0.33,20
F,0.545,0.425,0.125,0.768,0.294,0.1495,0.26,16
M,0.475,0.37,0.125,0.5095,0.2165,0.1125,0.165,9
@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",
@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')