A reading reference for working developers
The codes and formats you meet every day, explained plainly
spunk.codes is a small set of written guides. Each one takes a format or a code that shows up in everyday programming work, explains how it is built, and then works through real examples so you can read it, write it and debug it with confidence.
What this site is
Most of the strings a developer copies around all day are not free text. A 404 in a log, a %20 in a link, a 0644 in a deploy script, a */15 * * * * in a crontab and a ^1.4.2 in a package file are all small languages with exact rules. When you know the rules, these strings stop being magic and start being quick to read. When you do not, they cause the kind of bug that takes an afternoon to find and one character to fix.
Every guide here covers one of those small languages. The pages are written to be read from top to bottom the first time and scanned later when you only need the table. They do not try to sell anything, and there is nothing to install or sign up for. The site is plain HTML and CSS with no scripts, so the pages load fast and print cleanly.
How the guides are written
Each guide follows the same idea, even though the pages are not identical in shape. First comes a short explanation of why the format exists and what problem it solves. Then the rules, in the order you need them. Then worked examples. Every example value on these pages, such as an encoded string, an octal mode, a check digit, a sorted version list or a converted timestamp, was produced by running real code rather than typed from memory, so you can reproduce it yourself.
The guides stick to stable, documented behavior: the parts of HTTP, Unicode, POSIX, ISO and the various specifications that have not changed in years. Where tools disagree, for example between regular expression flavors or between cron implementations, the page says so instead of picking one and pretending it is universal.
One character, many forms
Several guides on this site describe the same underlying bytes from different angles. The table below takes five characters and shows each one as a Unicode code point, as a decimal number, as the bytes UTF-8 uses to store it (in hex and in binary), as Base64 text, and as it appears inside a URL. Reading across a row is a good way to see how the guides fit together.
| Character | Code point | Decimal | UTF-8 bytes (hex) | UTF-8 bytes (binary) | Base64 | URL-encoded |
|---|---|---|---|---|---|---|
A | U+0041 | 65 | 41 | 01000001 | QQ== | A |
z | U+007A | 122 | 7A | 01111010 | eg== | z |
(space) | U+0020 | 32 | 20 | 00100000 | IA== | %20 |
é | U+00E9 | 233 | C3 A9 | 11000011 10101001 | w6k= | %C3%A9 |
€ | U+20AC | 8364 | E2 82 AC | 11100010 10000010 10101100 | 4oKs | %E2%82%AC |
Plain ASCII letters such as A and z fit in one byte and pass through a URL unchanged. The space needs percent-encoding. The accented é takes two bytes in UTF-8 and the euro sign takes three, which is why their URL forms grow longer. The character encoding guide explains the byte patterns, the number bases guide explains the hex and binary columns, and the Base64 and URL encoding guides explain the last two columns.
All guides
The guides are grouped by the kind of work where you usually run into them. Each card links to a full page.
Web and HTTP
Data formats
- JSON syntaxThe six value types, the strict rules that make a parser reject a file, and the escapes allowed in strings.
- YAML syntaxIndentation, lists and maps, block text, anchors, and the YAML 1.1 surprise where no turns into false.
- Base64How three bytes become four characters, where the padding comes from, and why Base64 is not encryption.
Text, numbers and color
- ASCII, Unicode and UTF-8Bytes versus characters, the ASCII table, Unicode code points, and how UTF-8 stores each one.
- Binary, octal and hexPlace value in base 2, 8, 10 and 16, with conversion steps and a table you can check by hand.
- Hex and RGB colorsReading #RRGGBB, short and alpha forms, rgb() and hsl(), and how a contrast ratio is calculated.
Patterns and schedules
Files, versions and source control
- chmod and permissionsRead, write and execute for owner, group and others, octal modes, umask and the special bits.
- Semantic versioningWhat MAJOR.MINOR.PATCH promises, how pre-release tags sort, and what ^ and ~ ranges allow.
- Git basicsWorking tree, staging area and commits, the everyday commands, and the safe ways to undo.
Standards and codes
- ISO country and language codesTwo- and three-letter country codes, language codes, and how tags like pt-BR are built.
- Time zones and UTCUTC, offsets and zone names, daylight saving gaps, ISO 8601 dates and Unix timestamps.
- QR codes and barcodesHow UPC and EAN check digits work, how QR codes grow by version, and what error correction buys you.
Where to start
If you are new to programming, start with binary, octal and hex and then ASCII, Unicode and UTF-8. Those two pages explain ideas that the color, permission, Base64 and URL encoding guides build on. If you work mostly on web services, the HTTP status codes, JSON and time zones guides cover the formats that tend to cause the most confusing bugs in APIs. If you maintain servers or build pipelines, go to file permissions, cron and YAML first.
Each guide links to its closest neighbors in the sidebar and at the bottom of the page, so you can follow a thread from one topic to the next without coming back here.