Skip to content

Instantly share code, notes, and snippets.

View andrewgazelka's full-sized avatar
🤖

Andrew Gazelka andrewgazelka

🤖
View GitHub Profile
@andrewgazelka
andrewgazelka / README.md
Created September 5, 2026 00:10
Rust Cranelift JIT demo: source-to-result benchmark against LLVM and Cranelift AOT, with raw measurements

Run ordinary Rust through a JIT

A small demo of rustc's experimental Cranelift JIT mode, plus the benchmark behind the graphic. It runs a normal .rs file: rustc parses and checks it, then Cranelift generates native machine code in memory and executes it. No standalone executable is emitted in JIT mode.

This reproduction targets Apple Silicon macOS. It was measured on an Apple M5 Max. The benchmark uses macOS library paths and system tools; it is not a cross-platform harness.

@andrewgazelka
andrewgazelka / before-panel.png
Last active July 6, 2026 07:44
nwm machine-builds panel screenshots
before-panel.png
<!DOCTYPE html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>afore.vc — TLS / DNS diagnosis</title>
<style>
:root{color-scheme:light dark}
body{font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;max-width:820px;margin:2rem auto;padding:0 1rem;line-height:1.5}
h1{font-size:1.5rem;margin-bottom:.2rem} h2{font-size:1.1rem;margin-top:1.8rem;border-bottom:1px solid #8884;padding-bottom:.2rem}
code,pre{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
pre{background:#8881;padding:.75rem;border-radius:6px;overflow-x:auto;font-size:.85rem}
table{border-collapse:collapse;width:100%;margin:.5rem 0;font-size:.9rem}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Mesh · an agent trust & bounty network</title>
<style>
:root{
--bg:#ffffff; --fg:#1f2328; --muted:#656d76; --faint:#8b949e;
--line:#e4e7eb; --card:#fbfcfd; --accent:#3b82f6; --accent-weak:#dbeafe;
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Mesh · an agent trust & bounty network</title>
<style>
:root{
--bg:#ffffff; --fg:#1f2328; --muted:#656d76; --faint:#8b949e;
--line:#e4e7eb; --card:#fbfcfd; --accent:#3b82f6; --accent-weak:#dbeafe;
@andrewgazelka
andrewgazelka / README.md
Created June 9, 2026 16:59
Dia: CDP-created tabs (Target.createTarget) are live & drivable but invisible in the tab UI

Dia: CDP-created tabs are live & drivable but invisible in the tab UI

Tabs created over the Chrome DevTools Protocol (Target.createTarget, or window.open from a page that is itself driven over CDP) never appear in Dia's tab strip / sidebar. They are fully live and remote-controllable, just invisible. Only navigating an existing tab shows up.

It reproduces from a raw external CDP client, not from a browser extension: chrome.tabs.create / window.open from an extension go through Dia's own tab model (the UI observes them), but Target.createTarget from a debugger client

@andrewgazelka
andrewgazelka / minecraft-hot-reload.html
Created May 20, 2026 23:40
ix Minecraft plugin hot reloading on NixOS — flow diagram
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ix Minecraft plugin hot reloading on NixOS</title>
<style>
:root {
color-scheme: light dark;
--bg: #0f1115;
--panel: #161a22;
@andrewgazelka
andrewgazelka / llm-rust.md
Last active July 1, 2025 20:31
Rust LLM Prompt

Rust Code Style Guide

Error Handling

  • Use eyre with bail! for early returns
  • ALWAYS add error context with wrap_err() at the callee (where error occurs), not caller
  • Add context even if it feels verbose - clarity > brevity

Control Flow

  • Early return pattern everywhere - fail fast
  • Maximum 3 levels of nesting - refactor if deeper
  • by default every cargo build recompiles EVERYTHING to do with sql...
  • let's improve speed by 2 orders of magnitude
  • By default make export SQLX_OFFLINE=true, i.e., in config.fish/zsh/bash
    • open RustRover from terminal rustrover . you might have to add rustrover to path. just make sure it opens with default environment SQLX_OFFLINE=true.
  • whenever you change a query in the dir of crate run SQLX_OFFLINE=false cargo sqlx prepare -- --tests from CLI to update queries.
  • now we will only recompile query-related stuff as needed (when we update a query)
@andrewgazelka
andrewgazelka / rp.zsh
Created June 29, 2023 14:08
Run commands in parallel
# run in parallel
rp() {
name=$(getuuid)
tmux new-session -d -s $name
# Get the total number of items.
total=${#items[@]}
# Initialize a counter.
count=1