Skip to content

Instantly share code, notes, and snippets.

@pfefar
pfefar / building-sync-systems.md
Created October 25, 2025 03:18 — forked from pesterhazy/building-sync-systems.md
Building an offline realtime sync engine

So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.

Overview articles

@pfefar
pfefar / v8.md
Created June 7, 2025 11:22 — forked from kevincennis/v8.md
V8 Installation and d8 shell usage

Installing V8 on a Mac

Prerequisites

  • Install Xcode (Avaliable on the Mac App Store)
  • Install Xcode Command Line Tools (Preferences > Downloads)
  • Install depot_tools
    • $ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    • $ nano ~/.zshrc
    • Add path=('/path/to/depot_tools' $path)
@pfefar
pfefar / matmul.zig
Created May 20, 2025 07:47 — forked from snowclipsed/matmul.zig
Highly Performant Matrix Multiplication in Zig (and Grid Search to find the most optimal parameters!)
// To run tests, do :
// zig test -OReleaseSafe -Dcpu=native -Dtarget=native matmul.zig
// To run main, do :
// zig build-exe -OReleaseFast -Dcpu=native -Dtarget=native matmul.zig
// ./matmul
//
// ███╗ ███╗ █████╗ ████████╗███╗ ███╗██╗ ██╗██╗ ░░░░░░███████╗██╗ ██████╗
// ████╗ ████║██╔══██╗╚══██╔══╝████╗ ████║██║ ██║██║ ░░░░░░╚══███╔╝██║██╔════╝
@pfefar
pfefar / fast_tokenizer.zig
Created May 20, 2025 07:46 — forked from snowclipsed/fast_tokenizer.zig
Fast Tokenizer in Zig
const std = @import("std");
const mem = std.mem;
const json = std.json;
const Allocator = mem.Allocator;
const Thread = std.Thread;
// Constants
pub const MIN_PARALLEL_TEXT_SIZE = 10_000;
pub const DEFAULT_CHUNK_SIZE = 1024 * 64;
pub const MAX_THREADS = 8;
@pfefar
pfefar / check_convex.py
Created January 3, 2025 12:42 — forked from mblondel/check_convex.py
A small script to get numerical evidence that a function is convex
# Authors: Mathieu Blondel, Vlad Niculae
# License: BSD 3 clause
import numpy as np
def _gen_pairs(gen, max_iter, max_inner, random_state, verbose):
rng = np.random.RandomState(random_state)
# if tuple, interpret as randn
@pfefar
pfefar / normcore-llm.md
Created August 4, 2024 04:34 — forked from veekaybee/normcore-llm.md
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models