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 / custom-instruction.md
Last active June 18, 2025 15:47
Custom instruction to make Claude Artifacts use persistent file identifiers and names

Custom instruction to make Claude Artifacts use persistent and distinct file identifiers in Projects

  • The title attribute of the <AntArtifact> XML tag becomes the file_name attribute when 'Add to Project' is clicked.
  • Since Claude defaults to a human-readable title (e.g. "Modified Web Page With New Features"), this will tend to change the filename in the Project
  • It's easier to keep a single file copy in your Project docs ("Project Knowledge") when the file names are persistent in this way
Click to show earlier versions

0.0.1

inherits = "heisenberg"
"comment" = { fg = "gray", modifiers = ["italic"] }
# "comment" = { fg = "teddy_bear_pink_intense", modifiers = ["italic"] }
# "comment.line" = { fg = "teddy_bear_pink", modifiers = ["italic"] }
"comment.block" = { fg = "hazmat_yellow" }
"comment.block.documentation" = { fg = "chili_powder_red" }
"comment.line.documentation" = { fg = "teddy_bear_pink_intense" }
# "type.enum.variant" = { fg = "chili_powder_red" }
"type.enum.variant.builtin" = { fg = "chili_powder_red" }
@lmmx
lmmx / README.md
Last active May 30, 2025 16:52
batcmd: Separate stdout and stderr with syntax highlighting

batcmd - Separate stdout and stderr with syntax highlighting

A bashrc shell function that runs any command and displays stdout and stderr as separate streams with bat syntax highlighting. Uses file descriptor swapping to cleanly separate the streams without temporary files or running the command twice.

Features:

  • Configurable syntax highlighting language
  • Clean separation with "STDOUT" and "STDERR" headers
  • Works with any command
  • No temporary files or command duplication
@lmmx
lmmx / fbb.rs
Last active May 26, 2025 15:36
Demo of the tracing crate to automatically trace function entry and exit (each function must have the `#[instrument]` attribute)
#!/usr/bin/env rust-script
//! Automatic function call tracing with parameters
//!
//! ```cargo
//! [dependencies]
//! tracing = "0.1"
//! tracing-subscriber = { version = "0.3", features = ["fmt"] }
//! ```
use tracing::instrument;
@lmmx
lmmx / PRD.md
Last active May 23, 2025 22:42
Product Requirements Document (PRD): Code Masking and Pattern Analysis Pipeline (10th February 2025) with INCOSE PRD template via https://gist.github.com/wtpayne/93926afe7d702278d56f9a3835000907

Product Requirements Document (PRD)
Title: Code Masking and Pattern Analysis Pipeline


1. Purpose and Scope

This PRD defines the minimal set of requirements for a code-masking and pattern-analysis pipeline that parses multiple code Repositories, scrambles domain semantics while preserving structural patterns, and generates Polars_DataFrame outputs for subsequent analysis. These requirements conform to the INCOSE guidelines for clarity, singularity, consistency, measurability, and correctness.

A single Senior_Developer shall execute these requirements in less than 60 minutes, guaranteeing delivery of Code_Soup and Polars_DataFrame artifacts alongside a cluster-based contrastive analysis.

@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 / one_liner.sh
Last active May 12, 2025 22:49
Merge all dependency bot PRs (e.g. pre-commit)
PR_CMDS=$(gh search prs --limit 100 --owner $(gh api user -q '.login') --author pre-commit-ci[bot] --state open --json repository,number | jq -r '.[] | "gh pr merge \(.number) -R \(.repository.nameWithOwner) -s -d"' | awk '{printf "%s%s", (NR==1 ? "" : " && \n"), $0} END{print ""}'); echo "$PR_CMDS"; eval "$PR_CMDS"
@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