BlogFeatured 5 times
alexwlchan
Alex Chan’s personal website
Recent posts
Newest first- funkycache: a Python library to cache functions in SQLite
funkycache is a new Python library that uses SQLite to cache function outputs, automatically invalidating the cache when source files change.
- gobench: a tool for comparing Go benchmark runs across branches
Gobench is a new Go tool designed to streamline the comparison of benchmark runs across different branches, improving upon manual scripting methods.
- Verifying my web archives with Playwright
Playwright is used to automate the verification of local web archives for self-containedness by detecting external requests.
- Positive alerts in Prometheus
Prometheus monitoring alerts are adjusted to include a "positive alert" that signals when a previously flapping service has consistently passed checks for two weeks.
- Organising my cross-stitch patterns
A cross-stitch enthusiast created a static website to organize hundreds of digital PDF patterns using a masonry layout and PDF thumbnails.
- Parametrised tests in Rust with named parameters
Rust developers can create parametrised tests with named fields using a custom macro for improved readability and maintainability.
- Abusing ID3 chapters to turn videos into glanceable podcasts
Abusing ID3 chapters in MP3 files allows videos to be listened to as audio-first, with visual context available on the lock screen.
- Why can’t you combine .tar.gz files with cat ?
Combining .tar.gz files with cat fails because tar archives have EOF markers, while gzip compresses a single stream without them.
- Preventing line breaks in <code> elements
A new CSS class prevents awkward line breaks in short inline code snippets by using the `nowrap` property.
- Fixing a bug with byte order marks
A Python function to convert SRT to WebVTT subtitles encountered a bug when handling UTF-8 byte order marks.
- A Git hook to prevent committing directly to main
A Git pre-commit hook prevents accidental commits directly to the main branch by checking the current branch name and aborting the commit if it is main.
- I don’t want to repeat repeat myself
Two regular expressions were used to search codebases for accidentally repeated words or phrases, aiding in typo correction and cleanup.
- What can wonky APIs tell us about the web?
The HTMLMediaElement.canPlayType API and History API's pushState() method reveal challenges in web API design due to backward compatibility needs.
- Using the Screen Capture API to record a browser window
The Screen Capture API allows recording browser tabs with audio, offering an alternative to QuickTime or Playwright for saving animated web content.
- Using Pytester to test my Playwright fixtures
Pytester is a tool for testing pytest plugins, enabling isolated test suites to verify custom fixture behavior and outcomes.