Skip to content

Instantly share code, notes, and snippets.

@jawond
jawond / comment.ts
Created May 5, 2026 11:59 — forked from badlogic/comment.ts
pi comment extension
import { spawnSync } from "node:child_process";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import type { ExtensionAPI, SessionEntry } from "@mariozechner/pi-coding-agent";
import type { AssistantMessage } from "@mariozechner/pi-ai";
function getLastAssistantText(branch: SessionEntry[]): string | undefined {
for (let i = branch.length - 1; i >= 0; i--) {
const entry = branch[i];
#!/usr/bin/env bash
set -euo pipefail
# patch-claude-code.sh — Rebalance Claude Code prompts to fix corner-cutting behavior
#
# What this does:
# Patches the npm-installed @anthropic-ai/claude-code cli.js to rebalance
# system prompt instructions that cause the model to cut corners, simplify
# excessively, and defer complicated work.
#

Tweet Curator — Complete Replication Guide

A comprehensive, step-by-step guide to rebuild the Tweet Curator application from scratch. This app imports a Twitter/X archive, lets you curate tweets via a Tinder-style swipe interface, manages tags with AI assistance, schedules blog posts to Substack, and broadcasts short-form content to Bluesky, LinkedIn, Threads, and Instagram.


Table of Contents

  1. Architecture Overview
  2. Tech Stack & Dependencies
@jawond
jawond / microgpt.py
Created February 11, 2026 22:49 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and inference a GPT LLM in pure, dependency-free Python.
Differences from GPT-2 are minor: rmsnorm instead of layer norm, no biases, square ReLU instead of GeLU nonlinearity.
The contents of this file is everything algorithmically needed to train a GPT. Everything else is just efficiency.
Art project by @karpathy.
"""
import os # for os.path.exists
import math # for math.log, math.exp
import random # for random.seed, random.choices
@jawond
jawond / beads_uninstall.md
Created January 12, 2026 04:43 — forked from banteg/readme.md
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
@jawond
jawond / swagent-spec.md
Created September 30, 2025 21:27 — forked from steipete/swagent-spec.md
Working Promot for AI Agent Workshop at Swift Connnection 2025

Below is a clean, workshop‑ready guide for swagent, split into three parts as requested.


1) Docs — the exact contract (Responses API, tools, streaming, chaining)

Endpoints

  • Create/continue a response: POST https://api.openai.com/v1/responses Headers: Authorization: Bearer $OPENAI_API_KEY, Content-Type: application/json. ([OpenAI Platform][1])
The user application assumes any text you generate is Markdown and will convert it to html using a Markdown parser. The Markdown parser is CommonMark compliant and includes support for tables, tasklists, strikethrough, autolinking, and footers, in addition to other common elements. Always attempt to render properly formatted markdown.
- DO NOT attempt to use inline HTML as this interface does not support this. Any HTML you add will be stripped from the result. If you want to display HTML ALWAYS enclose this in a code fence.
- DO NOT attempt to layout text using lines, dashes, spaces or other characters outside of a code block. The font is not proportional and will appear poorly to the user.
- DO NOT use the `•` character. When building lists always use the '-', '+', or '*' to denote individual bullets.
- EXAMPLE 1
- DO NOT DO THIS
• item 1
• item 2
- DO THIS INSTEAD
# /// script
# dependencies = [
# "dspy",
# "rich"
# ]
# ///
import dspy
import os
import inspect
@jawond
jawond / opencode.json
Created August 4, 2025 02:29 — forked from steipete/opencode.json
How to configure opencode with Cerebras Qwen 3 Coder 480B (it's so fast!)
{
"$schema": "https://opencode.ai/config.json",
"model": "cerebras/qwen-3-coder-480b",
"provider": {
"cerebras": {
"api": "https://api.cerebras.ai/v1",
"npm": "@ai-sdk/openai-compatible",
"name": "Cerebras",
"env": [],
"options": {
@jawond
jawond / midi-brightness.py
Created July 28, 2025 05:25 — forked from lynaghk/midi-brightness.py
control macos brightness of monitor(s) via MIDI input
#!/usr/bin/env python3
# launch with `uv run`. https://docs.astral.sh/uv/
# uses https://github.com/waydabber/betterdisplay/ to control the monitors
# /// script
# dependencies = [
# "python-rtmidi==1.5.8",
# "requests==2.32.4",