Ignore files in a git repo locally
I had a scratch file in a repo, some debugging notes I did not want to commit. Sometimes I added it to .gitignore, but I...
Resi Dwi Thawasa
Quick notes and discoveries from my learning journey
I had a scratch file in a repo, some debugging notes I did not want to commit. Sometimes I added it to .gitignore, but I...
Whenever I had to rebase on top of master with a dirty working directory (uncommitted changes), I always did the same four steps:
We had this in ApplicationRecord and I was curious how it actually worked:
I moved this blog from Tailwind v3 to v4. The big change is that the configuration left tailwind.config.js and went into the CSS itself, with...
On a charge endpoint, a retry or a double click can turn one payment into two. The fix is an idempotency key. The caller sends...
We had a server-to-server callback that came signed, and I needed to verify it in Go. The flow is short: parse the public key (usually...
We had a slow query. It filtered on a column where almost every row had the same value, and only a small part was the...
After I upgraded to Go 1.21, I deleted a few small helper functions. I had been copying them around for years.
Our error tracker was full of RecordNotFound exceptions. But these cases were fine. A missing row was expected, not a real problem.
I thought context.WithTimeout would cancel anything when the deadline passed. It does not. It only sends a signal. Your code has to watch the context,...
In a side project I use the closure_tree gem for hierarchical data in Rails. Methods like #leaves and #hash_tree are useful, but after I added...
Under load we kept getting “bad connection” errors that came and went. The connection pool had a good max open setting, so that was not...
Kafka only guarantees order inside a single partition. Not across partitions, and for sure not across topics.
When a circuit breaker opens because a downstream is failing, you stop calling it for a while so it can recover. The question is what...
Quorum is the smallest number of nodes that have to agree before a decision counts. The formula is ceil(N/2):
I committed a lot of work with the wrong author name, and some with a personal email that I did not want to make public....
Evicted pods pile up and make kubectl get pods messy. They are done, but they just stay there. Here is a one-liner to clean them...
In Go’s net/http, the server starts a new goroutine for each incoming request. So your handlers run at the same time by default, even if...
A hot read endpoint was slow, and I could not see why from the code. The query log showed me the problem: one query to...
I needed to load a SQL dump into Postgres that runs under docker compose. The simple pipe:
I spent too much time on a build that worked for me but broke for a teammate. Same repo, but different output.