Skip to content

Instantly share code, notes, and snippets.

View sam-bristow's full-sized avatar
😶‍🌫️
yak-shaving

Sam Bristow sam-bristow

😶‍🌫️
yak-shaving
  • Auckland, New Zealand
View GitHub Profile
#!/bin/env bash
# I don't know way, but without this line gcc start to compile stdout :\
exec 1>&2
set -x
# build the linux targets with {linux_headers_path}/build;
# compile it to the our Makefile's path and read
# our Makefile from stdin to make its path simpler.
@bvssvni
bvssvni / gist:9674632
Last active December 23, 2023 22:56
A Rust Chain Macro
//! Chain macro in Rust
//!
//! A typical usage is to avoid nested match expressions.
//!
//! Supports:
//! - Pattern matching
//! - Or expressions (A | B => ...)
//! - Guarded statements (x if <cond> => ...)
//! - Implicit else (requires all arms to return same type)