Posts
All posts by year of publication. You can filter by Software, Finance, and Random.
2024
How to (Structurally) Serialize a JavaScript Object
In this post I want to catalog the myriad ways of serializing JavaScript objects, with a focus on mimicking the behavior of the Structured Clone Algorithm. Continue reading How to (Structurally) Serialize a JavaScript Object
2022
How To Use HTMLRewriter for Web Scraping
In this post we’ll be implementing a custom Hacker News API by scraping its HTML frontend, the same approach used by the unofficial HN API for Node. Continue reading How To Use HTMLRewriter for Web Scraping
2020
The Monospaced System UI CSS Font Stack
This post introduces a CSS Font Stack that picks the best monospaced font for each of the most common operating systems. Continue reading The Monospaced System UI CSS Font Stack
The Joys and Perils of Writing Plain Old Web Apps
In the age of “cybernetically enhanced” JavaScript frameworks, it’s easy to forget that you can still write web sites like it’s 1998. Continue reading The Joys and Perils of Writing Plain Old Web Apps
Async Constructor Pattern in JavaScript
In this post I’ll show three design patterns that deal with async initialization and demonstrate them on a real-world example. Continue reading Async Constructor Pattern in JavaScript
2019
Replacing CryptoJS with Web Cryptography
Alternative title: You Might Not Need CryptoJS. In this post I’ll show how to replace CryptoJS’ AES module with the Web Cryptography API for improved performance and security. Continue reading Replacing CryptoJS with Web Cryptography
Solving Advent of Code Puzzles with ES Generators
JavaScript is not a great langauge for solving programming puzzeles such as Advent of Code, but ECMAScript’s new generator functions may change that. Continue reading Solving Advent of Code Puzzles with ES Generators
Async Generators in the Wild
This post is inspired by my answer to a question on StackOverflow on how to recursively read all the files in a directory. It shows how async generator functions can be used in the real-world. Continue reading Async Generators in the Wild
2018
URLs are Directories
Just a friendly reminder that URL paths are directories. Continue reading URLs are Directories
How to Include Certain Files Only in Tagged Commits
Certain situations and tools require that we check-in build artifacts into a git repository, maybe even on the master branch. This is bad practice for a variety of reasons, but sometimes we can’t avoid it. Continue reading How to Include Certain Files Only in Tagged Commits
Continuously Compounding Interest
How to calculate the continuously compounded interest rate, which is equivalent to a given (nominal) annual interest rate? Continue reading Continuously Compounding Interest
2016
Good, Bad and Ugly WebComponents
Container and collection components. How do they receive items? Do they receive items? Let’s find out! Continue reading Good, Bad and Ugly WebComponents
Taming the Font of the Gods
Legend has it that the Font of the Gods could be used for coding, but so far no one has been able to wield its power due to the ferocity of its letter spacing. Continue reading Taming the Font of the Gods
What I’ve Learned From Trying to Register 😂😂😂.io
tl;dr: Nothing too interesting. What follows is a collection of emoji related links, starting with an episode of the a16z podcast. Continue reading What I’ve Learned From Trying to Register 😂😂😂.io
Learn ClojureScript in Y Minutes
ClojureScript is a dialect of the Clojure language developed for JavaScript environments. It has most of the functionality of Clojure with small adaptations owing to the differences in the underlying platform. Continue reading Learn ClojureScript in Y Minutes
How to Set Specific Probabilities Using the LMSR?
How many shares do you need to buy/sell in the in a prediction market using the Logarithmic Market Scoring Rule (LMSR) to change the price/probability of an asset to a specific value? Continue reading How to Set Specific Probabilities Using the LMSR?
A Simple CDA Implementation in Clojure
This post describes a minimal Continuous Double Auction algorithm and provides an implementation in Clojure. Continue reading A Simple CDA Implementation in Clojure
Side Effects, Get Out of My Yard
This post describes how to write re-frame middleware to replace side-effectful function calls with data. Continue reading Side Effects, Get Out of My Yard
2015
My Favorite Unit Test
I use this one to find out if the test environment is set up correctly. Continue reading My Favorite Unit Test
2014
Responsive Web Apps with vw and vh
When it coms to response web design media queries with fixed breakpoints are quite nice to adjust sites to different screen sizes. But what about font sizes? Continue reading Responsive Web Apps with vw and vh