Skip to content

Instantly share code, notes, and snippets.

@PaulRBerg
PaulRBerg / cursor-rules.txt
Created June 12, 2025 13:47
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
Created June 6, 2025 20:23
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
EXTENSIONS=(
@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
import { useMemo } from "react";
import type { Sablier } from "@sablier/deployments";
import { generateDeploymentTable } from "../../helpers";
import GFMContent from "../atoms/GFMContent";
interface DeploymentTableProps {
deployment: Sablier.Deployment;
protocol: Sablier.Protocol;
version: Sablier.Version;
}
{
"aichat.insertselectionintochat": "off",
"aichat.newchataction": "off"
}
@PaulRBerg
PaulRBerg / git-done.ini
Created March 19, 2025 13:55
git done helper
[alias]
# Go to the main branch, pull the latest changes, and delete the current branch.
done = "!f() { BRANCH=$(git branch --show-current); git checkout main && git pull && git branch -d $BRANCH; }; f"
@PaulRBerg
PaulRBerg / .gitignore
Created October 21, 2024 09:35
My global .gitignore file
# Dotfiles
.extra
# Environment files
.env
.env.deployment
.envrc
# Files that might appear on external disks
.Spotlight-V100