Skip to content

Instantly share code, notes, and snippets.

View psd's full-sized avatar

Paul Downey psd

View GitHub Profile
@psd
psd / tiddler2tid.pl
Created July 9, 2010 13:39
convert .tiddler into .tid format files
#!/usr/bin/env perl
#
# convert .tiddler into .tid format files
#
use strict;
use File::Slurp;
foreach my $file (@ARGV) {
@psd
psd / arcgis.py
Created August 27, 2025 18:42
Dump listed buildings
import json
from esridump.dumper import EsriDumper
url = 'https://services-eu1.arcgis.com/ZOdPfBS3aqqDYPUQ/arcgis/rest/services/National_Heritage_List_for_England_NHLE_v02_VIEW/FeatureServer/0/'
dumper = EsriDumper(url, fields=None)
response = dumper._request("GET", url)
dumper.get_metadata()
@psd
psd / .gitignore
Last active July 5, 2025 17:03
Digital Land collected data
endpoint.csv
@psd
psd / Makefile
Last active July 5, 2025 15:07
Digital Land GitHub pages
.PRECIOUS: pages.txt
index.md: pages.txt index.sh
bash index.sh < $< > $@
pages.txt: pages.sh
bash pages.sh > $@
@psd
psd / chart.txt
Last active June 10, 2025 08:52
My Waffle scores chart
{40: 858, 41: 873, 42: 888, 43: 903, 44: 919, 45: 936, 46: 953, 47: 971, 48: 989, 49: 1008, 50: 1028, 51: 1049}
1060 +--------------------------------------------------------------------+
| ** |
1040 | ** |
| *** |
1020 | *** |
| *** |
1000 | *** |
| ***** |
@psd
psd / nginx
Created October 13, 2012 13:23
query string matching in nginx
map $query_string $new_url {
~a=1 http://www.gov.uk/1;
~a=2 http://www.gov.uk/2;
~a=3&b=1|b=1&a=3 http://www.gov.uk/31;
~\ba=4\b.*\bb=2\b|\bb=2\b.*\ba=4\b http://www.gov.uk/42;
}
server {
server_name lrc.businesslink.gov.uk;
@psd
psd / README.md
Last active December 15, 2024 09:27
Convert Tiers 2 and 5 sponsors into a TSV
@psd
psd / community.tsv
Last active November 19, 2024 17:14
intervention organisation
software local-authority:BKM
software local-authority:DAC
software local-authority:DNC
software local-authority:GLO
software local-authority:CMD
software local-authority:LBH
software local-authority:SWK
software local-authority:MDW
software local-authority:NET
@psd
psd / Datasette redirection
Created September 17, 2024 13:59
Datasette redirection
$ python3.10 -m venv --prompt . .venv --clear --upgrade-deps && workon
Requirement already satisfied: pip in ./.venv/lib/python3.10/site-packages (22.2.2)
Collecting pip
Using cached pip-24.2-py3-none-any.whl (1.8 MB)
Requirement already satisfied: setuptools in ./.venv/lib/python3.10/site-packages (63.2.0)
Collecting setuptools
Using cached setuptools-75.1.0-py3-none-any.whl (1.2 MB)
Installing collected packages: setuptools, pip
Attempting uninstall: setuptools
@psd
psd / arcgis.py
Created June 11, 2024 06:21
Download GeoJSON from an ArcGIS API
#!/usr/bin/env python
import sys
import json
from esridump.dumper import EsriDumper
url = sys.argv[1]
dumper = EsriDumper(url, fields=None)