Skip to content

Instantly share code, notes, and snippets.

@sogaiu
sogaiu / maybe-problems-in-boot.janet
Last active March 9, 2026 13:54
may be some problems in boot.janet
# if-let
(defmacro when-with
``Similar to with, but if binding is false or nil, returns
nil without evaluating the body. Otherwise, the same as `with`.``
[[binding ctor dtor] & body]
~(if-let [,binding ,ctor]
,(defer-impl :when-with [(or dtor :close) binding] body)))
# if-let
(defmacro if-with
@sogaiu
sogaiu / gist:0b75094eb94a7e640dc6f46978fa8777
Last active March 9, 2026 13:11
passphrase via terminal for gnupg
# create file
$ echo hello > fun.txt
# symmetric encryption
$ gpg --verbose --verbose --pinentry-mode loopback --symmetric fun.txt
gpg: enabled compatibility flags:
gpg: using cipher AES256.CFB
gpg: writing to 'fun.txt.gpg'
# decryption
$ janet
Janet 1.41.3-dev-8f446736 linux/x64/gcc - '(doc)' for help
repl:1:> (tabseq [i :in [:a :b]] i i)
@{:a :a :b :b}
repl:2:> (defn loop [&] nil)
<function loop>
repl:3:> (tabseq [i :in [:a :b]] i i)
repl:3:9: compile error: unknown symbol i
# reference: https://ianthehenry.com/posts/janet-game/the-problem-with-macros/
@sogaiu
sogaiu / kiczales-oopsla94-black-boxes-reuse.md
Created March 5, 2026 04:10 — forked from msgodf/kiczales-oopsla94-black-boxes-reuse.md
Gregor Kiczales "Why are black boxes so hard to reuse?"

This talk was given by Gregor Kiczales of Xerox PARC at OOPSLA ’94, 10/26/94. © 1994, University Video Communications. A transcript, with point- and-click retrieval of the slides, is available at http:/www.xerox.com/PARC/spl/eca/oi/gregor-invite/gregor- transcript.html

Why are black boxes so hard to reuse?

I think our field will go through a revolution. We will fundamentally change the way we think about and use abstraction in the engineering of software.

The goal of this talk is to summarize the need for and the basic nature of this abstraction framework.

The change is not new problems or new systems, but a new way of thinking about existing problems and existing systems.

@sogaiu
sogaiu / notes.md
Last active March 1, 2026 09:28
icloud notes
@sogaiu
sogaiu / notes.md
Created February 21, 2026 07:27
deduplication

dupeguru - gui