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 / guide.md
Last active May 23, 2025 11:49
DeepGEMM uv installation issue repro guide

Requires NVIDIA Hopper architecture GPU (sm_90a must be supported)

i.e. sm_86 (RTX 30x0 series) won't work, need RTX 40x0 series

Installation:

  • make two copies of the repo, call uv venv in one and use conda create in the other (use Python 3.11.11 for both)
mkdir deepgemm && cd deepgemm
@lmmx
lmmx / uninstall-old-rust-nightly.sh
Last active May 19, 2025 13:22
Uninstall old Rust nightly versions
# Keep the latest nightly and remove older dated nightlies
LATEST_DATE=$(rustup toolchain list | grep 'nightly-[0-9]' | sed 's/nightly-\([0-9-]*\).*/\1/' | sort -r | head -n 1)
# If we found dated nightlies, remove all except the most recent one
if [ -n "$LATEST_DATE" ]; then
for toolchain in $(rustup toolchain list | grep 'nightly-[0-9]' | grep -v "$LATEST_DATE"); do
echo "Removing old nightly: $toolchain"
rustup toolchain uninstall "$toolchain"
done
fi
@lmmx
lmmx / main.rs
Last active May 16, 2025 20:32
spez! macro monomorphisation to detect type parameterised Spans
//! ```cargo
//! [dependencies]
//! spez = "0.1.2"
//! ```
use spez::spez;
use core::marker::PhantomData;
#[derive(Debug)] pub enum Cooked {}
#[derive(Debug)] pub enum Raw {}
@lmmx
lmmx / helper.sh
Created May 10, 2025 15:29
Loop through workspace crates running tests one by one to review outputs
for x in *-*; do pushd $x >/dev/null; echo $x; cargo test -q --no-run; just -f ../Justfile -d . test; read dummyvar; popd; clear; done
@lmmx
lmmx / find-distinct-dup-versions.sh
Created May 8, 2025 16:59
Find Rust dependencies with distinctly versioned duplicates
cargo tree -e no-dev --duplicates --depth 0 | sed '/^$/d' | grep -v 'dependencies]' | uniq | cut -d ' ' -f 1 | uniq -d
@lmmx
lmmx / gh-set-upstream.sh
Created May 8, 2025 16:51
Set upstream on a repo you forked with gh after cloning
gh repo set-default $(git remote get-url upstream | sed 's/.*github.com[:/]\(.*\).git/\1/')
@lmmx
lmmx / sync_fork.sh
Created April 25, 2025 12:54
Sync your remote git repo with its upstream (default branch), so you can then pull the changes to your local repo
function sync-fork() {
local origin_url=$(git config --get remote.origin.url)
local fork_repo=""
if [[ $origin_url =~ github\.com[:/]([^/]+/[^/.]+) ]]; then
fork_repo="${BASH_REMATCH[1]}"
else
echo "Error: Could not parse origin remote URL"
return 1
fi
local upstream_url=$(git config --get remote.upstream.url)
@lmmx
lmmx / script.sh
Last active March 24, 2025 15:34
All the things I needed to install to run the Dioxus 0.6 demo tutorial (line 1 via https://github.com/DioxusLabs/dioxus/blob/9e09bcf3f79aa7b349da23ca80cb2a214230562b/notes/CONTRIBUTING.md?plain=1#L6)
sudo apt install libgdk3.0-cil libatk1.0-dev libcairo2-dev libpango1.0-dev libgdk-pixbuf2.0-dev libsoup-3.0-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev libxdo-dev -y
@lmmx
lmmx / gifopt.sh
Created March 23, 2025 13:48
Gif optimisation using gifski, a fast Rust GIF encoder https://github.com/ImageOptim/gifski/
gifopt() {
local inputgif="${1:?Missing input GIF filename}"
local quality="${2:-80}"
if ! [[ "$quality" =~ ^[0-9]+$ ]] || [ "$quality" -lt 1 ] || [ "$quality" -gt 100 ]; then
echo "Quality parameter must be an integer from 1 to 100" >&2
return 1
fi
local tmpdir="$(mktemp -d)"
@lmmx
lmmx / Cargo.toml
Last active March 21, 2025 16:52
A minimal Rust + WASM demo simulating 2,000 vehicles (buses/trains) moving on a canvas, using a shared `RefCell` for state https://qrx.spin.systems/transport-network-sim/
[package]
name = "trunk-hello-world"
version = "0.1.0"
edition = "2024"
[lib]
crate-type = ["cdylib"]
path = "lib.rs"
[dependencies]