diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2026-01-10 15:34:34 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2026-01-10 15:34:34 +0800 |
| commit | f0d65be8cef87084f65f373ddfe51ce5c8405879 (patch) | |
| tree | e453cd2ccd6320799fb93e9ccb21c761c60d0a05 | |
| parent | a02d34ac1afa2eedcce5ce4eba5d3a6cdfdd8ec4 (diff) | |
| download | www-f0d65be8cef87084f65f373ddfe51ce5c8405879.tar.gz | |
IBM VGA fonts, major changes to typography, update site-search.
| -rw-r--r-- | _log/matrix-digital-rain.md | 8 | ||||
| -rw-r--r-- | _log/site-search.md | 12 | ||||
| -rw-r--r-- | assets/css/main.css | 40 | ||||
| -rw-r--r-- | assets/css/skeleton.css | 24 | ||||
| -rw-r--r-- | assets/fonts/Nouveau_IBM_Stretch.ttf | bin | 0 -> 72180 bytes |
5 files changed, 43 insertions, 41 deletions
diff --git a/_log/matrix-digital-rain.md b/_log/matrix-digital-rain.md index af3cff6..2edc7e7 100644 --- a/_log/matrix-digital-rain.md +++ b/_log/matrix-digital-rain.md @@ -7,7 +7,7 @@ thumbnail: thumb_sm.png --- The 2022 version worked but had some loose ends. Unicode support was -inflexible--couldn't mix ASCII with Katakana; Phosphor decay was stored in a +incomplete--couldn't mix ASCII with Katakana; Phosphor decay was stored in a separate array when it should've been packed with RGB; Code was harder to read than it needed to be. @@ -39,10 +39,10 @@ static inline void insert_code(matrix *mat, uint64_t blk; uint32_t min, max; - blk = glyphs[(rand() % glyphlen)]; + blk = glyphs[(xor() % glyphlen)]; min = (uint32_t)blk; max = (uint32_t)(blk >> 32); - mat->code[index(mat, row, col)] = rand() % (max - min) + min; + mat->code[index(mat, row, col)] = xor() % (max - min) + min; } ``` @@ -71,7 +71,7 @@ Optimized RNG--xorshift instead of rand(): ``` static inline uint32_t xor(void) { - /* Xorshift RNGs, George Marsaglia, The Florida State University. */ + /* Xorshift RNGs, George Marsaglia, Florida State University. */ static uint32_t y = 2463534242; y ^= (y << 13); diff --git a/_log/site-search.md b/_log/site-search.md index 1752db7..4ccae3c 100644 --- a/_log/site-search.md +++ b/_log/site-search.md @@ -4,7 +4,7 @@ date: 2026-01-03 layout: post --- -Article count is growing. Need a way to search. +Article count is growing. Need search. Requirements: matches substrings, case-insensitive, fast, secure. No JavaScript. @@ -14,7 +14,7 @@ Architecture: browser → httpd → slowcgi → Perl CGI script. Perl, httpd, slowcgi are in the OpenBSD base system. Instead of secrets, file system permissions govern access. -2025-12-30: Regex search. +2025-12-30: Regex. 140-line Perl script searches 500 files in 40ms. Fast enough; O(N) pull felt at higher file counts. @@ -22,7 +22,7 @@ higher file counts. Introduces ReDoS and symlink attack vectors. Both can be mitigated. Tempted to stop here. -2026-01-03: Suffix Array (SA) based index lookup. +2026-01-03: Suffix array (SA) based index lookup. Slurping files on every request bothers me. Regex search depends almost entirely on hardware for speed. @@ -36,8 +36,8 @@ $ cd cgi-bin/ $ perl indexer.pl ``` -Indexer extracts HTML, lowercases, encodes into UTF-8 binary sequences. Null -byte sentinel for document boundaries. sa.bin stores suffix offsets as +Indexer extracts HTML, lowercases, and encodes into UTF-8 binary sequences. +Null byte sentinel for document boundaries. sa.bin stores suffix offsets as 32-bit unsigned integers, sorted by lexicographical order: ``` @@ -120,7 +120,7 @@ Resource exhaustion and XSS attacks are inherent. Former mitigated by limiting concurrent searches via lock-file semaphores. Query length (64B) and result set (20) capped. All output is HTML-escaped to prevent XSS. -Secure by default. Fast. Durable. +Verdict: Fast. Durable. Secure by default. Commit: <a href="https://git.asciimx.com/www/commit/?h=term&id=6da102d6e0494a3eac3f05fa3b2cdcc25ba2754e" diff --git a/assets/css/main.css b/assets/css/main.css index 1b4341b..0500000 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -1,6 +1,13 @@ +@font-face { + font-family: 'Nouveau IBM Stretch'; + src: url('/assets/fonts/Nouveau_IBM_Stretch.ttf') format('truetype'); +} + :root { --main-bg-color: #202020; --main-fg-color: #00B140; + --font-family: 'Nouveau IBM Stretch', 'Roboto Mono', monospace; + --text-shadow: 0 0 1px var(--main-fg-color), 0 0 6px var(--main-fg-color); } *, @@ -16,21 +23,21 @@ body { text-decoration-skip: ink; color: var(--main-fg-color); padding-top: 10px; - font-family: 'Roboto Mono', monospace; + font-family: var(--font-family); background-color: var(--main-bg-color); background-size: 2px 2px; - text-shadow: 0 0 1px var(--main-fg-color), 0 0 6px var(--main-fg-color); + /* text-shadow: var(--text-shadow); */ } ::selection { - color: var(--main-bg-color); - background: var(--main-fg-color); - text-shadow: 0 0 1px var(--main-bg-color), 0 0 6px var(--main-bg-color); + color: var(--main-bg-color); + background: var(--main-fg-color); + /* text-shadow: var(--text-shadow); */ } ::-moz-selection { - color: var(--main-bg-color); - background: var(--main-fg-color); - text-shadow: 0 0 1px var(--main-bg-color), 0 0 6px var(--main-bg-color); + color: var(--main-bg-color); + background: var(--main-fg-color); + /* text-shadow: var(--text-shadow); */ } .footer { @@ -196,6 +203,11 @@ pre::-webkit-scrollbar { display: none; } +code { + line-height: 2.8rem; + font-family: var(--font-family); +} + .typewriter-1 { overflow: hidden; white-space: nowrap; @@ -221,12 +233,12 @@ pre::-webkit-scrollbar { .typewriter-2::after { filter: brightness(0.9); background-color: var(--main-fg-color); - box-shadow: 0 0 1px var(--main-fg-color), 0 0 6px var(--main-fg-color); + /* box-shadow: var(--text-shadow); */ content: ''; display: inline-block; - width: 1.3rem; - height: 1.9rem; - margin-left: -8px; + width: 0.9rem; + height: 1.45rem; + margin-left: -6px; animation: cursor-blink 1s steps(1, start) infinite; animation-delay: 3.5s; } @@ -242,7 +254,7 @@ pre::-webkit-scrollbar { border-color: var(--main-fg-color); color: var(--main-fg-color) !important; background-color: var(--main-bg-color); - text-shadow: 0 0 1px var(--main-fg-color), 0 0 6px var(--main-fg-color); + /* text-shadow: 0 0 1px var(--main-fg-color), 0 0 6px var(--main-fg-color); */ } #search-btn { @@ -250,5 +262,5 @@ pre::-webkit-scrollbar { border-color: var(--main-fg-color); color: var(--main-fg-color); background-color: var(--main-bg-color); - text-shadow: 0 0 1px var(--main-fg-color), 0 0 6px var(--main-fg-color); + /* text-shadow: 0 0 1px var(--main-fg-color), 0 0 6px var(--main-fg-color); */ } diff --git a/assets/css/skeleton.css b/assets/css/skeleton.css index 87b0050..0354b60 100644 --- a/assets/css/skeleton.css +++ b/assets/css/skeleton.css @@ -120,8 +120,8 @@ are based on 10px sizing. So basically 1.5rem = 15px :) */ html { font-size: 62.5%; } body { - font-size: 1.8em; /* currently ems cause chrome bug misinterpreting rems on body element */ - line-height: 1.4; + font-size: 2.0em; /* currently ems cause chrome bug misinterpreting rems on body element */ + line-height: 1.2; } h1, h2, h3, h4, h5, h6 { @@ -131,21 +131,11 @@ h1, h2, h3, h4, h5, h6 { } h1 { font-size: 4.0rem; line-height: 1.2; letter-spacing: -.1rem;} -h2 { font-size: 3.6rem; line-height: 1.25; letter-spacing: -.1rem; } +h2 { font-size: 3.6rem; line-height: 1.2; letter-spacing: -.1rem; } h3 { font-size: 3.0rem; line-height: 1.3; letter-spacing: -.1rem; } h4 { font-size: 2.4rem; line-height: 1.35; letter-spacing: -.08rem; } -h5 { font-size: 1.8rem; line-height: 1.5; letter-spacing: -.05rem; } -h6 { font-size: 1.5rem; line-height: 1.6; letter-spacing: 0; } - -/* Larger than phablet */ -@media (min-width: 550px) { - h1 { font-size: 5.0rem; } - h2 { font-size: 3.4rem; } - h3 { font-size: 3.0rem; } - h4 { font-size: 2.6rem; } - h5 { font-size: 2.4rem; } - h6 { font-size: 1.5rem; } -} +h5 { font-size: 2.0rem; line-height: 1.5; letter-spacing: -.05rem; } +h6 { font-size: 1.8rem; line-height: 1.6; letter-spacing: 0; } p { margin-top: 0; } @@ -289,7 +279,7 @@ ol ul { margin: 1.5rem 0 1.5rem 3rem; font-size: 90%; } li { - margin-bottom: 0.6rem; } + margin-bottom: 0.1rem; } ol { margin-left: 1.8em; } @@ -299,7 +289,7 @@ ol { code { padding: .2rem .5rem; margin: 0 .2rem; - font-size: 95%; + /* font-size: 95%; */ white-space: nowrap; border-radius: 4px; } diff --git a/assets/fonts/Nouveau_IBM_Stretch.ttf b/assets/fonts/Nouveau_IBM_Stretch.ttf Binary files differnew file mode 100644 index 0000000..71279ba --- /dev/null +++ b/assets/fonts/Nouveau_IBM_Stretch.ttf |
