Skip to content

Instantly share code, notes, and snippets.

@bruceg
bruceg / branch-review.md
Last active January 6, 2026 12:43
Branch review command for AI agents

Git Branch Code Review

Overview

Perform a thorough code review that verifies functionality, maintainability, and security. Focus on architecture, readability, performance implications, and provide actionable suggestions for improvement.

Steps

#!/bin/bash
perlopts=()
regexopts=g
while [ x"$1" != x"${1#-}" ]
do
if [ x"$1" = x-- ]
then
shift
break
fi
use criterion::{
black_box, criterion_group, criterion_main,
measurement::{Measurement, WallTime},
BenchmarkId, Criterion,
};
use criterion_linux_perf::{PerfMeasurement, PerfMode};
use smallvec::SmallVec;
use std::mem::{drop, size_of};
use tinyvec::TinyVec;
@bruceg
bruceg / rust-timeit
Last active September 25, 2020 15:38
Rust equivalent to `python -m timeit`
#!/usr/bin/python3
import appdirs, atexit, glob, os
from argparse import ArgumentParser
from subprocess import *
CARGO_TOML = """
[package]
name = "rust-timeit"
version = "0.0.0"
edition = "2018"
@bruceg
bruceg / gist:a9ae355cf4362f59aa26e9a8bc6dbaf9
Created October 21, 2019 22:55
leveldb-sys-2.0.5 cargo build failure
> cargo build --jobs 1
Compiling leveldb-sys v2.0.5
error: failed to run custom build command for `leveldb-sys v2.0.5`
Caused by:
process didn't exit successfully: `/home/bruce/clients/Timber/vector/target/debug/build/leveldb-sys-c93c14447600bbb2/build-script-build` (exit code: 101)
--- stdout
[build] Started
[snappy] Cleaning
make: Entering directory '/home/bruce/.cargo/registry/src/github.com-1ecc6299db9ec823/leveldb-sys-2.0.5/deps/snappy-1.1.2'