Skip to content

Instantly share code, notes, and snippets.

View alpinevm's full-sized avatar

Cliff Syner alpinevm

  • Rift Research
  • San Francisco, CA
  • 16:47 (UTC -08:00)
  • X @alpinevm
View GitHub Profile
import { describe, expect, it } from "bun:test";
describe.skipIf(SKIP)("Aerodrome SDK Direct - Integration", () => {
const SDK_TIMEOUT = 60_000;
it("calls getQuoteForSwap directly for USDC -> WETH", async () => {
const { getDefaultConfig, getQuoteForSwap, base } = await import("@dromos-labs/sdk.js");
const config = getDefaultConfig({
chains: [
{
@alpinevm
alpinevm / docker-ce-install.sh
Last active December 1, 2025 17:05
Ubuntu Docker CE Installation Script
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
@alpinevm
alpinevm / claude_code_notify.sh
Last active November 14, 2025 23:36
Get macos visual notification when claude code finishes a task
#!/usr/bin/env bash
# Depends on terminal-notifier -> https://github.com/julienXX/terminal-notifier
# Setup Details:
# Save this as a bash file
# [in claude code] Call /hooks
# Select STOP
# Paste fully qualified path of bash file
json=$(cat)
cwd=$(printf '%s' "$json" | jq -r '.cwd // .tool_input.cwd // empty')
[ -z "$cwd" ] && cwd="(no cwd field)"
@alpinevm
alpinevm / bvec_sha256.nr
Last active April 5, 2024 00:31
BoundedVec mod of sha256 (noir v0.26.0)
// Implementation of SHA-256 mapping a byte array of variable length to
// 32 bytes.
use dep::std::hash;
// Convert 64-byte array to array of 16 u32s
fn msg_u8_to_u32(msg: [u8; 64]) -> [u32; 16] {
let mut msg32: [u32; 16] = [0; 16];
for i in 0..16 {
for j in 0..4 {
msg32[15 - i] = (msg32[15 - i] << 8) + msg[64 - 4*(i + 1) + j] as u32;
@alpinevm
alpinevm / github_url_parser.py
Created November 1, 2023 16:14
Parse Github urls in Python
"""
Github url parser in python - @alpinevm
Inspired by https://github.com/jonschlinkert/parse-github-url/tree/master
"""
from typing import Union, Optional
from urllib.parse import urlparse
import re
from dataclasses import dataclass
@alpinevm
alpinevm / anvil_wrapper.py
Created October 13, 2023 01:58
Invoke and use Foundry Anvil from a python class
"""
python3 -m pip install web3 requests
"""
import subprocess
import socket
from web3 import Web3, HTTPProvider
from web3.types import Wei
import time
import requests
import traceback
@alpinevm
alpinevm / ecdsa_vuln.py
Last active October 21, 2024 20:43
Generate arbitrary ECDSA signature + hash pairs given a public key
# Author: Alpine, @alpinevm
# python3 -m pip install eth_account ecdsa
# Inspired by: https://yondon.blog/2019/01/01/how-not-to-use-ecdsa/
import random
from eth_account import Account
from ecdsa import SECP256k1, VerifyingKey
from ecdsa.util import number_to_string