Skip to content

Instantly share code, notes, and snippets.

View AKST's full-sized avatar

Angus AKST

View GitHub Profile
@AKST
AKST / bw-dithering.wgsl
Last active December 7, 2025 09:04
some shader toy stuff
const float DITHER_SCALE = 8.0;
const vec3 LUM_VECTOR = vec3(0.299, 0.587, 0.114);
const mat4 BAYER_MATRIX = mat4(
0.0/16.0, 8.0/16.0, 2.0/16.0, 10.0/16.0,
12.0/16.0, 4.0/16.0, 14.0/16.0, 6.0/16.0,
3.0/16.0, 11.0/16.0, 1.0/16.0, 9.0/16.0,
15.0/16.0, 7.0/16.0, 13.0/16.0, 5.0/16.0
);
vec2 square_coord(vec2 frag_coord) {
import { mkdir } from 'node:fs/promises';
import { homedir } from 'node:os';
import fs from 'node:fs';
import { pipeline } from 'node:stream/promises';
import { Readable } from 'node:stream';
import { JSDOM } from 'jsdom';
const RBA_HOST = 'https://www.rba.gov.au';
function * getYears() {
export class Queue {
#buffer = [];
#p = Promise.withResolvers();
#stopped = false;
push(value) {
if (this.#stopped) throw new Error('Queue is stopped');
this.#buffer.push(value);
this.#p.resolve();
}
export async function * mergeAsyncIterators(iterables) {
const iterators = iterables.map(it => it[Symbol.asyncIterator]());
const promises = new Map(iterators.map((it, i) => [i, it.next()]));
while (promises.size > 0) {
const next = Array.from(promises.entries(), async ([i, p]) => [i, await p]);
const [index, result] = await Promise.race(next);
if (result.done) {
promises.delete(index);
@AKST
AKST / romer-solow.js
Last active October 1, 2025 04:06
Continuous Solow Swan combined with continuous Romer endogenous growth model
const l = 0.05, z = 0.0001, d = 0.07, s = 0.15;
const L = 10000, a = 2/3;
const Ly = ((1-l) *L), La = (l * L);
const A0 = 100, K0 = 1000;
const A = (t: number) => A0 * Math.exp(z * La * t);
const K = (t: number) => {
const g = z * La;
const exDt = Math.exp(-a * d * t)
@AKST
AKST / ABS unemployment data.ipynb
Last active April 17, 2025 09:41
An example of using the ABS API to look at unemployment data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AKST
AKST / nswvg_property_sales_parser.py
Last active September 2, 2024 06:18
Parser for NSW Valuer General Bulk Property Sales data, found here https://valuation.property.nsw.gov.au/embed/propertySalesInformation
from dataclasses import dataclass
from datetime import datetime
from typing import Optional
import os
def get_property_sales_data(file_path):
reader = PropertySalesRowReader()
try:
for kind, row in reader.get_rows(file_path):
@AKST
AKST / nswvg_property_description_parser.py
Last active September 2, 2024 04:46
(Work in progress) NSW Valuer General Property Description Parser. This parsers the "property description" field of the bulk data. You're welcome to use this as you please.
from dataclasses import dataclass, field
from collections import namedtuple
from typing import List, Union, Any, Optional
import re
@dataclass
class LandParcel:
id: str
part: bool = field(default=False)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Copyright 2021 Angus Thomsen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions: