Skip to content

Instantly share code, notes, and snippets.

Type Name
metropolitan_district Barnsley Borough Council
metropolitan_district Birmingham City Council
metropolitan_district Bolton Borough Council
metropolitan_district Bradford City Council
metropolitan_district Bury Borough Council
metropolitan_district Calderdale Borough Council
metropolitan_district Coventry City Council
metropolitan_district Doncaster Borough Council
metropolitan_district Dudley Borough Council
Year Food, Vets & Ancillary Costs Staffing Total
2015 4,301.83 31,310.00 35,611.83
2016 3,694.56 32,093.00 35,787.56
2017 4,508.96 32,895.00 37,403.96
2018 8,084.32 33,717.00 41,801.32
2019 7,828.90 34,560.00 42,388.90
@Jonty
Jonty / extract_code_from_doxygen.py
Created December 28, 2020 19:11
Extract all code from a set of Doxygen generated documentation, for use when recovering code that has otherwise been lost
# This extracts all the code from a set of Doxygen generated documentation
# where the code is embedded and highlighted. You really only need to use this
# when attempting to recover lost code and you still have the docs.
# Writes all code out into the original directory structure relative to where
# the script is executed.
# Run: `python extract_code_from_doxygen.py URL_TO_DOXYGEN_FILES_PAGE`
# e.g. `python extract_code_from_doxygen.py http://swf2svg.sourceforge.net/azar/doc/files.html`
@Jonty
Jonty / eb_dump_env_vars.py
Created December 17, 2020 00:18
Dump environment variables for all Elastic Beanstalk apps in an AWS account, redacting passwords/secrets/keys/tokens
import boto3
client = boto3.client("elasticbeanstalk")
apps = client.describe_applications()
for app in apps["Applications"]:
envs = client.describe_environments(ApplicationName=app["ApplicationName"])
for env in envs["Environments"]:
env_name = env["EnvironmentName"]
@Jonty
Jonty / open_house_london_api.md
Last active March 4, 2024 01:40
Open House London API (Or any open-city.org.uk city)
@Jonty
Jonty / pipecleaner.py
Created August 12, 2020 20:09
Pipecleaner is a tool for validating concourse pipelines
#!/usr/bin/env python3
"""Pipecleaner is a tool for validating concourse pipelines.
Someone rewrote this in go because "it's not python 3 compatible",
so now they have a version 5x longer and less comprehensible. This
is a "port" to python3, via the 2to3 tool. It took 600ms to do.
It can check for the following issues:
* Resources being used in a job that have not been defined in the
@Jonty
Jonty / split_svg_paths.py
Last active September 16, 2020 14:15
An extremely hacky bit of code to split an SVG of joined line paths into individual lines, and merge straight lines made of smaller lines into single lines
# An extremely hacky bit of code that takes SVG files output by Blender
# and splits all the multi-node line paths into single line paths to make
# editing easier. Example: A right-angle path is now two lines that meet.
#
# Blender has a habit of outputting really _weird_ paths that are annoying
# to edit on geometric shapes, and also outputs straight lines that are
# made up of many smaller straight line nodes. This code also merges those
# mini-line lines into single lines to stop you throwing your computer out
# of the window when you try and work with the SVG.
#
@Jonty
Jonty / eb_analyse.py
Created March 18, 2020 18:20
Grab autoscaling settings for all elastic beanstalk applications and environments
import boto3
eb = boto3.client("elasticbeanstalk")
asg = boto3.client("autoscaling")
response = eb.describe_environments()
instances = 0
for env in response["Environments"]:
resources = eb.describe_environment_resources(
@Jonty
Jonty / uk_gov_websites_archive.md
Last active July 28, 2020 20:02
The earliest Archive.org snapshot of every UK Government domain

Recently @alexparsons asked Democracy Club what the earliest local authority website was. Nobody knew, but we had fun looking at pages from 1996.

I pulled up my old IPv4 reverse DNS scan of .gov.uk domains, and the official list of .gov.uk domains, then queried the internet archive for each one.

The list below is every UK Government website sorted by the first time the Internet Archive saved a copy.

The links go to the archived version of the site at that time. Expect to get nostalgic. - @jonty

Archive date Domain
{
"data": {
"attributes": {
"action": "Allow the Red Arrows to Fly at the 2012 Olympics.",
"background": "The Department of Culture, Media and Sport have deemed the RAF Red Arrows as Unsuitable for the 2012 Olympics because they are too British.\n\nThis is a ridiculous decision and should be overturned in the name of common sense.",
"closed_at": "2008-09-17T00:00:00Z",
"creator_name": "Mark Standley",
"government_response_at": "2008-09-18T00:00:00Z",
"government_responses": [
{