Skip to content

Instantly share code, notes, and snippets.

Avatar
🤓

Leigh Dodds ldodds

🤓
View GitHub Profile
@ldodds
ldodds / stats.rb
Created Dec 29, 2021
Quick script to count number of bookmarks recorded in pinboard
View stats.rb
require 'dotenv/load'
require 'pinboard'
require 'csv'
pinboard = Pinboard::Client.new(:token => ENV["PINBOARD_TOKEN"])
CSV.open("stats.csv", "w") do |csv|
csv << ["YEAR", "POSTS", "VIA_POCKET"]
#I started social bookmarking in 2004 using del.icio.us, then pinboard from May 2013
#started logging read articles in Pocket to pinboard via IFTTT in mid-2018
@ldodds
ldodds / meteostat-notes.md
Last active Jan 27, 2021
Meteostat Interpolation Notes
View meteostat-notes.md

Code for the hourly endpoints in Meteostat API can be found here:

Overall Flow

After initially accepting the request, connecting to the database, parsing parameters, etc. The bulk of work is done in the Fetch method.

This does the following, focusing only on temperatures:

  • parse the start/end dates, ading supplied timezone
View town.txt
KiiERgHCZozOM1lbH22_zttPhbr9tcbfU3W7r72_Mvt237t9hfbt-802_gtf52Ph73z9j6_1d-Mvfv3P8b7P9st23pt9Bb-ztfC3vl7H19r7_Ze-evf43W7Prsfe2Wr9dabtPYb7L32afC323zt1_outvubr9Zebfv3W7D-2_TG7Xl9ww_da-gtfm3v37H_932sfs3-gz_Fa-lB76jy_da-gtfm3v37H_l9PY2-Rz_tZ-H966bx_5Z-Otfx2Pw7379D-_PUW2vFXXf61vK7nn970_Bb-ztfC303z9j6_1d-Mvfv3P87fiWXfy1vK7nn970_Bb-ztfC3vl7H19r7_Ze-evvP8779nf1P06Xlt85Z-Otfx2vc7nx9b5_Rdffd33n5999ef-pV97r_yYLfV2vTL6D2_lb-EufL3Pq77PbqfW1PGL5rz_5Z-Otfx2vc7nx9b5__xvv-R___Ni6Hjd8VZ-8sfn2zHs9L3_Jcffv33H_99_Nt779_nd6Ha99_YsfV2PP73p9D2_lb-Euvv377D-__P47vITfff13HaF8_YsfV2PP73p9D2_lb-Euvvl77j6__MvvP87730uvP07X89fsqv33X9Dt_efM2x4rz_5Z-Otfx2vc7nx9b5_Rd-6uvP877fxsfp3-A8_Jf-LQ65rp__sqff13Hj9rz_5Z-Otfx2vc7nx9b5_Rd-Evfr3P877fuufz3-g8_La3P27-cR-aqfW1vBbI8yY-qshxnn970KGkPY7Xu9T4W_Wulvub5w8_hf-Fob5T__Hg3zfQdLfr3fJ7_Re-HH6HR99ZVffn2PY7Xut8Jc-6ulzH_9PQufy3fy5_le-Dq7n49X0ul-pg_tTffW13770_BbLlvcb5L4WKfx3P87fgcLlP07fAdLfg3-46WK-G-8Tm_ZVffe2PY7Xu9T4_tc-oufd3Pw7379D-_jAYj5Pmnf8wPr679da-gtmvcL5T4S_WukPqL5r7S_Mvkv3L5D-S_v-L5XUnfwwvT7Hsl8lb-EufL3
@ldodds
ldodds / osm-missing-benches-openbenches.geojson
Last active Dec 27, 2019
Benches in OpenBenches that are potentially missing in OpenStreetmap. Data published under CC-BY-SA. Generated on 27/12/2019.
View osm-missing-benches-openbenches.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ldodds
ldodds / openbenches-by-lad.csv
Last active Dec 27, 2019
Benches in OpenBenches and OpenStreetmap. Published under CC-BY-SA licence. Contains from, Office for National Statistics and Ordnance Survey. Created 27/12/2019
View openbenches-by-lad.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 4 columns, instead of 7. in line 6.
LAD19CD,LAD19NM,LAD19NMW,NUMPOINTS
E06000001,Hartlepool,,0
E06000002,Middlesbrough,,1
E06000003,Redcar and Cleveland,,0
E06000004,Stockton-on-Tees,,0
E06000005,Darlington,,0
E06000006,Halton,,2LAD19CD,LAD19NM,LAD19NMW,NUMPOINTS
E06000001,Hartlepool,,11
E06000002,Middlesbrough,,14
E06000003,Redcar and Cleveland,,33
@ldodds
ldodds / dgu-dataset-site-names.csv
Created Dec 8, 2018
Bristol Allotment Site Name Comparison
View dgu-dataset-site-names.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Sites from DGU Dataset
Arlington Road Allotments
Ashley Vale Allotments
Atwood Drive Allotments
Barracks Lane Allotments
Bath Road Allotments
Beaufort Road Allotments
Bedminster Down C Allotments
Bell Hill Allotments
Bifield Road Allotments
@ldodds
ldodds / kumu.css
Created Jul 24, 2018
Kumu configuration
View kumu.css
@settings {
template: systems;
connection-color: #0DBC37;
opposite-style: none;
font-color: #000;
font-size: 33;
element-text-align: bottom;
}
/* Knowledge & Insights */
View test.json
{
"type": "Event",
"identifier": 40,
"name": "Bootcamp",
"url": "http://www.lewishamparklife.co.uk.com/app/#/games/game/40",
"location": {
"type": "Place",
"address": {
"type": "PostalAddress",
"streetAddress": "London SE4 1LE, UK,undefined",
View A-Publish-opportunities-to-book-a-facility-at-a-leisure-centre.json
{
"@context": "https://www.openactive.io/ns/oa.jsonld",
"type": "FacilityUse",
"url": "http://www.example.org/facility-use/1",
"name": "Example Leisure Centre Table Tennis",
"description": "Table tennis tables are available to hire for thirty minute slots",
"activity": "Table Tennis",
"location": {
"type": "Place",
"name": "Example Leisure Centre",