BetterDev.Link collects links around the web that aims to help you learn something new. The topics aren't tight to any specific programming languages, technologies or frameworks but attempt to include resources that might help you learn a thing or two from them.
BetterDev Link
Every Monday
Hi everyone,
We’re 2 days late from our normal schedule but I tried my best to not skip any issue.
SerpApi has been BetterDev’s main sponsor for the last few weeks, they have an amazing product where you literally can turn Google search into a structured API response.
In 2013, I was working on an app that indexed and scored realtor agents, I had to scrape the Google search API with all kinds of tricks to bypass IP rate limits, and parse the result. All of that is solved with SerpApi now. Give SerpApi a try, you will be amazed.
If you enjoy BetterDev, please spread the word by sharing it with your friends. And if you’d like to support my work, buying me a coffee would be much appreciated.
Web Search Data, Ready as JSON and Markdown. SerpApi gives developers real-time, structured results from Google Search, Maps, Shopping, and 100+ search engine APIs through a simple API call.
Ever wonder what really happens inside the model when it picks the next word? This one runs a real GPT-2 in your browser. Type your own sentence and follow it: embedding, the query-key-value split, attention between words, then the probability of the next token. Drag the temperature slider, you will feel what sampling does.
We all know 0.1 + 0.2 is not 0.3. But if you add money in cents all day, how wrong can it get? The OP proves the sum is off by at most one ulp, then plots it and gets a checkerboard, because the error of both inputs and of the add itself interfere. 2Sum in the appendix gives you the exact error.
Everyone is talking about Jev this week. The OP is not impressed, so they did it in 25 lines: prompt a small Qwen with A/B/C choices, read the logits of only those three tokens, normalize. That is the whole thing. It is a parody post, but you learn more about logits here than in most serious ones.
The biggest brokerage in Iran pushes 1,900 messages a second to tens of thousands of open connections, on 6 pods with 55MB RAM each. Kafka at the door, Redis Pub/Sub for the fanout, plain SSE to the client. I like the reasoning: a price is not an event you must keep, the next update replaces it anyway.
Do you wrap your page in a div with height: 100vh; overflow: auto? Then you already gave up scroll restoration, keyboard scrolling, window.scrollY, pull to refresh and the collapsing address bar on mobile. A nested scroller gets none of it. Even overflow-x: hidden on html does this. Use min-height: 100svh and overflow-x: clip.
Read a 256MiB file 4KiB at a time and that is 65,536 reads, but you do not feel it, because the kernel guesses ahead and grows the window as you keep going. Worth knowing the knobs: POSIX_FADV_SEQUENTIAL doubles it, POSIX_FADV_RANDOM kills it for index lookups, and DONTNEED only drops clean pages, so fsync first.
A flat page table would need 256GiB per process, so x86-64 splits the address into four levels of 512 entries, and one mapped page costs about 12KB. Then you see why TLB and working set matter, what your process really gets from fork before the first write, and why mmap skips a copy but pays a fault.
Their router kept dozens of consistent hash rings with 160 points per server, up to 6GB a box. A bit of math shows the last 90,000 points only buy you 0.7% better distribution, so 160 became 16. They also squeezed the struct into 6 raw bytes to beat Rust alignment. 100TB of RAM back. Math pays.
Deleting the old rows cost them more than running the workflow. Two things to learn: ON DELETE CASCADE scatters your deletes all over the pages, and an index knows nothing about visibility, so millions of dead tuples at the head of it made one lookup take 20 minutes. Drop the FK, batch it, vacuum around it. 10x.
Where does Postgres keep a row lock? Not in any lock table. It writes the xid into the row’s own t_xmax, the same field a delete uses, with infomask bits for the mode. Two lockers do not fit, so it allocates a multixact. That is how inserting children under a long transaction bloats pg_multixact.
A GitHub issue title went straight into a shell run: step. The sed escaping ran after the template expanded, so it escaped nothing, and one quote in a title was enough to walk away with their Jira token. GitHub Advanced Security did not catch it. Lesson: github.event is user input, put it in env first.
A 4B model with LoRA, trained with the reward being simply how fast the plan runs, and 44.7% lower latency on the Join Order Benchmark for $1,200. But read it for the measurement part: four pinned containers, interleaved candidate and default runs, a tie zone so noise cannot look like a win. That is the hard half.
Inspect, run and benchmark Apple Core ML models from your terminal, no Xcode and no Python, and it can serve any model as a local HTTP endpoint that stays warm. Swift, MIT.
Run LLMs on device from Godot, Flutter, Python, Kotlin, Swift or React Native, with llama.cpp and ONNX underneath and tool call grammar generated from your function signature. Rust, EUPL-1.2.
IP to ASN and IP to country tables as gzipped TSV, rebuilt hourly, public domain - you host it yourself, the public API is gone since 2020.
Play with the tiny models, 25M to 360M, right in your browser on WebGPU and compare them on token/sec and time to first token. No server, no account, no key.
Postgres read scaling by giving each replica only some leaf partitions and letting it query the others over FDW for the rest, so nobody needs a full copy. C, alpha, no license file yet.
From Trail of Bits: coop up and your coding agent lives in a disposable VM with docker and every compiler, but nothing of your host. Firecracker on Linux, Lima on mac. Rust, Apache-2.0.
psql with the things you wish it had: autocomplete that knows your tables and columns, syntax highlight, and favourite queries you can save and recall. Same family as litecli and mycli. Python, BSD-3.
An OWASP one that scans your npm, pnpm, Yarn or Bun lockfile locally and offline, then tells you to bump the parent when the vulnerable package is transitive. MIT.
Web Search Data, Ready as JSON and Markdown. SerpApi gives developers real-time, structured results from Google Search, Maps, Shopping, and 100+ search engine APIs through a simple API call.
A notification inbox for your own apps. One Go binary, one SQLite file, and it pushes straight to APNs with your own key, no relay in the middle. iOS only for now and you build the app yourself. MIT.
Federated chat that speaks plain IRC, so irssi or WeeChat connects with no plugin. Identity looks like email and instances find each other by SRV record plus a well-known ed25519 key. Go, MIT, proof of concept.
Do you really need a whole Prometheus and Grafana stack to know if a box is dying? This is a hub plus a tiny agent per machine: CPU, memory, disk, docker stats per container, SMART health, alerts. Go, MIT.
BetterDev Link
Every Monday