Programming Stuff
This is just some random stuff that I didn't want to put anywhere else. Because, well, I can't remember now, but I'm sure it doesn't matter.
These should all open in a new tab / window.
-
Dommie
A simple library for DOM manipulation in WebAssembly written in Go, compiled with TinyGo. Source Code Demo
-
Floaty Car
A JavaScript game using the Floaty.dev library. Source Code Demo
-
Hello Floaty
A simple introduction to using the Floaty.dev library to write JavaScript games. Source Code Demo
-
Panorama
The Mozilla panorama effect built in Go, compiled to wasm with TinyGo. Source Code Demo
-
TinyCanvas
A simple library for 2D graphics in WebAssembly written in Go, compiled with TinyGo. This library also allows you to either work with a buffer or directly on the HTML Canvas itself. Source Code Demo
-
TinyClock
The famous Mozilla clock animation demo, but done in Go instead. Source Code Demo
-
TinyRain
A rain-like visual effect build in Go for Web Assembly, making use of TinyCanvas and Dommie. Source Code Demo
-
TinySolar
A solar system simulation in Go for Web Assembly, making use of TinyCanvas and Dommie. Source Code Demo
- Starbase Alpha One Just a little WebAssembly game concept I'm working on.
- Kotlin Solar SystemTesting Kotlin/Wasm and HTML Canvas interaction
Assorted Others
Assorted Code Snippets
A collection of assorted snippets I often use and can't be bothered to remember. I blame the fact that I work in so many languages - it's a handy excuse.
JavaScript
Capitalise word
const capitalise = (str) => `${str.charAt(0).toUpperCase()}${str.slice(1)}`;
As Percentage Of
const asPercentageOf = (left, right) => Math.round((left / right) * 100)
Get Random Entry from Array
const getRandomEntry = (sourceArray) => sourceArray[Math.floor(Math.random() * sourceArray.length)];
Deduplicate an array
const deDuplicate = (sourceArray) => [...new Set(sourceArray)];
Check Equality
const isEqual = (left, right) => JSON.stringify(left) === JSON.stringify(right);
This stuff is here for historical reasons, don't bother.
And this is an Easter Egg!