Skip to content

Instantly share code, notes, and snippets.

@BobHarper1
BobHarper1 / index.html
Last active March 30, 2017 08:09
Stop and Search
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.calendar {
font: 10px sans-serif;
shape-rendering: crispEdges;
}
.day {
fill: #fff;
@BobHarper1
BobHarper1 / index.html
Last active March 30, 2017 13:49
Stop and Search: Under-18s
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font-family: sans-serif;
}
.calendar {
font: 10px sans-serif;
@BobHarper1
BobHarper1 / GREL_postcode
Created April 26, 2017 14:40
GREL cell transform expression to fix O/0 problem in postcodes
if(isNotNull(value.match(/.*(o|O)\D{2}$/)), value.replace(value.match(/.*(o|O)\D{2}$/)[0], "0"), value)
@BobHarper1
BobHarper1 / BobsNI.json
Created May 8, 2017 16:22
odileeds uk hexmap
{
"layout":"odd-r",
"hexes": {
"E14000530":{"n":"Aldershot","q":-3,"r":-11,"a":"SE","u":"UKJ","p":72430},
"E14000531":{"n":"Aldridge-Brownhills","q":-3,"r":-1,"a":"WM","u":"UKG","p":60215},
"E14000532":{"n":"Altrincham and Sale West","q":-7,"r":3,"a":"NW","u":"UKD","p":71511},
"E14000533":{"n":"Amber Valley","q":0,"r":2,"a":"EM","u":"UKF","p":69510},
"E14000534":{"n":"Arundel and South Downs","q":0,"r":-15,"a":"SE","u":"UKJ","p":77242},
"E14000535":{"n":"Ashfield","q":1,"r":2,"a":"EM","u":"UKF","p":77091},
"E14000536":{"n":"Ashford","q":12,"r":-13,"a":"SE","u":"UKJ","p":85177},
@BobHarper1
BobHarper1 / .block
Last active June 1, 2017 08:13
Turnout rate for the 2017 Assembly Elections: difference from 2016
license: cc-by-4.0
height: 700
@BobHarper1
BobHarper1 / sessions.json
Last active June 6, 2017 13:52
Sample data from Better activities feed for Belfast leisure centres
[{
"startDate": "2017-06-06T13:10:00Z",
"endDate": "2017-06-06T15:45:00Z",
"name": "Swim For All",
"genderRestriction": "mixed",
"level": "All",
"url": "https://better.org.uk/leisure-centre/belfast/ballysillan-leisure-centre/timetable",
"image": "https://assets.better.org.uk/uploads/asset/attachment/27354/Homepage_Panels-Sport_Relief_2016.jpg",
"duration": "PT155M",
"location": {
@BobHarper1
BobHarper1 / female_65.csv
Last active August 23, 2017 15:40
Life Expectancy Decomposition Gap. Most and Least Deprived.
category name value
Circulatory CHD 0.5
Circulatory Stroke 0.1
Circulatory Other Circulatory 0.2
Respiratory Pneumonia 0.1
Respiratory Chronic Lower Respiratory Disease 0.5
Respiratory Other Respiratory 0.1
Cancer Lung 0.5
Cancer Breast 0.0
Cancer Prostate 0.0
@BobHarper1
BobHarper1 / female_birth.csv
Last active August 23, 2017 16:00
Life Expectancy Decomposition Gap. England and Northern Ireland.
category name value
Circulatory CHD 0.1
Circulatory Stroke 0.1
Circulatory Other Circulatory -0.1
Respiratory Pneumonia 0.1
Respiratory Chronic Lower Respiratory Disease 0.0
Respiratory Other Respiratory 0.0
Cancer Lung 0.0
Cancer Breast 0.0
Cancer Prostate 0.0
@BobHarper1
BobHarper1 / female_65.csv
Last active August 23, 2017 16:07
Life Expectancy Decomposition Gap. Urban Rural
category name value
Circulatory CHD 0.1
Circulatory Stroke 0.1
Circulatory Other Circulatory 0.0
Respiratory Pneumonia 0.0
Respiratory Chronic Lower Respiratory Disease 0.1
Respiratory Other Respiratory 0.0
Cancer Lung 0.2
Cancer Breast 0.0
Cancer Prostate 0.0
@BobHarper1
BobHarper1 / makefile
Created September 4, 2017 21:10
makefile to create land-area clipped adminsitrative boundaries
## download makefile to an empty directory
## create a directory within that called /output
## run 'make wards2012.shp' and 'make wards2012.geojson'
## the shapefile/geojson file will appear in /output
wards.zip:
curl -o 'wards.zip' 'http://osni-spatial-ni.opendata.arcgis.com/datasets/55cd419b2d2144de9565c9b8f73a226d_0.zip'
curl -o 'ni_outline.zip' 'http://osni-spatial-ni.opendata.arcgis.com/datasets/d9dfdaf77847401e81efc9471dcd09e1_0.zip'
OSNI_Open_Data_Largescale_Boundaries__NI_Outline.shp: ni_outline.zip