Skip to content

Instantly share code, notes, and snippets.

@dabit3
dabit3 / pi_tutorial.md
Last active November 4, 2026 08:27
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

Understanding the UTXO Model: A Guide for Bitcoin Cash Developers

Introduction

Welcome to Bitcoin Cash development! If you're coming from other blockchain platforms or traditional web development, the UTXO (Unspent Transaction Output) model might be a new concept to grasp. This guide will break down how UTXOs work in Bitcoin Cash and provide insights on how to design effective smart contracts using this model.

What is a UTXO?

In Bitcoin Cash, think of UTXOs as individual digital bills in your wallet. Unlike account-based blockchains (like Ethereum) that track a single balance for each address, Bitcoin Cash tracks specific "bills" of cryptocurrency.

@joshenders
joshenders / swap.md
Last active October 31, 2026 19:29
Stop making swap partitions

Stop making swap partitions—use swap files instead!

Swap files have had the same performance characteristics as swap partitions for more than 20 years and yet, linux distributions continue to encourage the use of swap partitions during install.

Swap files are easier to use/add/remove/modify/extend after installation. They're better in every way––use swap files!

  1. Create and format the swap file.
mkswap --size 4G --file /swapfile
@ItsCuzzo
ItsCuzzo / disassembler.py
Created December 24, 2022 06:08
EVM Bytecode Disassembler
opcodes = {
0x00: 'STOP',
0x01: 'ADD',
0x02: 'MUL',
0x03: 'SUB',
0x04: 'DIV',
0x05: 'SDIV',
0x06: 'MOD',
0x07: 'SMOD',
0x08: 'ADDMOD',
0: ["close up human eye by alex grey | close up human eye by alex grey | large brain neurons by Zdzisław Beksiński | picnic by mario martinez art | Brain by Johfra Bosschart | Neurons by beeple | Neurons by alex grey"],
48: ["thumbs down vector art by johfra bosschart"],
63: ["racism photography oil painting | racist illustrated in art by moebius"],
95: ["thumbs up vector art by beeple"],
114: ["pride flag by moebius | pride flag by beeple | pride flag | rainbow flag"],
144: ["metal heart by beeple, Ben Tolman and Moebius"],
184: ["human being by beeple, Ben Tolman and Moebius | people by beeple, Ben Tolman and Moebius | person by beeple, Ben Tolman and Moebius"],
202: ["electrical grid by johfra bosschart | electric power station by moebius"],
260: ["matrix code wallpaper | computer keyboard | programming | supercomputer"],
313: ["thumbs up vector art by moebius"],
@dabit3
dabit3 / ceramic_identity_playground.js
Last active February 26, 2022 17:12
Playing around with Ceramic identity and self.id
import { useState } from 'react'
import Head from 'next/head'
import styles from '../styles/Home.module.css'
import { CeramicClient } from '@ceramicnetwork/http-client'
import { DID } from 'dids'
import { ThreeIdConnect } from '@3id/connect'
const SID = require('@self.id/web')
const { EthereumAuthProvider, SelfID, WebClient } = SID
@gorgos
gorgos / MultiSwap.sol
Created August 22, 2021 11:04
Example for how to swap multiple tokens in one on Ropsten
// SPDX-License-Identifier: MIT
pragma solidity =0.7.6;
pragma abicoder v2;
import "https://github.com/Uniswap/uniswap-v3-periphery/blob/main/contracts/interfaces/ISwapRouter.sol";
import "https://github.com/Uniswap/uniswap-v3-periphery/blob/main/contracts/interfaces/IQuoter.sol";
import {IERC20, SafeERC20} from "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4-solc-0.7/contracts/token/ERC20/SafeERC20.sol";
interface IUniswapRouter is ISwapRouter {
@Phate6660
Phate6660 / rust recommendations and alternatives.md
Last active May 29, 2024 12:35
My growing list of Rust programs to use.
@christroutner
christroutner / js-buf.md
Last active September 8, 2020 16:58
Working with Buffers and Hex Strings

Working with JavaScript Buffers, Hex, and Strings

// Start with a normal base-10 number.
const numNum = 123; // 7B in hex
console.log(`numNum: `, numNum);
// numNum:  123

// Convert the Number to a String
@asimjalis
asimjalis / fast-clojure-hello-world-using-graal-vm.md
Last active March 14, 2019 12:42
How To Speed Up Clojure Hello World 100x Using GraalVM

How To Speed Up Clojure Hello World 100x Using GraalVM

Performance

Version Command Time (seconds)
Java time java -jar target/fastclj-1.0-standalone.jar 1.354
GraalVM time ./fastclj-1.0-standalone 0.014

Details