Skip to content

Instantly share code, notes, and snippets.

@tangentstorm
tangentstorm / README.md
Created November 15, 2026 06:46
platform #16 mobile recording mock-ups

Mock-ups for tangentcode/platform#16 (mobile recording mode)

@tangentstorm
tangentstorm / changelog-mockups-readme.md
Created November 15, 2026 05:34
Mockups: build-log plugin internal vs public changelog (#517)

Mockups for tangentcode/platform #517: build-log plugin config toggle and internal/public changelog modes.

@tangentstorm
tangentstorm / option-a.png
Created November 15, 2026 00:55
Mockups: one-click Save icon in the Minavo avo shell
option-a.png
on view do
c.pos: c.pos+gamepad.dir * 4
c.pos: (0,0) | c.pos & card.size - c.size # bounds check
if gamepad.down.action c.pattern:32+random[16] c.fill[] end
end
@tangentstorm
tangentstorm / mcp.k
Last active November 18, 2025 20:45
mcp.k : mcp server for ngn/k
#!k
/ [this code was generated and tested via claude, and is in the public domain]
/ MCP (Model Context Protocol) server for ngn/k
/ Implements JSON-RPC 2.0 over stdio
/ Reads requests from stdin and responds on stdout
/ Note: Requires persistent stdin connection (as provided by MCP clients)
/ Installation in Claude Code (experimental):
/ Option 1: Using claude mcp add command
/ claude mcp add ngnk /path/to/ngnk/k /path/to/ngnk/mcp.k
/ Option 2: Manual JSON configuration
> chs('abc')(on('apple'))
{ mk: -1, ix: 1, ch: 'p', ib: 'apple', mb: 1 }
> chs('abc')(on('zapple'))
{ mk: -1, ix: 0, ch: 'z', ib: 'zapple', mb: 0 }
> chs('zabc')(on('zapple'))
{ mk: -1, ix: 1, ch: 'a', ib: 'zapple', mb: 1 }
> chs('abcz')(on('zapple'))
{ mk: -1, ix: 1, ch: 'a', ib: 'zapple', mb: 1 }
> chs('abcz')(on(''))
{ mk: -1, ix: 0, ch: undefined, ib: '', mb: 0 }
@tangentstorm
tangentstorm / j-eval.zsh
Created April 28, 2025 00:00
evaluate j syntax directly in zsh prompt
# Reset color after command execution
preexec() {
echo -ne "\e[0m"
}
# J language interceptor using ZLE
j-line-intercept() {
local cmd="$BUFFER"
if [[ "$cmd" = "j "* ]]; then
@tangentstorm
tangentstorm / bex-nocare-prompt.md
Created February 12, 2025 00:02
o3/copilot prompt "don't care" cursor for bex

@tangentstorm:

For the python wrapper, I want to either modify the cursor idea to support a "don't care" concept.

If the path down the bdd skips over a variable, it means we don't care about it. Right now, the solution iterators are designed to explicitly account for this, and do a "ripple carry" operation over the skipped variables. (Basically, we just treat that run of variables as a binary number and keep incrementing it until a variable above it flips.)

But, in the dd python wrapper for bdds, it prefers to skip over the duplicates by simply removing the variables we don't care about from the yielded assignments at each step. ... but it ALSO has a way to opt back in.

Study the code in bdd_sols.rs and come up with a way to do this while still supporting the current "iterate through every solution" behavior.

@tangentstorm
tangentstorm / itemlist.deck
Last active September 9, 2025 20:40
itemlist contraption for decker
{deck}
version:1
card:0
size:[512,342]
name:"itemlist.deck"
{card:home}
{widgets}
itemlist1:{"type":"contraption","size":[400,161],"pos":[13,30],"def":"itemlist","widgets":{"label":{},"item_text":{},"items":{},"bnw":{},"bgo":{},"run_event":{},"slider1":{},"bpr":{},"bnx":{},"brm":{},"bup":{},"dn":{}}}
@tangentstorm
tangentstorm / sh.mts
Last active May 14, 2025 20:29
sh.mts: javascript shorthand (mostly for web/dom stuff)
// sh.mts: javascript shorthand
// #region array tools
/** id function (returns first argument) */
export const id=<T,>(x: T): T=>x
/** create an array filled with n copies of x */
export const af=<T,>(n: number, x: T): T[]=>Array(n).fill(x) // TODO: make this 'afl' or 'fil' (aa?)
/** loop i from 0..n, calling f(i) */
export const ii=(n: number, f: (i: number)=>void)=>{for(let i=0;i<n;i++)f(i)}
/** map f over [0..n] */