Pinned Tweet
Madeactual builds the operational software most shops leave unfinished.
Integrations, internal tools, cutovers, and the spreadsheet that quietly became the system of record. I quote a named slice, name the owner and the exception path, and I will not rewrite your ten-year codebase in week one.
Start with a free project review: madeactual.com/#quote
A small Bash habit for scripts that make temp files: create them with mktemp and clean up with a trap, so they're gone even when the script fails halfway.
tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT
The EXIT trap runs whether the script finishes, dies on an error under set -e, or gets stopped with Ctrl-C, so half-written exports stop piling up in /tmp.
What else goes in your script header by default?
1
1
12
A small Git habit for when an urgent fix comes in while you're halfway through a feature: don't stash, open a second working tree.
git worktree add -b hotfix/invoice-total ../app-hotfix main
That gives you a separate folder on its own branch, sharing the same repo, so your half-done work stays exactly where you left it. Fix, commit, and push from there, then clean up with git worktree remove ../app-hotfix.
If you want a small shop that works this way on your app, tell us about it: madeactual.com/#quote
2
2
50
Something we've been doing on every webhook endpoint lately: verify the signature, save the raw request body and headers to a table, return 200, and do the real processing from that table.
When the handler has a bug or the vendor quietly changes a field, you fix the code and replay the stored rows instead of asking the vendor to resend. Keep the raw bytes, not parsed JSON, so you can re-check signatures and see exactly what arrived.
11
A small Linux habit for cron jobs that sometimes run long: wrap them in flock so a slow run and the next one never overlap.
*/5 * * * * flock -n /tmp/sync-orders.lock /opt/app/bin/sync-orders
The -n means that if the last run still holds the lock, the new one just exits instead of piling up behind it. The lock lets go when the process ends, even if it crashes, so there's nothing stale to clean up by hand.
What do you use to keep jobs from stepping on each other?
20
When a bug shows up and nobody knows which commit caused it, let Git hunt for it:
git bisect start
git bisect bad HEAD
git bisect good v1.4.0
git bisect run npm test -- tests/invoice-totals.test.js
Git checks out the midpoint, runs the test, and keeps halving until it names the first bad commit. Exit 0 means good, 1 to 124 means bad, 125 means skip this one. Finish with git bisect reset.
Want a hand with a stubborn one? madeactual.com/#quote
2
3
36
Want to know who was blocking whom after a query hangs? Turn on log_lock_waits in Postgres.
ALTER SYSTEM SET log_lock_waits = on;
SELECT pg_reload_conf();
Any query that waits on a lock longer than deadlock_timeout (1s by default) gets a log line naming the lock and the process holding it. So when a deploy or a report "just hung for a bit," you can read what happened after the fact. It's off by default before Postgres 18. On RDS, set it in the parameter group.
1
2
18
Postgres setting we turn on for almost every app database now: idle_in_transaction_session_timeout.
ALTER DATABASE app SET idle_in_transaction_session_timeout = '60s';
A session that opens a transaction and then stalls (a crashed worker, a debugger paused mid-request, a psql left open over lunch) keeps holding its locks and blocks vacuum cleanup. This kills it after 60s instead of hours. New connections pick it up.
If your Postgres has gotten slow and nobody knows why, this is the kind of cleanup we do: madeactual.com/#quote
3
2
53
A small SQLite habit for internal tools that more than one process touches: turn on WAL and set a busy timeout when you open the connection.
PRAGMA journal_mode = WAL;
PRAGMA busy_timeout = 5000;
WAL lets readers keep reading while one writer writes, and busy_timeout makes a second writer wait up to 5s instead of failing straight away with "database is locked". journal_mode sticks to the file; busy_timeout is per connection, so set it every time.
1
1
24
A small Redis habit that makes a shared instance much easier to live with: put the app, the purpose, and a version in every key, and give every cache key a TTL.
myapp:cache:v2:customer:4812 (EX 3600)
myapp:session:9f3c2a (EX 86400)
When the cached format changes, bump v2 to v3 and the old keys age out on their own, no cleanup script. And when memory climbs, redis-cli --scan --pattern 'myapp:cache:*' shows you which piece is growing.
2
2
96
A small Redis habit for clearing out big keys: use UNLINK instead of DEL.
UNLINK cache:report:2026-11
DEL frees the memory right there on the main thread, so deleting a hash or set with millions of members can stall every other command for a moment. UNLINK removes the key from the keyspace right away and frees the memory in a background thread. Same result for your code, no hiccup for everyone else.
On Redis 6+, lazyfree-lazy-user-del yes makes plain DEL behave this way too, which helps with libraries you don't control.
24
A small Postgres check we run after copying data from an old system into a new table: diff the rows with EXCEPT, in both directions.
SELECT id, email, status FROM old_customers
EXCEPT
SELECT id, email, status FROM customers;
Then swap the two sides and run it again. Empty both ways means every row made it across with the same values. Matching row counts alone can hide a changed email or a dropped status.
If you have a migration or cutover coming up and want a second pair of hands, that's work we do: madeactual.com/#quote
1
2
38
A small Redis pattern for a job that should only run on one box at a time: a lock with SET NX and an expiry.
SET lock:nightly-sync <random-token> NX PX 60000
NX means it only succeeds if nobody else holds the lock. PX means a crashed worker can't hold it forever. When the job finishes, delete the key only if the value is still your token (a tiny Lua script does the check and delete in one step), so a slow worker never releases someone else's lock.
21
One Postgres pattern we keep reaching for: LEFT JOIN LATERAL for "latest 3 per customer" queries.
The subquery after LATERAL can see the outer row, so it reads like a loop: match the customer, ORDER BY created_at DESC, LIMIT 3. With an index on orders (customer_id, created_at DESC), each customer is a short index read instead of a window function ranking every order. LEFT keeps customers with zero orders.
Want a hand with slow reports or dashboards? madeactual.com/#quote
2
58
A small habit for batch syncs that push records to someone else's API: use Promise.allSettled, not Promise.all.
const results = await Promise.allSettled(rows.map(pushToVendor));
const failed = rows.filter((_, i) => results[i].status === 'rejected');
Promise.all rejects on the first error, so one bad record hides how the other 199 went. allSettled waits for every call and tells you exactly which ones failed, so you can retry or queue just those. For big batches, cap concurrency too so you don't trip the vendor's rate limit.
1
20
Logrotate tip for app logs on a VPS: dry-run the config before you trust it.
/var/log/myapp/*.log {
daily
rotate 14
compress
delaycompress
missingok
notifempty
copytruncate
}
logrotate -d /etc/logrotate.d/myapp shows what it would rotate without touching a file. Use copytruncate only when the app can't reopen its log on a signal, since a few lines can slip past during the copy.
If a box keeps filling its disk, we can help: madeactual.com/#quote
24
Quick Postgres check we run before adding yet another index: find the ones nothing uses.
SELECT relname, indexrelname, pg_size_pretty(pg_relation_size(indexrelid))
FROM pg_stat_user_indexes
WHERE idx_scan = 0
ORDER BY pg_relation_size(indexrelid) DESC;
Every index slows every write. Before dropping one, check replicas too (stats are per server), leave unique and primary key indexes alone, and make sure stats weren't reset last week.
2
1
43
One Postgres index trick we've been leaning on: INCLUDE columns (PG11+).
CREATE INDEX CONCURRENTLY invoices_account_issued_idx
ON invoices (account_id, issued_at DESC)
INCLUDE (status, total);
Key columns filter and sort. INCLUDE columns just ride along, so a list page that needs only those fields gets an Index Only Scan and skips the table. In EXPLAIN (ANALYZE), Heap Fetches should sit near 0. If not, VACUUM.
Got slow list pages? We can help: madeactual.com/#quote
3
3
50
A small systemd habit for nightly jobs on a box that sometimes gets rebooted or patched overnight: set Persistent=true on the timer.
[Timer]
OnCalendar=*-*-* 02:30
Persistent=true
RandomizedDelaySec=10min
Cron just skips the run if the machine was down at 2:30. With Persistent=true, systemd remembers the last run and fires the missed one right after boot, so the backup still happens.
systemctl list-timers shows the last and next run for each one.
17
A small habit for any integration that calls someone else's API: give every outbound fetch a timeout. Node's fetch will wait a long time on a vendor that hangs, and those stuck requests pile up until your own app looks down.
const res = await fetch(url, { signal: AbortSignal.timeout(5000) });
It throws a TimeoutError you can catch, log, and retry or queue. Pick the number from the vendor's real p99, not a guess.
If your integrations need this kind of hardening, we build and fix them: madeactual.com/#quote
3
2
49
Small Postgres gotcha: it indexes your primary keys automatically, but not the foreign key columns that point at them.
So DELETE FROM customers WHERE id = 42 has to scan all of orders looking for children, and joins on orders.customer_id slow down as the table grows.
The fix is one line:
CREATE INDEX CONCURRENTLY orders_customer_id_idx ON orders (customer_id);
Worth a pass over every FK in your schema. Which table bit you first?
1
1
31
