- 3 whole star anise
- 15 whole cardamon pods
- 2 tblsp ground cinnamon (or ~0.75 stick)
- 1.5 tblsp ground cloves
- 0.5 tsp ground coriander
- 0.75 tsp ground ginger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { output, processImage } from "@thi.ng/imago"; | |
| import { GRAY8 } from "@thi.ng/pixel"; | |
| import { readGeoTiff } from "@thi.ng/pixel-io-geotiff"; | |
| import { range2d } from "@thi.ng/transducers"; | |
| import { readFileSync } from "node:fs"; | |
| // a 44155 x 25153 pixel GeoTIFF file | |
| const path = "DOM_Tirol_5m_epsg31254/DOM_Tirol_5m_epsg31254_2017-2023.tif"; | |
| // load GeoTIFF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int redPin = 6; | |
| int greenPin = 5; | |
| int bluePin = 9; | |
| float col[3]; | |
| float hue = 0.0; | |
| void setup() { | |
| pinMode(redPin, OUTPUT); | |
| pinMode(greenPin, OUTPUT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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[] }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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}`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; Tetrahedron intersection based on this paper & algorithm: | |
| ;; http://vcg.isti.cnr.it/Publications/2003/GPR03/fast_tetrahedron_tetrahedron_overlap_algorithm.pdf | |
| ;; | |
| ;; Unlike original algorithm this implementation produces correct | |
| ;; results regardless of the orientation/ordering of points defining | |
| ;; the two tetrahedra. This is achieved via the orient-tetra function, | |
| ;; which ensures the correct ordering of vertices for this algorithm | |
| ;; to function properly. | |
| ;; | |
| ;; Implementation extracted from upcoming geometry library |
NewerOlder