Skip to content

Instantly share code, notes, and snippets.

#include <metal_stdlib>
#include <SwiftUI/SwiftUI.h>
using namespace metal;
[[ stitchable ]] half4 simpledistort(float2 pos, SwiftUI::Layer l, float4 boundingRect, float progress, float distortion) {
float2 size = boundingRect.zw;
float2 uv = pos / size;
float2 center = float2(0.5, 0.5);
float2 delta = uv - center;
@karpathy
karpathy / microgpt.py
Last active February 24, 2026 10:05
microgpt
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@antirez
antirez / codex_skill.md
Last active February 20, 2026 10:16
CLAUDE_CODEX_SKILL.md
name description disable-model-invocation
codex
Use OpenAI Codex CLI for complex debugging, code analysis, or when stuck on difficult problems. Invokes Codex with a file-based question/answer pattern.
true

Using Codex for Complex Debugging

When you encounter a difficult problem that would benefit from a second perspective or deep analysis, use Codex via the file-based pattern.

Claude Agent SDK Technical Specification

Version: 1.0.0 Protocol Version: 2024-11-05 Last Updated: 2026-01-10

Table of Contents

  1. Overview
  2. Architecture
@tkersey
tkersey / 201X-2023.md
Created January 5, 2026 20:49
Previous bookmarks

2023

December

Boost your Metal app’s performance by upscaling lower-resolution content to save GPU time.

The MetalFX framework integrates with Metal to upscale a relatively low-resolution image to a higher output resolution in less time than it takes to render directly to the output resolution. >

@banteg
banteg / readme.md
Last active February 11, 2026 14:08
uninstall beads

Beads Uninstall Script

A comprehensive uninstall/cleanup script for Beads (bd) that removes all traces of the tool from a system.

Usage

./scripts/uninstall.sh            # dry-run (scan $HOME)
./scripts/uninstall.sh --apply    # perform cleanup
./scripts/uninstall.sh --root DIR --apply
@dimitribouniol
dimitribouniol / main.swift
Created December 22, 2025 11:58
ISO8601 Date Formatter Benchmarks
import AppKit
@main
struct DateFormatters {
static func main() {
let iterations = 100_000
let startInterval: TimeInterval = 780_000_000
time("Create Date Baseline") {
var results: [Date] = []
@kylehowells
kylehowells / open_clip_embedding_test.py
Created October 27, 2025 06:15
Demo of using the OpenAI CLIP and SigLIP 2 models to do text and image embedding search.
"""
Simple demo showing how to generate and compare text and image embeddings.
Uses CLIP (openai/clip-vit-base-patch16) model for both text and image embeddings.
"""
import torch
from PIL import Image
from transformers import CLIPProcessor, CLIPModel
import numpy as np
import torch.nn.functional as F
@agokrani
agokrani / claude-code-prompt.txt
Last active February 5, 2026 12:37
Claude Code System Prompt
'system':
[
{
'type': 'text',
'text': "You are Claude Code, Anthropic's official CLI for Claude.",
'cache_control': {'type': 'ephemeral'}
},
{
'type': 'text',
'text': 'You are an interactive CLI tool that helps users with software engineering tasks.
#!/usr/bin/env bun
"use strict";
const fs = require("fs");
const { execSync } = require("child_process");
const path = require("path");
// ANSI color constants
const c = {
cy: '\033[36m', // cyan