Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| import type { FnU2, Maybe, Predicate2 } from "@thi.ng/api"; | |
| import { difference, intersection, union } from "@thi.ng/associative"; | |
| import { isArray, isString } from "@thi.ng/checks"; | |
| import { illegalArgs } from "@thi.ng/errors"; | |
| import { evalSource } from "@thi.ng/lispy"; | |
| import { defQuery, type QueryOpts } from "@thi.ng/oquery"; | |
| import { expect, test } from "bun:test"; | |
| type Note = { id: number; tags: string[] }; |
| import { parseHtml } from "@thi.ng/hiccup-html-parse"; | |
| import { serialize } from "@thi.ng/hiccup-markdown"; | |
| import { arrayZipper, type Location } from "@thi.ng/zipper"; | |
| const HOST = "mastodon.thi.ng"; | |
| const STATUS_ID = "115464108396925195"; | |
| // load a Mastodon status via API | |
| const res = await ( | |
| await fetch(`https://${HOST}/api/v1/statuses/${STATUS_ID}`) |
| // 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) |