Skip to content

Instantly share code, notes, and snippets.

View jxqu3's full-sized avatar
🏠
Working from home

JXQU3 jxqu3

🏠
Working from home
View GitHub Profile
@jxqu3
jxqu3 / NativeMethods.txt
Last active March 24, 2026 02:02
This is a class to make a window using the Win32 API. It needs to have Microsoft's CsWin32 set up, and works like this.
User32.*
Kernel32.*
WM_DESTROY
IDC_ARROW
BS_DEFPUSHBUTTON
@jxqu3
jxqu3 / cond.rs
Created November 23, 2023 07:17
Rust macro to use match as nested ifs, like empty switches in Go
#[macro_export]
// This is a macro to use a match with boolean conditions, like a empty switch in Go.
// Made by github.com/Esper89 in the Rust discord!
macro_rules! cond {
($($cond:expr => $value:expr),* $(, _ => $dft:expr)? $(,)?) => {
match () {
$(() if $cond => $value,)*
() => ($($dft)?),
}
};