RSSAmplifier

Blog

Steve Adams

Software Developer

steve-adams.meRSS feed ↗11 posts

Latest posts

Your Claude Code Deny List Is Leaky

After a short stint of letting Claude handle adding, committing, and pushing changes to a project, I realized I didn't like it. It was too eager to make changes that were too aggressive and too broadly scoped, and everything felt noisy. Even with my regular intervention, change sets were getting too frequent and the quality was dropping. I added git commit and git push to the deny list and figured…

Metaprogramming TypeScript with the Reflect API

Do you ever wonder what exactly Reflect is for, and why you'd use it? You're not alone. In fact, there's a good chance a lot of people you work with have never heard of it. Reflect's documentation covers a lot of lower-level, seemingly abstract ideas, which leads to it being unclear as to why you'd use it. This isn't because you're not catching on or understanding; it's because its functionality…

Building Minesweeper with @xstate/store

State management is hard. If I had to guess, maybe most bugs I work on are some form of errant, brain-derived state management issues. This is an account of trying to find ways to make it less hard, hopefully use my brain less so it can't get in the way, and have some fun in the process. Why @xstate/store? ​ At first glance I thought "Why wouldn't I use x, y, or z state management library", but…

'use server' and Next.js

Note: There's a Github issue specific to this concern here . While debugging some issues in a client's Next.js project, I had to look closer at how use server works under the hood ( here's a decent overview ). I knew there must be http endpoints created for the functions—perhaps with some indirection—but I wasn't sure how it worked exactly. Well, it turns out to be simple... And very direct. This…

Creating SolidJS bindings for xstate/store

I've been using SolidJS a lot more lately, and XState has been a goto in my toolbox for years now. Recently, xstate/store was added and it's awesome. I decided I'd like to stick the two together and noticed there were only react bindings. I wondered if there was a good reason or if it was just waiting for someone like me to help out: Well alright, let's do it! The plan of attack ​ The XState…

Coho

One of the more fascinating aspects of British Columbia's ecology is salmon. Their impact on life here ranges from the coasts of our islands and mainland to deep within inland forests, from sea to sky. Trees along salmon streams have wider growth rings, indicating faster growth—likely due to the nitrogen and phosphates the salmon bring upstream—and the forests they're in are often denser. These…

Time Isn't Real: Schedules in Go with Channels and Signals

Last week I had a problem I hadn't encountered before. I was writing a service based around daily scheduling, and while cron would have been a really useful tool, I couldn't deploy my program to a server that supported it. Under the circumstances it simply wasn't an option. I did however have Go, so I gradually started piecing together a solution. The requirements seemed simple enough: after the…

Dissecting ES6 Generators 1: Iterables & Iterators

I've been writing JavaScript for well over 10 years, and while generators haven't been around the entire time (they appeared around 8 years ago), I never really got them until recently. Having come to understand them better, I think I missed out all that time. In fact, I'd say most people are missing out if they don't have a good grasp on generators, and that includes a lot of people I've worked…

TypeScript Benchmarking with mitata

Way back, I wrote about benchmarking some sloppy interview code using jsperf.com (now jsperf.app ). The gist of it is that I wrote a naive array searching algorithm for finding the two largest numbers in an array, and upon discovering just how bad my solution was, I decided to benchmark it to properly stomp on my self esteem a little bit. The contrast between the first solution and the second was…

Practical Examples of Authentication in Meteor 1.0

My first dive into Meteor.js has been great. I'm starting to hit that point though (as you do with a full stack framework) where the default behaviours don't suit requirements. In this case my client doesn't like the default behaviours and appearance of the accounts-ui package. accounts-base and accounts-ui are awesome packages that happen to make a heap of assumptions about how you're going to…

Summing the Largest Numbers in a JavaScript Array

Earlier today I ran into a problem posed as an interview question. At a glance it seems simple, but it's an open ended question. Like any good assessment, it leaves room for programmers to express different solutions and degrees of aptitude. The problem went a bit like this: Write a function that efficiently takes an array of integers and returns the sum of the two largest integers in the array.…