Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| // your account domain | |
| const DOMAIN = "mastodon.social"; | |
| // your registered mastodon app's access token | |
| // (might need to first create an app via mastodon preferences and | |
| // assign scopes: read:bookmarks and write:bookmarks) | |
| const ACCESS_TOKEN = "TODO"; | |
| // only remove bookmarks older than this date | |
| const THRESHOLD_DATE = "2025-06-01"; |
| fn swizzleEnum(comptime N: usize, comptime T: type, a: @Vector(N, T), comptime id: Swizzle) @Vector(swizzleLength(id), T) { | |
| comptime var code = @intFromEnum(id); | |
| comptime var i = 0; | |
| comptime var offset = 0; | |
| comptime var count = 4; | |
| inline while (code >= offset + count) { | |
| offset += count; | |
| count <<= 2; | |
| i += 1; | |
| } |
| import type { Fn2 } from "@thi.ng/api"; | |
| import { | |
| DEFAULT, | |
| expand, | |
| interpret, | |
| type LSysSymbol, | |
| type RuleImplementations, | |
| } from "@thi.ng/lsys"; | |
| // iterative rule expansion |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
| <title>svg-gauge</title> | |
| <style> | |
| :root { | |
| --gauge-col: #0c9; |
| import { Z4, type Stringer } from "@thi.ng/strings"; | |
| import { | |
| comp, | |
| iterator, | |
| map, | |
| mapcat, | |
| partition, | |
| range, | |
| wrapSides, | |
| } from "@thi.ng/transducers"; |
| import { | |
| asSvg, | |
| bounds, | |
| circleFrom2Points, | |
| group, | |
| GroupAttribs, | |
| line, | |
| Polygon, | |
| starWithCentroid, | |
| svgDoc, |
| import { identity } from "@thi.ng/api"; | |
| import { topoSort } from "@thi.ng/arrays"; | |
| import { defDGraph } from "@thi.ng/dgraph"; | |
| import { toDot } from "@thi.ng/dgraph-dot"; | |
| import { comp, filter, map, mapcat, pairs, run, trace } from "@thi.ng/transducers"; | |
| interface Task { | |
| title: string; | |
| done?: boolean; | |
| // IDs of other tasks this task depends on (aka is blocked by) |
| const std = @import("std"); | |
| const wasm = @import("wasm-api"); | |
| const dom = @import("wasm-api-dom"); | |
| // expose thi.ng/wasm-api core API (incl. panic handler & allocation fns) | |
| pub usingnamespace wasm; | |
| // main entry point | |
| export fn start() void { | |
| init() catch |e| @panic(@errorName(e)); |
| import { epoch, int, parseCSV, type CSVRecord, type ColumnSpecs } from "@thi.ng/csv"; | |
| import { defFormat, months } from "@thi.ng/date"; | |
| import { readText, writeText } from "@thi.ng/file-io"; | |
| import { serialize } from "@thi.ng/hiccup"; | |
| import { svg } from "@thi.ng/hiccup-svg"; | |
| import { closedOpen } from "@thi.ng/intervals"; | |
| import { split } from "@thi.ng/strings"; | |
| import { comp, filter, push, transduce } from "@thi.ng/transducers"; | |
| import { | |
| barPlot, dataBounds, dataMaxLog, |