Skip to content

Instantly share code, notes, and snippets.

View lmmx's full-sized avatar
💡
lights, camera, action

Louis Maddox lmmx

💡
lights, camera, action
View GitHub Profile
@lmmx
lmmx / build_ort.sh
Last active December 15, 2025 16:16
Build ONNX runtime (all of it) wheel for Ampere (sm_86) only, reducing .so weight from 415 MB ⇒ 82 MB (wheel: 300M ⇒ 48M). Needs 1 edited ops file
#!/bin/bash
set -e
cd $HOME/lab/ort/build
# Clean previous attempt
rm -rf onnxruntime
git clone --recursive --depth 1 --branch v1.23.0 https://github.com/microsoft/onnxruntime
@lmmx
lmmx / 1_prompt.md
Last active December 12, 2025 15:50
Meta-consensus prompt via Dryzek and Niemeyer (2006) Reconciling Pluralism and Consensus as Political Ideals https://openresearch-repository.anu.edu.au/server/api/core/bitstreams/13db0edd-bc9e-45ab-ae40-9194d14bd78a/content — generated by Claude Opus 4.5 prompted with the original paper and then again with images of pages 5-9 specifically

You are facilitating a dialogue among groups with conflicting positions on a contested issue. Your goal is to help participants achieve meta-consensus: agreement on the legitimacy of disputed values, acceptance of the credibility of disputed beliefs, and agreement on the nature of disputed choices—even while disagreement persists at the level of specific preferences.

This approach recognizes that "unbridled pluralism and absolute consensus alike turn out on closer inspection to have few advocates or defenders." The resolution involves "pluralism in values, beliefs, and preferences in the context of a meta-consensus on one or more of these three aspects."

Begin by identifying distinct groups and mapping their positions across normative, epistemic, and preference dimensions. Then work to surface meta-consensus at each level while preserving legitimate disagreement.

BASE64=$(base64 -w 0 prek-design-foregrounded-transp-bg.png)
curl -o "prek-badge-transp-bg.svg" "https://img.shields.io/badge/prek-enabled-brightgreen.svg?logo=data:image/png;base64,${BASE64}&logoWidth=30"
BASE64=$(base64 -w 0 prek-design-transp-orange-fg.png)
curl -o "prek-badge-transp-orange-fg.svg" "https://img.shields.io/badge/prek-enabled-brightgreen.svg?logo=data:image/png;base64,${BASE64}&logoWidth=30"
BASE64=$(base64 -w 0 prek-design-transp-white-fg.png)
curl -o "prek-badge-transp-white-fg.svg" "https://img.shields.io/badge/prek-enabled-brightgreen.svg?logo=data:image/png;base64,${BASE64}&logoWidth=30"
# Orange badges
@lmmx
lmmx / az_underscore_generate.py
Last active November 22, 2025 01:00
Rust import ordering (what's the ordering?). Some illegal Rust identifier combinations were removed from the output
import itertools
# Generate and print every possible string (length 1–5) from the characters: _, a, A, z, Z
print(", ".join("".join(c) for r in range(1, 6) for c in itertools.product("_aAzZ", repeat=r)))
@lmmx
lmmx / vsearch.sh
Created November 15, 2025 20:59
Open a file in vim (the first match for the name using fd) and immediately execute a search
function vsearch ()
{
local filename="$1";
local search_string="$2";
if [ -z "$filename" ] || [ -z "$search_string" ]; then
echo "Usage: vsearch filename 'search_string'";
return 1;
fi;
vim $(fd -1 "$filename") -c "/$search_string" -c "normal! zz"
}
@lmmx
lmmx / clone_gh_labels.sh
Last active November 7, 2025 17:16
Clone facet-rs/facet issue labels to another facet repo (modified version of https://gist.github.com/lmmx/094c0a0061da3bbc9a333fe95c3dee53/)
# Delete all the unwanted defaults
gh label delete bug --yes
gh label delete documentation --yes
gh label delete duplicate --yes
gh label delete enhancement --yes
gh label delete "good first issue" --yes
gh label delete "help wanted" --yes
gh label delete invalid --yes
gh label delete question --yes
gh label delete wontfix --yes
@lmmx
lmmx / const_str_field.rs
Last active November 7, 2025 13:08
Constant static str de/ser in facet-json
#!/usr/bin/env rust-script
//! ```cargo
//! [dependencies]
//! facet = "0.30"
//! facet-json = "0.30"
//! ```
use facet::Facet;
use facet_json;
@lmmx
lmmx / gist:3f2a40cfeb8eadddeaff37e727e3394f
Last active November 4, 2025 20:52
Quick list out of Python / Rust (PyO3) packages as GitHub repo links, reverse chronological
@lmmx
lmmx / node_types.parquet
Last active November 6, 2025 00:57
Loaded node types into parquet via polars-genson via https://gist.github.com/lmmx/ed3dd70ea7997f27efa1ff31b625c0b1