Resi Dwi Thawasa

TIL — Today I Learned

Quick notes and discoveries from my learning journey

git rebase --autostash

Whenever I had to rebase on top of master with a dirty working directory (uncommitted changes), I always did the same four steps:

#git

Verifying an ECDSA signature in Go

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...

#go #cryptography

closure_tree: filter early

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...

#rails #postgres #performance

Set max idle connections, not just max open

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...

#postgres #performance #go

Quorum is ceil(N/2)

Quorum is the smallest number of nodes that have to agree before a decision counts. The formula is ceil(N/2):

#distributed-system

Delete all evicted pods in one line

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...

#kubernetes #kubectl

Killing an N+1 with preload

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...

#rails #performance #postgres

Why bundle exec actually matters

I spent too much time on a build that worked for me but broke for a teammate. Same repo, but different output.

#ruby #bundler