Skip to content

Instantly share code, notes, and snippets.

View 0xBigBoss's full-sized avatar
🤠

Big Boss 0xBigBoss

🤠
View GitHub Profile
@0xBigBoss
0xBigBoss / get-historical-token-price.ts
Created March 26, 2024 02:39
Returns historical prices of POKT in the past n days and the average for that period
 import axios from 'axios';
import { poll } from 'ethers/lib/utils';
import moment from 'moment';
import Logger from '@loaders/logger';
import sleep from '@helpers/utils/sleep';
import { getRandomArbitrary } from '@helpers/utils/get-random-arbitrary';
const pricesPerDayUsd: { [day: string]: number } = {};
let historicalPricesLoaded = false;
SELECT
grantee,
specific_schema,
routine_name,
privilege_type
FROM
information_schema.routine_privileges
WHERE
specific_schema NOT IN ('pg_catalog', 'information_schema');
@0xBigBoss
0xBigBoss / erc-4337-deposit-to-entrypoint.ts
Created December 29, 2023 20:29
ERC-4337 Account abstraction sponsor a transactions by setting the deposit on the Entry Point
// sponsor the creation by setting the deposit on the Entry Point
const { request: depositRequest } = await baseMainnetClient.simulateContract({
address: entrypoint.address,
functionName: 'depositTo',
abi: iEntryPointABI,
args: [senderAddress],
account: dummyAccount,
value: parseEther('0.5'),
})
const depositHash = await walletClient.writeContract(depositRequest)
@0xBigBoss
0xBigBoss / webauthn-signature-verifier.ts
Created December 29, 2023 15:27
Verify a digital signature using ECDSA and Web Crypto API
export async function verifySignature({
authenticatorData,
clientDataJSON,
r,
s,
x,
y,
}: {
authenticatorData: string
clientDataJSON: string
@0xBigBoss
0xBigBoss / gh-org-contribs
Last active October 25, 2023 18:07
ZX script to fetch all contributors to an organization public repos.
#!/usr/bin/env zx
// -*- mode: js -*-
const orgName = process.argv[3];
if (!orgName) {
console.log(`Usage: gh-org-contribs ${chalk.bold("<org-name>")}`);
process.exit(1);
}
@0xBigBoss
0xBigBoss / docker_context_analyze.sh
Created October 13, 2023 03:30
Analyze a docker context and what files would be included in your docker image. Creates a directory at /tmp/docker-context.
printf 'FROM scratch\nCOPY . /' | DOCKER_BUILDKIT=1 docker build -f - -o /tmp/docker-context .
@0xBigBoss
0xBigBoss / upgrade.zx.md
Last active July 29, 2023 22:25
Pocket Network v1 Upgrade Feature e2e

Upgrade Feature e2e

You need to have zx installed before executing this file.

npm install -g zx
zx upgrade.zx.md

Ensure ACL Owner is imported

➤ YN0000: built @my/ui in 4528 ms
➤ YN0000: Done in 5s 16ms
- info Loaded env from /Users/0xbigboss/send/send-distributions-app/apps/next/.env.local
- info Loaded env from /Users/0xbigboss/send/send-distributions-app/apps/next/.env
Welcome to Tamagui!
You can update this monorepo to the latest Tamagui release just by running:
@0xBigBoss
0xBigBoss / draft.md
Created June 30, 2023 03:29
[E2E Feature Flags] Onchain Feature Flags

Objective

Implementing F. E2E Feature Flags 🔴

  1. Adding New Feature 🔴
  2. Enabling Feature 🔴
  3. Disabling Feature 🔴
  4. Modifying Feature Value 🔴

Origin Document

@0xBigBoss
0xBigBoss / gencert.sh
Last active June 21, 2023 20:45
Generate a local self-signed certificate for example.com and *.example.com.
#!/bin/bash
# Set the domain name
domain="example.com"
wildcard_domain="*.example.com"
# Check if the certificate and key files already exist
if [[ -f "${domain}.crt" && -f "${domain}.key" ]]; then
echo "Certificate and key files already exist. Exiting..."
exit 0