Skip to content

Instantly share code, notes, and snippets.

In the for_collect case, my understanding is the main goal of FilePath is to prevent clobbering files with save. If we've collected, it's now safe to overwrite our original file, so FilePath is cleared. The code has always been doing this, but the previous version tied that decision to content_type — it only cleared FilePath when content_type was also None. That coupling didn't make sense, so when I added the custom metadata field, I moved the collect-time cleanup into its own for_collect method on PipelineMetadata and made it always clear FilePath regardless of other fields.

Connecting your app to Stellar for live CSS updates

Stellar is a local-first CSS generator with an interactive web editor. stellar serve serves your generated CSS and exposes a /live-refresh SSE endpoint that pushes stylesheet updates via Datastar.

stellar serve  # http://localhost:7331
@cablehead
cablehead / xs-naming-rfc.md
Last active January 19, 2026 17:16
xs stream naming conventions RFC

xs Naming Conventions RFC

Proposing consistent naming for stream position concepts in xs.

The Problem

Current naming mixes metaphors:

  • .head returns the newest frame (like Git HEAD)
  • --tail skips to the end (like Unix tail)
  • But resume_from: "head" means start from the beginning

Exploring schema validation for nushell/http-nu

We want to validate records against a schema (like JSON Schema). Nushell already has type syntax for command signatures:

def foo []: record<
  name: string,
  age: int,
  email?: string,
  tags: list<string>,
use xs.nu *
use http-nu/router *
use http-nu/datastar *
use http-nu/html *
def escape []: string -> string {
$in | str replace -a '&' '&amp;' | str replace -a '<' '&lt;' | str replace -a '>' '&gt;'
}
use /root/.config/nushell/scripts/xs.nu *
def decode-basic-auth [header?: string] {
if ($header | is-empty) or (not ($header | str starts-with 'Basic ')) {
return null
}
let encoded_part = $header | str replace 'Basic ' ''
# handle base64 decode errors
Analysis Complete
I've reviewed the http-nu repository and found the key insights for fixing the Darwin build failure in nixpkgs.
Root Cause
The libproc v0.14.11 crate (a transitive dependency via nu-system → part of Nushell) uses bindgen to generate Rust bindings from C code. Bindgen requires libclang to compile, but the current nixpkgs package
definition doesn't provide it for Darwin builds.
How http-nu Successfully Builds on Darwin
@cablehead
cablehead / xs.nu
Created October 20, 2025 21:22
xs.nu - Nushell wrapper for cross.stream using http builtins with Unix socket and TCP support
export const XS_CONTEXT_SYSTEM = "0000000000000000000000000"
def and-then [next: closure --else: closure] {
if ($in | is-not-empty) { do $next } else {
if $else != null { do $else }
}
}
def or-else [or_else: closure] {
if ($in | is-not-empty) { $in } else { do $or_else }
@cablehead
cablehead / todomvc.stream
Created September 3, 2025 12:13
example stream for the datastar todomvc guide: https://data-star.dev/examples/todomvc
event: datastar-patch-elements
data: elements <section id="todomvc" data-on-load="@get('/examples/todomvc/updates')"><header id="todo-header"><input type="checkbox" data-on-click__prevent="@post('/examples/todomvc/-1/toggle')" data-on-load="el.checked = false"> <input id="new-todo" type="text" placeholder="What needs to be done?" data-signals-input data-bind-input data-on-keydown="
data: elements evt.key === 'Enter' && $input.trim() && @patch('/examples/todomvc/-1') && ($input = '');
data: elements "></header><ul id="todo-list"><li role="button" tabindex="0" data-on-dblclick="evt.target === el &amp;&amp; @get(&#39;/examples/todomvc/0&#39;)"><input id="todo-checkbox-0" type="checkbox" data-on-load="el.checked = true" data-on-click__prevent="@post(&#39;/examples/todomvc/0/toggle&#39;)"> <label for="todo-checkbox-0">Learn any backend language</label> <button class="error small" data-on-click="@delete(&#39;/examples/todomvc/0&#39;)"><iconify-icon icon="pixelarticons:close" noobserver=""></iconify-icon>
@cablehead
cablehead / index.html
Created August 6, 2025 18:48
ccto-wednesday-july-23-2025
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>reveal.js</title>
<link rel="stylesheet" href="dist/reset.css">
<link rel="stylesheet" href="dist/reveal.css">