Skip to content

Instantly share code, notes, and snippets.

@bentorkington
bentorkington / flags.swift
Created August 1, 2023 06:18
Declarative flag filters with CoreImage
//
// Because you're not going to put yet another asset in your bundle, are you?
//
// Created by Ben Torkington on 1/08/23.
//
import CoreImage
class FlagFilter {
let displayName: String
@bentorkington
bentorkington / mt2-merge.sh
Created October 11, 2021 00:21
Merging sf2ua MAME roms for use with SF2-MustardTiger
#!/bin/sh
# How to merge the sf2ua romset for use with the SF2 rewrite
# Basically, you need to merge the ROMs together the same was as they're mapped on the real
# hardware.
# First, get the interleave tool from https://www.romhacking.net/forum/index.php?topic=26264.0
interleave int1 1 sf2u.30a sf2u.37a
interleave int2 1 sf2u.31a sf2u.38a
@bentorkington
bentorkington / loi-bot.js
Created August 22, 2021 19:23
Original prototype NZ Covid Locations of Interest bot
const axios = require("axios");
const cheerio = require("cheerio");
const crypto = require('crypto');
const fs = require('fs-extra');
const { TwitterClient } = require('twitter-api-client');
// On launch, load the list of locations that have already been tweeted
// This is a JSON object containting hashes of the names and addresses of locations.
let locations = fs.readJSONSync('./locations.json');
@bentorkington
bentorkington / bnzksrscrape.pl
Created October 4, 2019 23:06
Get historical BNZ Kiwisaver fund data as CSV
#!/usr/bin/perl
use LWP::UserAgent;
use XML::LibXML;
use HTTP::Request;
use DateTime;
use Date::Parse;
use DateTime::Format::Strptime;
my $startDate = DateTime->new(