Skip to content

Instantly share code, notes, and snippets.

View just-be-dev's full-sized avatar
:shipit:

Justin Bennett just-be-dev

:shipit:
View GitHub Profile
@ghuntley
ghuntley / jiti-kernel-diagram.md
Last active October 10, 2026 21:51
JITI kernel, OpenAI generations, and recovery ASCII diagrams

JITI: a CS50-style tour of a repairable Lisp kernel

The project keeps a running Lisp world alive while an outside controller asks an OpenAI model what to try next.

1. The big picture

                         "What should we try?"
                                  |
 v

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

@schacon
schacon / better-git-branch.sh
Created January 13, 2024 18:41
Better Git Branch output
#!/bin/bash
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NO_COLOR='\033[0m'
BLUE='\033[0;34m'
YELLOW='\033[0;33m'
NO_COLOR='\033[0m'
@cowboyd
cowboyd / use-websocket.ts
Created October 31, 2023 15:35
Effection WebSocket Resource
import { type Stream, type Operation, action, each, once, resource, spawn, createChannel, createSignal } from "effection";
export interface WebSocketHandle extends Stream<MessageEvent, CloseEvent> {
send(value: string): Operation<void>;
close(code?: number, reason?: string): Operation<void>;
}
export function useWebSocket(url: string | URL, protocols?: string | string[]) {
return resource<WebSocketHandle>(function*(provide) {
let input = createChannel<string, {code?: number; reason?: string}>();
@nhrones
nhrones / Hot-Example.ts
Last active October 24, 2024 15:06
Hot Browser Refresh
//======================================
// server.ts
//======================================
import { inject } from './injector.ts' // SEE BELOW
import { registerWatcher } from './watcher.ts'
// in your server request handler ...
@ichizok
ichizok / deno.patch
Last active August 1, 2024 14:53
for Solaris/illumos
diff --git a/.cargo/config.toml b/.cargo/config.toml
index f5b2f124b..6cd093e8e 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -23,6 +23,9 @@ rustflags = [
"link-args=-fuse-ld=lld -weak_framework Metal -weak_framework MetalPerformanceShaders -weak_framework QuartzCore -weak_framework CoreGraphics",
]
+[target.x86_64-unknown-illumos]
+rustflags = ["-C", "link-args=-latomic -lffi -lstdc++"]
(defn point-outside-circle [c r p]
(if (< (vec2/dist c p) r)
(vec2/scale (vec2/normalize (vec2/- p c)) r)
p))
(defn circle-tangent-point [c r b dir]
(let [B (point-outside-circle c r b)
cB (vec2/dist c B)
S (vec2/scale (vec2/normalize (vec2/- B c)) r)
@ityonemo
ityonemo / test.md
Last active October 10, 2026 08:32
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@Rich-Harris
Rich-Harris / http-apis.md
Last active November 3, 2022 09:02
Next-gen Node HTTP APIs

I saw this poll on Twitter earlier and was surprised at the result, which at the time of writing overwhelmingly favours option 1:

Screen Shot 2020-09-10 at 10 19 22 AM

I've always been of the opinion that the (req, res, next) => {} API is the worst of all possible worlds, so one of two things is happening:

  • I'm an idiot with bad opinions (very possibly!)
  • People like familiarity
import {useState, useCallback, useRef} from 'react'
// Hook
const useHover = <T extends HTMLElement>(): [
(node?: T | null) => void,
boolean,
] => {
const [value, setValue] = useState(false)
// Wrap in useCallback so we can use in dependencies below