Skip to content

Instantly share code, notes, and snippets.

View polyrand's full-sized avatar

Ricardo Ander-Egg polyrand

View GitHub Profile
@polyrand
polyrand / build.py
Last active November 17, 2022 12:15
Small static site builder script using Jinja, Tailwind CSS (with example to download JS libraries)
from jinja2 import Environment, FileSystemLoader, select_autoescape
from pathlib import Path
import shutil
import tempfile
import subprocess
import os
if "tailwindcss" not in os.listdir():
import contextlib
from functools import wraps
import cProfile
from typing import Optional
import io
import pstats
import time
from pathlib import Path
from functools import wraps

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@polyrand
polyrand / SSH_MACOS_SECURE_ENCLAVES.md
Created November 23, 2025 21:35 — forked from arianvp/SSH_MACOS_SECURE_ENCLAVES.md
Native Secure Enclaved backed ssh keys on MacOS

Native Secure Enclave backed ssh keys on MacOS

It turns out that MacOS Tahoe can generate and use secure-enclave backed SSH keys! This replaces projects like https://github.com/maxgoedjen/secretive

There is a shared library /usr/lib/ssh-keychain.dylib that traditionally has been used to add smartcard support to ssh by implementing PKCS11Provider interface. However since recently it also implements SecurityKeyProivder which supports loading keys directly from the secure enclave! SecurityKeyProvider is what is normally used to talk to FIDO2 devices (e.g. libfido2 can be used to talk to your Yubikey). However you can now use it to talk to your Secure Enclave instead!

@polyrand
polyrand / README.md
Created December 21, 2025 13:07
claude-code installer alternative.
@polyrand
polyrand / pi-ai-stream.ts
Created January 23, 2026 16:14
pi-ai generic stream
#!/usr/bin/env -S deno run --allow-env=GEMINI_API_KEY,ANTHROPIC_*,OPENAI_*,GOOGLE_*,AWS_*,WS_* --allow-net=api.anthropic.com,bedrock-runtime.us-east-1.amazonaws.com,bedrock-runtime.us-west-2.amazonaws.com,bedrock-runtime.eu-west-1.amazonaws.com,bedrock-runtime.ap-southeast-1.amazonaws.com,bedrock-runtime.ap-northeast-1.amazonaws.com,generativelanguage.googleapis.com,api.openai.com --allow-read=/dev/stdin --allow-write=/dev/stdout
import { getModel, streamSimple } from "npm:@mariozechner/pi-ai";
import type {
Context,
KnownProvider,
SimpleStreamOptions,
} from "npm:@mariozechner/pi-ai";
interface Request {