Skip to content

Instantly share code, notes, and snippets.

View HerbCaudill's full-sized avatar

Herb Caudill HerbCaudill

View GitHub Profile
HerbCaudill /
Last active June 10, 2024 16:00
effect/schema walkthrough
md hello-effect-schema
cd hello-effect-schema
pnpm init
pnpm i typescript @effect/schema effect fast-check vitest

Make tsconfig.json:

HerbCaudill /
Last active May 24, 2024 15:18
automerge-auth strawman

Suppose we wanted to build automerge-auth, a successor to localfirst/auth. What would that look like?


Develop a recommended approach to authentication, authorization, and end-to-end encryption in the Automerge ecosystem.


HerbCaudill /
Last active May 2, 2024 00:45
auth@next notes
type Group = {
  id: Uuid
  members: Group[]
  keys: KeysetWithSecrets
HerbCaudill /
Last active May 1, 2024 14:43


  • taco-chat
  • todos
  • XDev


A working implementation of the principles Martin presented

HerbCaudill /
Last active February 2, 2024 16:57
Resources for getting started with local-first software development

Local-first resources


Getting started

HerbCaudill / flaky.js
Last active December 21, 2023 20:13
Flaky test tooling
import { exec as _exec } from 'child_process'
import fs from 'fs'
import path from 'path'
import { fileURLToPath } from 'url'
import { promisify } from 'util'
const exec = promisify(_exec)
// ensure outputDir exists
const __dirname = fileURLToPath(new URL('.', import.meta.url))
HerbCaudill / machine.js
Created October 4, 2023 12:31
Generated by XState Viz:
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
HerbCaudill / automerge-repo message
Last active June 10, 2023 11:32
automerge-repo message types

Proposed message types

type SyncMessage = {
  type: 'SYNC_MESSAGE'
  senderId: PeerId
  recipientId: PeerId
  documentId: DocumentId
  payload: Uint8Array // Automerge binary sync message
HerbCaudill /
Last active December 26, 2023 12:24
automerge-repo auth spec

localfirst/auth provider for Automerge Repo

This is pseudo-documentation for a hypothetical auth provider for Automerge Repo built around @localfirst/auth.


A LocalFirstAuthProvider is configured with information about the local user and device.

import { LocalFirstAuthProvider, createUser, createDevice } from 'automerge-repo-auth-localfirstauth'
HerbCaudill /
Last active January 17, 2023 05:13
Cleaned-up transcript of Rich Hickey's talk "Deconstructing the Database"

This is a talk I keep referring back to, and I wanted to have it in text form. I grabbed the raw machine-generated transcript from YouTube and used GPT-3 to help me turn it into well-punctuated sentences and paragraphs. I had to do some additional cleanup, but it got me most of the way there - my first experience getting AI to help me out with a real task!

Deconstructing the Database

Rich Hickey, author of Clojure, and designer of Datomic presents a new way to look at database architectures in this talk from JaxConf 2012.

The title of this talk is "Deconstructing the Database".