This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
TS heap implementation for use during coding interviews. | |
Sources: | |
https://stackfull.dev/heaps-in-javascript - bug in heapify function, needs to run in reverse | |
https://github.com/ignlg/heap-js/blob/c6bce4c1a3b1cc17d9494731dc2a598e86f67a24/src/Heap.ts | |
https://dandkim.com/js-heap-implementation/ | |
CPython `heapq` stdlib: https://github.com/python/cpython/blob/3.13/Lib/heapq.py | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const response = await fetch( | |
'https://io.dexscreener.com/dex/pair-details/v3/base/0xc4ecaf115cbce3985748c58dccfc4722fef8247c', | |
{ | |
headers: { | |
accept: '*/*', | |
'accept-language': 'en-US,en;q=0.9', | |
priority: 'u=1, i', | |
'sec-ch-ua': | |
'"Not A(Brand";v="8", "Chromium";v="132", "Google Chrome";v="132"', | |
'sec-ch-ua-mobile': '?0', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get a developer API key from https://warpcast.com/~/developers/api-keys | |
const API_KEY = '' | |
// Update message | |
const message = '' | |
// Update with recipient FIDs | |
const fids = [10259] | |
for (const fid of fids) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { getAddress } from 'viem' | |
import { z } from 'zod' | |
export const address = z | |
.string() | |
.transform((val, ctx) => { | |
try { | |
return getAddress(val.toLowerCase()) | |
} catch { | |
ctx.addIssue({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import path from 'path' | |
import util from 'util' | |
import child_process from 'child_process' | |
const exec = util.promisify(child_process.exec) | |
const projectDirname = 'web' // Update with the path to your Next.js project | |
const buildEslintCommand = async (filenames) => { | |
// `next lint` just silently ignores file inputs if the file doesn't exist, |