Skip to content

Instantly share code, notes, and snippets.

View ThomasBoxall's full-sized avatar
🧄

Thomas Boxall ThomasBoxall

🧄
View GitHub Profile
@ThomasBoxall
ThomasBoxall / heritagedbsplunking.sql
Last active June 1, 2025 15:39
WCF Heritage DB Splunking: retrieving useful information before decommissioning the site (my notes & sql used for this process)
-- WCF Heritage DB Splunking: retrieving useful information before decommissioning the site.
-- Prepare: import the PSQL export into a psql db (called heritage in my case).
/**
we start by examining the relationship between tables in lieu of a proper ERD
**/
-- select image filename and archivepage item id based on itemid from archiveitem's id (fk in archive_item_id)
select i.image, p.id from wfarchive_archiveimage i
@ThomasBoxall
ThomasBoxall / pdf-index.md
Created June 14, 2024 11:38
Jekyll code for indexing PDFs in a repository which is built into GitHub pages (view raw for the full code)

{% assign staticlist = site.static_files | sort: 'url' %} {% for pdf in staticlist %} {% if pdf.extname == ".pdf" %} {{ pdf.path }} {% endif %} {% endfor %}

@ThomasBoxall
ThomasBoxall / tims_diner_gcse_comp_sci.md
Created February 5, 2024 21:58
GCSE Computer Science project | A simple CLI POS

Tim's Diner

GCSE Computer Science Project

MENU

This is a supporting file which needs to be in the same directory as the main python file

1,All_Day_B'fast(large),5.50,YES,2
2,All_Day_B'fast(small),3.50,YES,3
3,Hot_dog,3.00,YES,1
4,Burger,4.50,NO,3
@ThomasBoxall
ThomasBoxall / openldbsvws_graphical_visualiser.py
Created February 5, 2024 21:50
A visual representation of departures from stations in the next 24 hours [requires you to insert *your* OpenLDBSVWS token
# openldbws and graphics.py project
# use openldbws to get the info about the next x number of trains departing
# from a station which user enters
# then use graphics.py to build visual representation based on tocs of those
# trains.
from zeep import Client
from zeep import xsd
from zeep.plugins import HistoryPlugin
from graphics import *
We can't make this file beautiful and searchable because it's too large.
aa,aah,aal,aalii,aardvark,aardvarks,aardwolf,aardwolves,aargh,aarrghh,aasvogel,aasvogels,ab,aba,abaca,abacas,abaci,aback,abacus,abacuses,abaft,abalone,abalones,abampere,abamperes,abandon,abandoned,abandonee,abandoning,abandons,abase,abased,abasement,abases,abash,abashed,abashes,abashing,abashment,abashments,abasing,abatable,abate,abated,abatement,abatements,abates,abating,abatis,abator,abators,abattis,abattises,abattoir,abattoirs,abaxial,abba,abbacies,abbacy,abbas,abbatial,abbe,abbes,abbess,abbesses,abbey,abbeys,abbot,abbotcy,abbots,abbreviate,abdicate,abdicated,abdicates,abdicating,abdication,abdicator,abdicators,abdomen,abdomens,abdominal,abdominals,abduce,abduced,abduces,abducing,abduct,abducted,abductee,abductees,abducting,abduction,abductions,abductor,abductors,abducts,abeam,abear,abearing,abears,abed,abeigh,abele,abeles,abelia,aberdevine,aberrance,aberrancy,aberrant,aberrate,aberrated,aberrates,aberrating,aberration,abessive,abet,abetment,abetments,abets,abettal,abettals,abetted,abetter,abetters,abettin
@ThomasBoxall
ThomasBoxall / unique-code-generator.py
Created April 24, 2023 13:17
Generates x letter codes until the user tells program to stop
# unique-code-generator
# generates x letter codes until user tells program to stop.
import random
numbLettersInCode = 4
codes = []
def genLetter() -> str:
@ThomasBoxall
ThomasBoxall / yt-watch-history.py
Created February 27, 2023 20:39
Parses a .json file produced by Google Takeout containing YouTube watch history and writes out total number of videos viewed per channel to another JSON file
# program to parse youtube watch history (in JSON format, produce by Google takeout) and return stats about the year's viewing.
import json
from collections import Counter as counter
def getVidCountForYear(data, year):
results = []
for x in range(0,len(data)):
if int(data[x]['time'][0:4]) == year:
try:
@ThomasBoxall
ThomasBoxall / csv-to-sql-insert.py
Created January 21, 2023 15:30
Python script to convert a .csv file into SQL insert statements
# script to open and read a .csv file and convert it into SQL insert statements
# csv file first row is used as column names and the other rows have insert statements generated from them.
# empty 'cells' return null.
# for cells which don't need to be in speech marks, add their index in the row (0 based) to the intList list. DO NOT REMOVE THE LIST IF NOT IN USE, LEAVE IT EMPTY.
# usage
# put the path to the csv file in the quote marks which say 'FULL FILE PATH' within the open() statement
# put the name of the table into tableName variable
# put any non string columns' index into intList
# run program and copy output into sql prompt