Skip to content

Instantly share code, notes, and snippets.

View darvid's full-sized avatar
πŸŒƒ
πŸ§‘β€πŸš€πŸ’ŠπŸš€

David Gidwani darvid

πŸŒƒ
πŸ§‘β€πŸš€πŸ’ŠπŸš€
View GitHub Profile
@dabit3
dabit3 / pi_tutorial.md
Last active June 27, 2026 02:43
How to Build a Custom Agent Framework with PI: The Agent Stack Powering OpenClaw

PI is a TypeScript toolkit for building AI agents. It's a monorepo of packages that layer on top of each other: pi-ai handles LLM communication across providers, pi-agent-core adds the agent loop with tool calling, pi-coding-agent gives you a full coding agent with built-in tools, session persistence, and extensibility, and pi-tui provides a terminal UI for building CLI interfaces.

These are the same packages that power OpenClaw. This guide walks through each layer, progressively building up to a fully featured coding assistant with a terminal UI, session persistence, and custom tools.

By understanding how to compose these layers, you can build production-grade agentic software on your own terms, without being locked into a specific abstraction.

Pi was created by @badlogicgames. This is a great writeup from him that explains some of the design decisions made when creating it.

The stack

"""
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
@awni
awni / open_code_mlx.md
Last active June 30, 2026 14:36
OpenCode with MLX

The following guide will show you how to connect a local model served with MLX to OpenCode for local coding.

1. Install OpenCode

curl -fsSL https://opencode.ai/install | bash

2. Install mlx-lm

@rmtbb
rmtbb / listgitfiles.sh
Created September 3, 2025 22:23
List Git Files - List raw GitHub URLs for files in a repo or subfolder, filtered by extensions
#!/usr/bin/env bash
# listgitfiles.sh
# List raw GitHub URLs for files in a repo or subfolder, filtered by extensions.
# Full README is embedded and printed only with: listgitfiles.sh -h|--help
set -euo pipefail
# ------------------------- Minimal Help (usage) -------------------------
print_min_help() {
cat <<'USAGE'
@danhollick
danhollick / tailwind-css-v4.mdc
Last active February 19, 2026 08:35
Cursor rules file for Tailwind CSS v4.0
// Update globs depending on your framework
---
name: tailwind_v4
description: Guide for using Tailwind CSS v4 instead of v3.x
globs: ["**/*.{js,ts,jsx,tsx,mdx,css}"]
tags:
- tailwind
- css
---
@aaronvg
aaronvg / .cursorrules
Created November 26, 2024 02:06
CursorRules for BAML
<Overview>
BAML (Basically, A Made-Up Language) is a domain-specific language for building LLM prompts as functions.
You can build an agentic workflow with BAML.
</Overview>
<Schema>
// Define output schemas using classes
class MyObject {
// Optional string fields use ?
// @description is optional, but if you include it, it goes after the field.
@clouedoc
clouedoc / Migrating from Arc to Zen Browser.md
Created September 20, 2024 08:57
Migrating from Arc to Zen Browser

A guide to leaving Arc for Zen Browser

The problem with Arc is that it doesn't allow exporting data (history, bookmarks) to a file natively.

One way to do this is to use a script but that only exports Bookmarks and not the history.

I don't really use the bookmarks feature that much; what I really liked about Arc was that it was really easy to navigate to somewhere I already visited.

So, if you're like me, follow this guide and you'll be able to import your browsing history into Zen browser!

@dvins
dvins / pnpm-peerdependency-override.md
Last active May 4, 2026 11:05
Overriding A Peer Dependency With PNPM

Overriding A Peer Dependency With PNPM

This guide explains how to override peer dependencies in a PNPM monorepo by using a custom hook. It provides a step-by-step solution to ensure consistent versioning across packages that rely on different versions of the same dependency.

Background

When working with a monorepo a challenges arises if you need to use multiple versions of the same package.

Nominally, this can be solved through package aliases and overides. However, a particularly sticky situation is when downstream packages rely peer dependencies of uptstream packages you need two or more versions of.

@swayducky
swayducky / cursor
Last active February 20, 2026 18:35
This fixes using "cursor" command in WSL
#!/usr/bin/env sh
# LATEST VERSION OF THIS SCRIPT: https://gist.github.com/swayducky/8ba8f2db156c7f445d562cdc12c0ddb4
# FORKED FROM: https://gist.github.com/ddwang/0046da801bcb29d241869d37ad719394
# 1) No longer has a hard-coded COMMIT
# 2) Auto-symlinks a "code" script to avoid wslCode.sh breaking
# HOW TO INSTALL:
# 1) Remove "c:\Users\<USER_NAME>\AppData\Local\Programs\cursor\resources\app\bin" from Windows Environment Settings
# 2) Modify this script with your Windows <USER_NAME> (NOT your WSL username) in the VSCODE_PATH variable
@a-churchill
a-churchill / README.md
Last active August 23, 2025 00:13
Documentation Search in Sanity

Documentation Search in Sanity

This Gist contains a sample query for searching text content in GROQ, Sanity's custom query language. We use something similar to this for Causal's documentation site. See more on our blog!