Skip to content

Instantly share code, notes, and snippets.

View jolby's full-sized avatar

Joel Boehland jolby

View GitHub Profile
@ap29600
ap29600 / primer.txt
Created June 26, 2025 21:28
a couple notes on the codebase of growler/k
not yet described in this note: memory management, parsing, bytecode, printing
C types
[UW] [48]byte unsigned
[GHIL] [1248]byte int
C 1-byte char
S string
F 8-byte double
A generic value
A[1234] A (*f)(A x[, A y[, A z[, ...]]])
@justin2004
justin2004 / a.apl
Last active August 25, 2025 15:28
numpy broadcasting in APL
⎕IO←0
m←2 3 4 3⍴⍳72
⍝ the goal is to reproduce this numpy broadcasting behavior in APL
⍝ m/m.sum(axis=0, keepdims=True)
normalize_and_keepdims←{⍵÷(⍴⍵)⍴(⍺⌷⍴⍵)/[(0⌈⍺-1)]+/[⍺]⍵}
0 normalize_and_keepdims m
0 0.02631578947 0.05
@rodydavis
rodydavis / main.dart
Last active November 29, 2025 03:02
SQLite CRDT + Session Extension
import 'dart:ffi';
import 'dart:io';
import 'dart:typed_data';
import 'package:sqlite3/sqlite3.dart';
import 'package:sqlite3/src/ffi/implementation.dart';
void main() {
final lib = DynamicLibrary.open('cr-sqlite/core/dist/sqlite3');
final sqlite3 = FfiSqlite3(lib);
@dbreunig
dbreunig / jekyll_glossary_generator.py
Last active May 11, 2025 23:10
A script to generate a glossary of key terms from your Jekyll posts. We're using DSPy to handle LLM interactions; it helps with boilerplate prompt context and parsing responses into Pydantic objects. To run this, put this script in a folder named 'scripts' (or whatever) in your Jekyll site directory. Then plug in your Anthropic API key (or point…
from pathlib import Path
import re
import dspy
from typing import TypedDict, List
import yaml
# Set up DSPy and the LM
lm = dspy.LM('anthropic/claude-3-5-haiku-latest', api_key='YOUR_API_KEY')
dspy.configure(lm=lm)
  1. Every atomic object has a timeline (TL) of writes:

    • A write is either a store or a read-modify-write (RMW): it read latest write & pushed new one.
    • A write is either tagged Relaxed, Release, or SeqCst.
    • A read observes some write on the timeline:
      • On the same thread, future reads can't go backwards on the timeline.
      • A read is either tagged Relaxed, Acquire, or SeqCst.
      • RMWs can also be tagged Acquire (or AcqRel). If so, the Acquire refers to the "read" portion of "RMW".
  2. Each thread has its own view of the world:

  • Shared write timelines but each thread could be reading at different points.
@emilyliu7321
emilyliu7321 / bluesky-comments.tsx
Created November 25, 2024 05:39
Integrate Bluesky replies as your blog's comment section
"use client";
/* eslint-disable @next/next/no-img-element */
import Link from "next/link";
import { useState, useEffect } from 'react';
import {
AppBskyFeedDefs,
AppBskyFeedPost,
type AppBskyFeedGetPostThread,
} from "@atproto/api";
@SequentialDesign
SequentialDesign / install lem.txt
Created November 11, 2024 10:51
how to install lem on linux (garuda (arch))
installing lem
go here and click on the right download. mine was under AMD64 and across from linux
https://www.sbcl.org/platform-table.html
cd to the folder you downloaded it to
cd Downloads/
decompress the file you downloaded. it has the sbcl binary
bzip2 -cd sbcl-2.4.10-x86-64-linux-binary.tar.bz2 | tar xvf -
@debasishg
debasishg / dod.md
Last active November 27, 2025 08:05
Data oriented design, hardware awareness, cache awareness in data structures & algorithms

Performance Engineering, Hardware and cache awareness with algorithm and data structures

  1. Parallel Computing Course - Stanford CS149, Fall 2023
  2. Performance-Aware Programming Series by Casey Muratori
  3. Algorithms for Modern Hardware
  4. Computer Systems: A Programmer's Perspective, 3/E - by Randal E. Bryant and David R. O'Hallaron, Carnegie Mellon University
  5. Performance Engineering Of Software Systems - am MITOCW course
  6. Parallel Programming 2020 by NHR@FAU
  7. Cpu Caches and Why You Care - by Scott Meyers
  8. [Optimizing a ring buffer for throughput](https://rig
@wiseman
wiseman / example.md
Last active August 21, 2024 02:55
Get store hours from images
$ python hours.py image.jpg
{
  "day_hours": [
    {
      "day": "Mon - Fri",
      "hours": "7 AM - 5 PM"
    },
    {
 "day": "Saturday",

Private Mode for In-Band Window Resize Notifications

Terminal emulators typically receive window resize events by installing a signal handler for the SIGWINCH signal. Handling of these signals can create challenges due to their inherently racy properties. Resize events must be synchronized with other application state in a safe manner.

Standard control sequences exist to query the current terminal size from the terminal and receive an in-band control sequence with the window size. However, this system requires polling - which is not ideal. Usually, SIGWINCH handling