Skip to content

Instantly share code, notes, and snippets.

@PaulRBerg
PaulRBerg / subgraph.yaml
Created October 31, 2025 11:40
Sablier Lockup Graph manifest generated using commit hash d4eb56a (https://github.com/sablier-labs/indexers)
dataSources:
- context:
alias:
data: "LD"
type: "String"
chainId:
data: "1"
type: "BigInt"
version:
data: "v1.0"
#!/usr/bin/env python3
"""
Flatten @file references in Markdown documents.
See https://github.com/openai/agents.md/issues/11#issuecomment-3366858928
"""
from __future__ import annotations
import argparse
import sys
@PaulRBerg
PaulRBerg / foundry_copy_abi.sh
Created September 5, 2025 19:34
Shell function to copy an ABI from Foundry output directory
# Copy the ABI of a contract from the out directory to the clipboard
# Example: foundry_copy_abi SablierLockup out-optimized
function foundry_copy_abi() {
if [ -z "$1" ]; then
echo "Please provide a contract name"
echo "Usage: foundry_copy_abi <ContractName> [outDir]"
return 1
fi
local contract_name=$1
@PaulRBerg
PaulRBerg / update-changelog.md
Last active August 25, 2025 11:33
Claude Code command for updating a CHANGELOG.md file according to Common Changelog format

Update Changelog

Update the CHANGELOG.md file with all changes since the last version release.

Process

  1. Review git history - Examine commits since the last tagged release
  2. Follow format - Use Common Changelog specification
  3. Check version - Get current version from package.json
  4. Bump version - If unchanged since last release, increment per Semantic Versioning rules:
@PaulRBerg
PaulRBerg / cursor-rules.txt
Last active June 30, 2025 06:21
PRB's global cursor rules
You are a senior programmer with a preference for clean programming and design patterns.
- Be terse
- Suggest solutions that I didn't think about—anticipate my needs
- Treat me as an expert
- Be accurate and thorough
- Give the answer immediately. Provide detailed explanations and restate my query in your own words if necessary after giving the answer
- Consider new technologies and contrarian ideas, not just the conventional wisdom
- You may use high levels of speculation or prediction, just flag it for me
@PaulRBerg
PaulRBerg / setup-duti.sh
Last active June 24, 2025 13:06
Script to set Cursor as the default editor for all development file extensions on macOS using duti: https://github.com/moretension/duti/
#!/usr/bin/env zsh
# Set up the default application for file types.
# Strict mode: https://gist.github.com/vncsna/64825d5609c146e80de8b1fd623011ca
set -euo pipefail
# grab Cursor's bundle-ID
BUNDLE_ID=$(osascript -e 'id of app "Cursor"')
# Extensions in alphabetical order
@PaulRBerg
PaulRBerg / createNetworks.ts
Created May 14, 2025 18:29
Prototype of a script that generates the networks by using the `extractContract` function from The Graph manifest code
import { type Sablier, Version, getChainName, queries, releasesByProtocol } from "@sablier/deployments";
import supportedChains from "@src/chains";
import type { Config } from "@src/envio-config/types";
import { extractContract } from "@src/graph-manifest/sources/creators";
import { sanitizeName } from "@src/helpers";
import type { ContractMap, IndexedProtocol } from "@src/types";
import logger, { logAndThrow, thrower } from "@src/winston";
import _ from "lodash";
export function createNetworks2(
@PaulRBerg
PaulRBerg / .duti
Created May 8, 2025 12:33
PRB's ~/.duti file, the bundle ID is for Cursor IDE
com.todesktop.230313mzl4w4u92 .css all
com.todesktop.230313mzl4w4u92 .gql all
com.todesktop.230313mzl4w4u92 .graphql all
com.todesktop.230313mzl4w4u92 .js all
com.todesktop.230313mzl4w4u92 .jsx all
com.todesktop.230313mzl4w4u92 .json all
com.todesktop.230313mzl4w4u92 .jsonc all
com.todesktop.230313mzl4w4u92 .just all
com.todesktop.230313mzl4w4u92 .lock all
com.todesktop.230313mzl4w4u92 .mdc all
@PaulRBerg
PaulRBerg / ERC20.bindings.ts
Created May 7, 2025 10:24
The Graph bindings for ERC20
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
import {
ethereum,
JSONValue,
TypedMap,
Entity,
Bytes,
Address,
BigInt,
@PaulRBerg
PaulRBerg / global.gitignore
Last active May 1, 2025 09:49
Global .gitignore for macOS
# Dotfiles
.extra
# Environment files
.env
.env.deployment
.env.staging
.env.production
.envrc