Skip to content

Instantly share code, notes, and snippets.

@sogaiu
sogaiu / gist:4cd497e439c319c2e750b4136317b6d9
Created February 6, 2026 13:04
rebol stuff that might be worth looking at for additional peg specials in janet
https://www.rebol.com/r3/docs/concepts/parsing-summary.html
(defn capture-empty-element
[& args]
(def sname (first args))
(case (length args)
0 (errorf "expected one or more args, got 0")
#
1 {:tag sname}
#
{:tag sname
:attrs (table ;(drop 1 args))}))
#! /usr/bin/env janet
# based on:
#
# https://codeberg.org/veqq/rss-reader/src/branch/master/rss-reader.janet
# usage: pass feed urls on command line
# requirements:
#
@sogaiu
sogaiu / notes.md
Created February 4, 2026 14:08
jpm, janet-pm, etc.
@sogaiu
sogaiu / notes.md
Last active February 1, 2026 13:18
sm-n981n note 20 5g
  • basic info

    • model code (from Settings -> About phone -> Status Information): SM-N981NZNEKOO

    • looks like qualcomm snapdragon 8250 (via CPU Info app)

    • specs

    • twrp

(defn visit
``
Traverse directory tree starting at `path`, applying
argument `a-fn` to each encountered file or directory path.
``
[path a-fn]
(assertf (is-dir? path)
"expected dir but got: %n" (os/stat path :mode))
(def seen? @{})
#
@sogaiu
sogaiu / tidbits.janet
Last active January 31, 2026 06:05
janet tidbits
# `(next x)` can be used as a synonym for `(not (empty? x))`
# if `next` returns `nil`, the argument is empty.
(next [])
# =>
nil
# if `next` returns non-nil, the argument is not empty.
(next [:a :b])
# =>
* refine this file based on conventions adopted for
notes.txt files used for niche and jell
* possibly could split out search-paths so jackal, jargon, and jog can
vendor search.janet from some common place? might be that
walk-dir.janet and search.janet should be merged?
* unexpected...why does path-join show up as result 8 below?
~/src/git-some-janets/repos$ jakl who-calls declare-project