Xerobit

Guides · page 2 of 5

Browsing 107 guides, newest first.

Data & Format

Deserialize JSON to C# Classes with System.Text.Json

Turn a JSON sample into C# classes and deserialize it with System.Text.Json or Newtonsoft. Tested attributes, case rules, records, decimal money and the real exception messages.

8 min read
Data & Format

JSON to Go Struct: Tags, Nulls and Unmarshal Errors

Write a Go struct from a JSON sample and unmarshal it. Tested handling of null, omitempty, big int64, time.Time and the exact 'cannot unmarshal' error messages with fixes.

8 min read
Data & Format

TypeScript Interface from JSON: Tested Worked Example

Generate a TypeScript interface from a JSON sample, see what it gets wrong (nulls, mixed arrays, dynamic keys), fix it under strict tsc, and add Zod for runtime checks.

8 min read
Dev Productivity

Kubernetes CronJob Not Running: Causes and Fixes

Why a Kubernetes CronJob creates no Jobs or runs at the wrong hour: the 100 missed schedules rule, startingDeadlineSeconds, concurrencyPolicy, suspend and timeZone.

7 min read
Dev Productivity

Lorem Ipsum HTML Templates: 9 Components and Emmet Shortcuts

Copy-paste lorem ipsum HTML templates for nav, hero, cards, pricing, form, table, dialog, article and footer, with Emmet abbreviations and a worst-case text overflow test.

8 min read
Frontend & Design

PWA Maskable Icons: Safe Zone, Required Sizes and How to Test

PWA maskable icon safe zone with measured numbers: the 40% radius circle, why a square logo must be 56.6% of the icon, separate any and maskable entries, Chrome install checks.

7 min read
Dev Productivity

QR Code Minimum Size for Print: Centimetres by Scanning Distance

QR code minimum size by scan distance from a tested model of 4 camera pixels per module. Tables for 25 and 33 module codes, URL length effects, quiet zone, DPI, SVG.

7 min read
Dev Productivity

Why regex.test() Alternates True and False in JavaScript (the /g lastIndex Bug)

regex.test() returns true then false on the same string because /g and /y make a RegExp stateful. Reproduction, five fixes, the exec loop trap and a table of all flags.

7 min read
Dev Productivity

JavaScript replace() and replaceAll() with Regex: Capture Groups, Callbacks, Global-Flag TypeError

Fix the replaceAll global RegExp TypeError, then use $1, $<name>, $& and callback replacers correctly. Tested in Node 25 and Chrome 156, plus camelCase to kebab-case.

8 min read
Encoding & Crypto

Keccak-256 vs SHA3-256: Why Your Ethereum Hash Does Not Match

Keccak-256 and SHA3-256 differ by one padding byte, so the same input gives different hashes. Proof table, which library gives which, and a debug checklist.

6 min read
Dev Productivity

Composite Index Column Order: Why Your Multi-Column Index Is Not Used

Composite index column order tested on PostgreSQL 18 with EXPLAIN ANALYZE: leftmost prefix, equality before range, ORDER BY, covering and partial indexes.

10 min read
Dev Productivity

UUID v5 Namespaces: Generate the Same UUID From a URL or Name

UUID v5 hashes a namespace UUID plus a name with SHA-1, so the same input always gives the same ID. Verified examples in Python and JavaScript, plus the pitfalls.

6 min read
Encoding & Crypto

How to Break a Vigenere Cipher: Kasiski Examination Worked Example

Break a real 405-letter Vigenere ciphertext end to end: Kasiski repeated-trigram distances, index of coincidence per key length, and column frequency analysis in Python.

8 min read
Encoding & Crypto

Break Repeating-Key XOR: Hamming Distance Key Length and Frequency Scoring

How to break repeating-key XOR in Python: find the key length with normalised Hamming distance, solve each column by English frequency scoring, and see why key reuse leaks.

7 min read
Frontend & Design

Apple Touch Icon Not Showing on iOS: Causes and Fixes

Apple touch icon not showing or black, blurry or wrong? A checklist for the file, the link tag and the server response, with curl commands and a PNG check you can run.

6 min read
Frontend & Design

Replace the padding-top Hack with CSS aspect-ratio (Migration Guide)

Migrate the 56.25% padding-top hack to CSS aspect-ratio: before and after code, plus tested pitfalls with overflowing content, img attributes, grid stretch and flex stretch.

7 min read
Frontend & Design

Responsive YouTube and Vimeo Embeds with CSS: iframe Aspect Ratio Fixes

Make a YouTube or Vimeo iframe responsive with CSS aspect-ratio: copy-paste code for 16:9, 4:3 and 9:16, why the height stays 150px, facade pattern and grid or flex fixes.

6 min read
Encoding & Crypto

Data URI Size Limits and When Inlining Base64 Hurts Performance

Data URI size limits in Chrome, Firefox and Safari, what base64 costs after gzip (measured on PNG, WOFF2 and SVG), when inlining loses, and code to build one in browser and Node.

6 min read
Dev Productivity

btoa 'Invalid Character' and Unicode Errors: Correct Base64 in JavaScript and Node

Why btoa throws Invalid character on emoji and euro signs, the TextEncoder fix, Buffer base64 vs base64url, atob quirks and a tested streaming encoder that avoids a chunk-size bug.

7 min read
Dev Productivity

How to Verify Googlebot: Reverse DNS, Forward DNS and Fake UA Spoofing

A Googlebot user agent proves nothing. Verify it with reverse and forward DNS or Google's IP range JSON, with real command output and a tested Node and Express implementation.

7 min read
Dev Productivity

Cron Expression Guide: Fields, Syntax and Run-Time Examples

Field-by-field cron expression reference with next-run times checked in code, the day-of-month OR trap, dialect differences (Unix, Quartz, GitHub, Kubernetes) and common errors.

8 min read
Dev Productivity

Vercel Cron Jobs: vercel.json Setup, CRON_SECRET and Hobby Plan Limits

Set up Vercel Cron Jobs with vercel.json, secure the route with CRON_SECRET (and the bug in the common pattern), and know the Hobby plan limits, UTC schedules and duplicate runs.

7 min read
Frontend & Design

Fluid Typography with clamp(): The Formula and the WCAG Zoom Trap

The clamp() formula for fluid font sizes, a tested generator function, and the zoom trap: vw-only text barely grows at 200% browser zoom. Measured growth for four options.

7 min read
Frontend & Design

CSS Grid Template Areas: Named Grid Areas Explained

CSS grid-template-areas with error cases tested in Chrome: non-rectangular areas, uneven rows, missing quotes, plus a page layout, media queries and tab order.

8 min read