· 3 min read
Regex Basics: A Beginner's Guide
A regular expression is a pattern for matching text. Here are the building blocks — character classes, quantifiers and anchors — with a worked example.

Front-end developer and tech writer · View profile
· 3 min read
A regular expression is a pattern for matching text. Here are the building blocks — character classes, quantifiers and anchors — with a worked example.
· 3 min read
A QR code is a 2D barcode a camera reads to open a link or text. Here's what it is, why it holds so much, its anatomy, and a safety note on scanning.
· 12 min read
A word count is a definition, not a measurement. We counted the same paragraph four ways and got 25, 28, 33 and 38 — then counted 50,000 characters of ordinary prose and got agreement to within 4.5%. The gap is entirely driven by compounds, figures and URLs.
· 13 min read
1,234.56 and 1.234,56 are the same number, and confusing them changes the value a reader parses. We ran Intl.NumberFormat for all six site locales and printed every separator — including the invisible one French uses — then measured why parseFloat cannot undo any of it.
· 2 min read
A hash function turns any input into a fixed-size fingerprint. Here's what it does, its key properties, common uses, and which algorithms are safe.
· 13 min read
One visible emoji can be one code point or fourteen UTF-16 units. We ran three popular regexes against a real sentence and each broke differently — one deleted the digits. Here is why, which Unicode property answers which question, and the grapheme-cluster rule that actually works.
· 13 min read
A bold-looking 𝐀 is not the letter A in a bold font — it is U+1D400, a separate character invented for mathematics. We printed the code points, measured what it costs in bytes, broke search, sorting and word counts with it, and scanned the block to find its 28 holes.
· 3 min read
Format plain text with a few symbols: # for headings, ** for bold, - for lists. Here's what markdown is, the core syntax, why it's everywhere, and the gotchas.
· 3 min read
HEX and RGB are two notations for the same colours. Here's how to read each, convert between them, and add transparency.
· 2 min read
A JWT is a compact, signed token used to carry identity between services. Here's its three parts, how it's used for auth, and its security limits.
· 3 min read
A word count is words separated by spaces. Here's how it's counted, why limits exist, how it maps to pages and reading time, and when characters count instead.
· 2 min read
A UUID is a 128-bit identifier that's unique without any central authority. Here's what it looks like, why it's useful, the versions, and when to use one.
· 18 min read
Frames = duration × rate is trivial until the rate is 29.97. Non-drop timecode then drifts exactly 3.6 seconds an hour. Drop-frame corrects it by skipping 108 frame numbers — the same 108 — but the correction is not perfect: counting every frame shows a residual of 3.6 milliseconds per hour.
· 15 min read
Uncompressed audio size is exact arithmetic: sample rate × bit depth × channels × seconds ÷ 8. CD audio is 176,400 bytes per second. A 320 kbps MP3, by contrast, is bitrate × duration and does not depend on the sample rate at all — 2,400,000 bytes a minute whether it came from 44.1 or 48 kHz.
· 17 min read
Interpolating in sRGB averages gamma-encoded numbers, so the midpoint of red to green is #808000 when the half-light answer is #bcbc00 — 57.2% too little light. Banding is a separate arithmetic problem: 8 bits give 256 steps, and a dark gradient may have only 28 of them. Here is both, computed.
· 4 min read
Why your 100 Mbps plan downloads at 12.5 MB/s, the bits-versus-bytes ÷8 rule, and how to turn a connection speed into a real download time.
· 15 min read
Complementary, triadic, analogous and split-complementary are just rotations: add 180°, 120°, 30° or 150° to a hue. The arithmetic is trivial. The problem is that the HSL hue circle is not perceptually uniform — yellow and blue at the same HSL lightness differ in luminance by 12.85 times — so a generated palette has to be contrast-checked afterwards.
· 17 min read
A diagonal plus an aspect ratio gives you width and height by Pythagoras, and the answer is not what the marketing implies: a 27-inch 21:9 has 16.2% less area than a 27-inch 16:9. Then pixels per degree, which shows the highest-PPI phone is not the sharpest thing you own.
· 19 min read
Building an IN list by string concatenation is both the classic injection vector and a performance cliff. Parameterisation fixes the first structurally, because the plan is compiled before any value arrives. The second needs arithmetic: the vendors' documented parameter ceilings, and what a query whose text changes with every list length does to a plan cache.
· 17 min read
YAML is JSON plus a type-inference layer, and the inference is the dangerous part. The same file run through a YAML 1.2 parser and a YAML 1.1 parser: no is a string in one and false in the other, 01234 is 1234 in one and 668 in the other, and 12:30:00 is a number in one of them.
· 19 min read
JSON has no integer type, no date type, no comments and no schema. Every one of those absences produces a specific bug: a 19-digit ID comes back off by 21, a timestamp becomes a string nobody agreed on, NaN cannot be written down, and duplicate keys are legal. All of it run, in two languages.
· 4 min read
Estimate download time from file size and connection speed. Learn the size ÷ speed formula, the crucial bits-versus-bytes conversion (divide by 8), and why real downloads run slower than the math predicts.
· 4 min read
Convert PSI to bar and back with the exact factor, learn the 1 bar ≈ 14.5 PSI shortcut, and set tire pressure right in either unit.
· 3 min read
A cron expression schedules a task to run automatically at set times. Here's what it's for, its five fields, how to read one, and the common gotchas.