Skip to content

Instantly share code, notes, and snippets.

@BobHarper1
BobHarper1 / hourlyheatmap.R
Last active January 26, 2021 15:37
Hourly heatmaps for visualisation of air quality data
## created after John Mackintosh's guide here http://johnmackintosh.com/2016-12-01-the-hourly-heatmap/. Thanks John!
library(ggplot2)
library(dplyr) # data wrangling
library(viridis) # colour blind friendly palettes, see https://cran.r-project.org/web/packages/viridis/vignettes/intro-to-viridis.html
library(lubridate) # for easy date manipulation
library(ggExtra)
library(tidyr)
library(readr)
@BobHarper1
BobHarper1 / belfast_bikes_2019-06-07.csv
Last active June 7, 2019 21:40
belfast bike network july 2019
latitude longitude altitude geometry @id amenity capacity contact:email contact:phone name network opening_hours operator ref start_date website description addr:street wheelchair fee payment:credit_cards payment:mastercard payment:visa payment:visa_debit
54.5921715 -5.9255467 Point node/3660017569 bicycle_rental 12 belfastbikes@nsl.co.uk +44 34 3357 1551 Gasworks (Cromac Street) Belfast Bikes 06:00-00:00 Belfast Bikes (Belfast City Council) 3907 2015-04-27 https://www.belfastbikes.co.uk/en/belfast/
54.6049485 -5.9215345 Point node/3660017570 bicycle_rental 14 belfastbikes@nsl.co.uk +44 34 3357 1551 Corporation Square Belfast Bikes 06:00-00:00 Belfast Bikes (Belfast City Council) 3922 2015-04-27 https://www.belfastbikes.co.uk/en/belfast/
54.5912531 -5.9226342 Point node/3661477546 bicycle_rental 16 belfastbikes@nsl.co.uk +44 34 3357 1551 Gasworks (Lagan Towpath) Belfast Bikes 06:00-00:00 Belfast Bikes (Belfast City Council) 3927 2015-04-27 https://www.belfastbikes.co.uk/en/belfast/
@BobHarper1
BobHarper1 / belfastbikes_routes_20160527.geojson
Created January 15, 2019 16:34
belfastbikes_routes_20160527.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@BobHarper1
BobHarper1 / belfastbikes_stations_20190109.csv
Last active January 9, 2019 09:46
Belfast Bikes 2019-01-09
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 17 columns, instead of 11. in line 4.
latitude,longitude,altitude,geometry,@id,amenity,capacity,contact:email,contact:phone,name,network,opening_hours,operator,ref,start_date,website,addr:street
54.5921715,-5.9255467,,Point,node/3660017569,bicycle_rental,12,belfastbikes@nsl.co.uk,+44 34 3357 1551,Gasworks (Cromac Street),Belfast Bikes,06:00-00:00,Belfast Bikes (Belfast City Council),3907,2015-04-27,http://www.belfastbikes.co.uk/en/belfast/,
54.6049485,-5.9215345,,Point,node/3660017570,bicycle_rental,14,belfastbikes@nsl.co.uk,+44 34 3357 1551,Corporation Square,Belfast Bikes,06:00-00:00,Belfast Bikes (Belfast City Council),3922,2015-04-27,http://www.belfastbikes.co.uk/en/belfast/,
54.5912531,-5.9226342,,Point,node/3661477546,bicycle_rental,16,belfastbikes@nsl.co.uk,+44 34 3357 1551,Gasworks (Lagan Towpath),Belfast Bikes,06:00-00:00,Belfast Bikes (Belfast City Council),3927,2015-04-27,http://www.belfastbikes.co.uk/en/belfast/,
54.5972712,-5.9211082,,Point,node/3662871700,bicycle_rental,24,belfastbikes@nsl.co.uk,+44 34 3357 1551,Waterfront,Belfast B
@BobHarper1
BobHarper1 / index.html
Last active October 18, 2018 12:47
Fermanagh Community Transport trips made on a weekday in October 2016. See http://data.nicva.org/article/stormont-threat-lifeline-rural-communities for more context
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title>Fermanagh Community Transport</title>
<link rel='stylesheet prefetch' href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.26.0/mapbox-gl.css'>
<link rel="stylesheet" href="style.css">
@BobHarper1
BobHarper1 / index.html
Created October 18, 2018 12:34
Simple Responsive Timeline
<script src="https://use.typekit.net/bkt6ydm.js"></script>
<script>try{Typekit.load({ async: true });}catch(e){}</script>
<div class="container-fluid">
<div class="row example-centered">
<div class="col-md-12 example-title">
<h2>Our History</h2>
<p>We were founded in 1938, and today represent the interests of over 1,100 members and the wider community and voluntary sector.</p>
</div>
<div class="col-xs-12 col-sm-10 col-sm-offset-1">
<ul class="timeline timeline-centered">
@BobHarper1
BobHarper1 / ccni_extra
Last active July 30, 2018 15:04
Extra names (otherwise known as...) for orgs on Northern Ireland Charity Commission Register http://www.charitycommissionni.org.uk/
Charity_number,Other_names
100005,SCNI
100006,LVRT
100008,Advice NI
100009,RCN
100011,Brookeborough Controlled Primary School Parent Teacher Support Association
100012,NICVA
100013,BBNI
100015,NWCN
100016,N/A
[
{
"title":"Grants to voluntary, community and social enterprise organisations 2016-17",
"description":"",
"identifier":"a002400000rHuAWAA0",
"license":"http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/",
"license_name":"Open Government Licence 3.0 (United Kingdom)",
"issued":"2017-10-11",
"modified":"2017-11-03T16:35:35+0000",
"publisher": {
@BobHarper1
BobHarper1 / tm75_wgs84.py
Created October 23, 2017 09:29
Irish Grid TM75 to WGS84
from pyproj import Proj, transform
def irish_to_wgs84(northing, easting):
prj_tm75 = Proj(init='epsg:29902')
prj_wgs84 = Proj(proj='latlong', datum='WGS84')
x, y = transform(prj_tm75, prj_wgs84, northing, easting)
return x, y
print(irish_to_wgs84(248264, 442542))
## -6.9927979, 53.709714
@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