Skip to content

Instantly share code, notes, and snippets.

View c-harding's full-sized avatar

Charlie Harding c-harding

View GitHub Profile
/**
* Try to survive by not falling off
**/
enum Side {
UP = "UP",
RIGHT = "RIGHT",
DOWN = "DOWN",
LEFT = "LEFT",
}
@c-harding
c-harding / __Virtual server for hosting multiple sites.md
Last active February 2, 2026 00:24
Virtual server for hosting multiple sites

Virtual server for hosting multiple sites

This configuration can be used for hosting multiple sites on a single server, using docker and docker compose for each site. Each site needs a unique port, and will be served on a unique domain. For SSL, use Cloudflare as a proxy.

Use EC2 to create a new instance, or a similar setup with your own host.. The image should be Debian. Make sure to maintain a constant IP address.

@c-harding
c-harding / _STV.md
Last active April 26, 2022 12:33
STV

STV

This started out as a Google Sheets function for Single Transferable Vote, but now offers an index.html for usage locally. Open the relevant Google Sheet, copy the input values into the text field. There is also a save button to keep a track of past votes locally.

@c-harding
c-harding / YTD Strava Stats
Last active September 6, 2025 10:49
Strava stats this year
Hiking 1138.0 km 1w 3d █████████████████▍
Running 1041.8 km 4d 9h ███████▌
Cycling 76.7 km 5h 9m ▎
@c-harding
c-harding / _Axiomatic.md
Last active May 13, 2018 11:12
Axiomatic Tree Proof Formatting

Axiomatic tree proofs

This gist shows an example of how you can use HTML and CSS to lay out trees used for axiomatic proofs of correctness for your code. The example used here is the While language, as defined in the Nielson and Nielson book Semantics with Applications.

@c-harding
c-harding / Max_Flow_Skeleton.md
Last active December 4, 2017 08:40
Max Flow Skeleton, Tidied

Overview

A large number of car drivers regularly want to travel from the Hawthorns bus stop (the corner of St Michael’s Park and Woodland Road – call it 's') to the "Scotsman and his Pack" pub (the corner of St Michael’s Hill and Horfield Road - call it 't') - as shown in the map on the view.html page. Complete the following 3 tasks by implementing a number of algorithms in JavaScript function found in the controller.html file. This should be fairly straightforward, even if you have little experience of JavaScript (see the help sections at the end of this document for some tips).