Skip to content

Instantly share code, notes, and snippets.

View shunkakinoki's full-sized avatar
🍅
(๑✧∀✧๑)

Shun Kakinoki shunkakinoki

🍅
(๑✧∀✧๑)
View GitHub Profile

niacin

The basics.

Zero-configuration deployment + upgradable Ethereum smart contracts. Some people call this chainops (like devops).

# Deploy a contract TakeMarket.sol.
niacin deploy TakeMarket

Specs

CPU

  • AMD Ryzen 9 5950X AM4, 4.9 GHz, 16-Core

RAM

  • Crucial Ballistix 4 x 16GB 3600 MHz (DDR4)

Nvme

  • WD Black SN850X 4 TB M.2 2280
static async calcPreVerificationGas(
userOp: UserOperationType,
chainId: number,
entryPointContract: ethers.Contract,
overheads?: Partial<DefaultGasOverheadType>,
) {
const { defaultGasOverheads } = config;
const ov = { ...defaultGasOverheads, ...(overheads ?? {}) };
const p: UserOperationType = {
...userOp,
@liamzebedee
liamzebedee / gist:f37a2e0d6ad5b2207be103def495a1aa
Last active May 11, 2023 02:36
High-leverage skills for hackers
  • Terminal.
    • Master the Terminal.
    • Use zsh.
    • Show current git branch.
    • Reverse search your command history using Ctrl+R.
    • Quickly autocomplete commands by pressing up (again reverse search).
    • Delete+move quickly with cursor - use Alt+Left and Alt+Right to jump words. Alt+Del to delete a word.
  • Coding.
    • Use CoPilot and/or other coding AI.
  • Google things, ask ChatGPT for sample code, ask questions on StackOverflow and Twitter.
@kconner
kconner / macOS Internals.md
Last active June 18, 2024 10:28
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

  • arbitrum nova 0x1c5771e96C9d5524fb6e606f5B356d08C40Eb194
  • arbitrum 0xA7caC4207579A179c1069435d032ee0F9F150e5c
  • avax 0xbACEB8eC6b9355Dfc0269C18bac9d6E2Bdc29C4F
  • boba 0x2f686751b19a9d91cc3d57d90150bc767f050066
  • bsc 0xD75F5369724b513b497101fb15211160c1d96550
  • ethereum 0x044b75f554b886A065b9567891e45c79542d7357
  • fantom 0x3e603C14aF37EBdaD31709C4f848Fc6aD5BEc715
  • fuse 0x2f686751b19a9d91cc3d57d90150Bc767f050066
  • gnosis 0x145d82bCa93cCa2AE057D1c6f26245d1b9522E6F
  • moonbeam 0x1838b053E0223F05FB768fa79aA07Df3f0f27480
name: PlanetScale Migration
on:
pull_request:
types: [opened, synchronize]
paths:
- packages/shared/adapters/prisma/schema.prisma
env:
PLANETSCALE_ORG: flightcontrol
PLANETSCALE_DB: fc-production
@fiveoutofnine
fiveoutofnine / 1_example-glyphs.txt
Last active June 17, 2024 20:43
Quick snippets/tutorial on how to condense a font by selecting a subset of characters. First, create a `.txt` file with the characters (as unicode chars) you want included.
U+0039
U+003A
U+002F
U+0023
U+0050
U+0075
U+007A
U+006C
U+0065
U+0041
@AndrewIngram
AndrewIngram / route.ts
Last active February 17, 2023 02:14
Next.js SItemap route with streaming (requires Node 18+)
import { SitemapStream, EnumChangefreq } from "sitemap";
import { getAllPosts } from "~/data";
import { Readable } from "node:stream";
async function* getSitemapUrls(request: Request) {
const url = new URL(request.url);
const origin = `${url.protocol}//${url.host}`;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
error DeploymentFailed();
address constant TURNSTILE = 0xEcf044C5B4b867CFda001101c617eCd347095B44;
/// @notice Minimal proxy library.
/// @author Modified from Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibClone.sol)
library LibClone {