Skip to content

Instantly share code, notes, and snippets.

View kurtlawrence's full-sized avatar

Kurt Lawrence kurtlawrence

View GitHub Profile
@kurtlawrence
kurtlawrence / dudep.rs
Created September 22, 2024 03:38
Rust script to investigate duplicate dependencies that could be remedied
#!/usr/bin/env -S rust-script -c
//! You might need to chmod +x your script!
//! ```cargo
//! [dependencies.rust-script-ext]
//! git = "https://github.com/kurtlawrence/rust-script-ext"
//! rev = "e914bc0a04e9216ffdfd15c47f4c39b74d98bbeb"
//!
//! [dependencies]
//! colored = "2.1.0"
//! ```
@kurtlawrence
kurtlawrence / chart-metrics.rs
Last active May 17, 2023 03:14
Construct HTML document with Plotly charts of burn-rs training progression
//! A small utility to construct a HTML document with Plotly charts of the training metrics
//! by reading the log entries in burn's artifact directory.
//!
//! The file can be compiled and executed with `rustc` (`-O` for optimised)
//! ```sh
//! rustc chart-metrics.rs && ./chart-metrics <ARTIFACT-DIR>
//! ```
//!
//! Source code: https://gist.github.com/kurtlawrence/7921fca8751ce2ea4826f8ab0a90ee32
use std::collections::BTreeMap;
@kurtlawrence
kurtlawrence / fit_macro.rs
Created May 16, 2022 06:39
`fit_kserd!` macro implementation used in daedalus
// # Fitting kserd macro.
//
// The macro logic is hidden from users to avoid having the long list of pattern matching exposed.
// It also helps control the pattern state.
//
// Fitting is split into four aspects:
// 1. Parsing
// 2. Flattening
// 3. Documentation
// 4. Code generation