Skip to content

Instantly share code, notes, and snippets.

View nickpascucci's full-sized avatar

Nick Pascucci nickpascucci

View GitHub Profile
@clarityflowers
clarityflowers / dither
Last active January 28, 2021 09:44
Make a little dithered image
#!/bin/bash
USAGE="${0##*/} <origin> <dest> <size> <num-colors> [<filter-color> <filter-amount>]"
if [[ $1 == --help ]]; then
echo $USAGE
elif [[ -n $5 ]]; then
magick $1 -dither Floyd-Steinberg -resize $3 -colors $4 \
\( +clone -fill $5 -colorize $6 \) -compose dissolve \
-define compose:args=25 -colors $4 -composite \
$2 && open -a Preview $2
else
@KodrAus
KodrAus / Profile Rust on Linux.md
Last active November 14, 2023 17:19
Profiling Rust Applications

Profiling performance

Using perf:

$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg

NOTE: See @GabrielMajeri's comments below about the -g option.