Skip to content

Instantly share code, notes, and snippets.

View HerbCaudill's full-sized avatar

Herb Caudill HerbCaudill

View GitHub Profile
@HerbCaudill
HerbCaudill / effect-schema-walkthrough.md
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
HerbCaudill / automerge-auth.md
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?

Objectives

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

Desiderata

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

Demos:

  • taco-chat
  • todos
  • XDev

Overview

A working implementation of the principles Martin presented

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

Local-first resources

Background

Getting started

@HerbCaudill
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
HerbCaudill / machine.js
Created October 4, 2023 12:31
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@HerbCaudill
HerbCaudill / automerge-repo message types.md
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
HerbCaudill / localfirst-auth-provider.md
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.

Configuration

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

import { LocalFirstAuthProvider, createUser, createDevice } from 'automerge-repo-auth-localfirstauth'
@HerbCaudill
HerbCaudill / transcript.md
Last active October 1, 2024 11:20
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. https://www.youtube.com/watch?v=Cym4TZwTCNU

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