Skip to content

Instantly share code, notes, and snippets.

@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

Gas Fee Models on EVM Chains

Chain Type Min Tx Gas Model Explanation
Arbitrum Optimistic Rollup 35-70k Multifunctional gas limit Bake L1 data fee into L2 gas limit
BNB Chain Sidechain 21k EVM Same as vanilla EVM
Gnosis Sidechain 21k EVM Same as vanilla EVM
OP Stack Optimistic Rollup 21k Two-dimensional fees Explicit L2 execution fee and implicit L1 DA fee
Polygon Sidechain 21k EVM Same as vanilla EVM