Skip to content

Instantly share code, notes, and snippets.

View zellyn's full-sized avatar

Zellyn Hunter zellyn

View GitHub Profile
@zellyn
zellyn / crdts-category-theory.md
Created September 3, 2024 20:53
Discussion with Claude about CRDTs and category theory

💬 Is a CvRDT basically a semigro...

human (Sep 3, 2024, 01:35 PM)

Is a CvRDT basically a semigroup?

assistant (Sep 3, 2024, 01:35 PM)

That's an insightful question that touches on the intersection of distributed systems and abstract algebra. Let's break this down:

@zellyn
zellyn / linear-types-claude-chat.md
Last active February 21, 2025 14:04
Chat with Claude about Linear Types

Understanding Linear Types: A Conceptual Explanation

human (Sep 3, 2024, 04:36 PM)

Can you ELI5 Linear Types? I'm particularly interested in:

  • a brief overview, detailed enough that I can "grok" them
  • examples of languages that have successfully implemented them and gained some real-world usage (if any)
  • how they might be incorporated into an otherwise simple language like Go or Hare

My current difficulty level is that I have a good conceptual overview-level understanding of Rust lifetimes, but haven't used them in anger. I deeply get the need, though: a C++ function that doesn't have a comment specifying what happens to ownership of the arguments is terrifying 🙂

@zellyn
zellyn / conversation.md
Created August 26, 2024 19:58
Conversation with Claude about terminating processes in the terminal. Converted to markdown using Simon Willison's excellent tool: https://observablehq.com/@simonw/convert-claude-json-to-markdown

Terminating Processes in the Terminal: Ctrl-C vs Ctrl-\

human (Aug 26, 2024, 03:54 PM)

When in my terminal, I've noticed that ctrl-\ seems to often work when ctrl-c won't. I used to use ctrl-z and then kill %+, but ctrl-\ appears to work in the same places that ctrl-z does. Can you explain to me what's going on? Why do they differ in when they work, and what signals are actually getting sent?

assistant (Aug 26, 2024, 03:54 PM)

You've made an astute observation about different ways to terminate processes in a Unix-like terminal. Let's break down what's happening with each of these commands and signals:

@zellyn
zellyn / gist:abcba33aeb1161923753f65780b620e1
Created July 12, 2023 12:33
bundlewrap fails to add a lock
bundlepi🐚 ~/gh/bundlepi main *+ bw run lenovo id
› lenovo uid=0(root) gid=0(root) groups=0(root)
i ╭────────┬─────────────┬────────╮
i │ node │ return code │ time │
i ├────────┼─────────────┼────────┤
i │ lenovo │ 0 │ 0.219s │
i ╰────────┴─────────────┴────────╯
bundlepi🐚 ~/gh/bundlepi main *+ bw -d lock add lenovo
[2023-07-12T08:31:19.257140] [DEBUG] invocation: /Users/zellyn/gh/bundlepi/.hermit/python/bin/bw -d lock add lenovo
[2023-07-12T08:31:19.327744] [DEBUG] node lenovo gets its dummy attribute from: default
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zellyn
zellyn / clear the scrollback on MacOS
Created March 9, 2017 14:10
My watchloop script, and helper functions
alias csb="clear && printf '\e[3J'"
rm -rf OpenEmulator-zellyn
git clone https://github.com/zellyn/OpenEmulator-OSX.git OpenEmulator-zellyn
cd OpenEmulator-zellyn
git checkout iie
git submodule update --init --recursive
open OpenEmulator.xcodeproj
package main
import (
"crypto/cipher"
"crypto/des"
"encoding/binary"
"fmt"
)
var des3 cipher.Block
* Starting development
git clone [email protected]:zellyn/OpenEmulator-OSX.git
git clone https://github.com/OpenEmulatorProject/OpenEmulator-OSX.git
cd OpenEmulator-OSX
git submodule init
git submodule update
# Cloning into '/Users/zellyn/gh/OpenEmulator-OSX/modules/libemulation'...
# Fetched in submodule path 'modules/libemulation', but it did not contain 51bf1c4aa9fe689bb895a723cf0f1e3f0b8d2741. Direct fetching of that commit failed.
cd modules/libemulation
I cobbled together a (unix-specific, syscall-using) solution based on the
stack overflow answer to the same question in python, and a previous post
on this list. References inline.
Note: this seems to work, but I haven't taken the time to really understand
what I'm doing, and I welcome any suggestions or fixes.
// https://groups.google.com/d/msg/golang-nuts/8o9fxPaeFu8/uSFYfobL5EgJ
// http://go.pastie.org/813153