Skip to content

Instantly share code, notes, and snippets.

View bdero's full-sized avatar

Brandon DeRosier bdero

View GitHub Profile
@bdero
bdero / a_template_input_consts.cc
Last active December 23, 2023 03:48
C++ compile-time generation of derived config structs
// https://onlinegdb.com/7BVWzlDPv
#include <iostream>
#include <type_traits>
// Declare the derived config we want to produce.
struct DerivedConfig {
float derived_value;
};
@bdero
bdero / mathlet.gif
Last active January 11, 2022 20:22
mathlet.gif
@bdero
bdero / netwalk.gif
Last active January 11, 2022 20:10
netwalk.gif
@bdero
bdero / .clangd
Last active April 30, 2023 11:10
CompileFlags:
Add: [
"/std:c++20",
"-std=c++20",
]
@bdero
bdero / imgui.gif
Last active March 21, 2021 06:59
imgui.gif
imgui.gif
@bdero
bdero / imgui_particle_text.cpp
Created November 27, 2020 11:47
ImGui Particle Text demo
/*
* ImGui Particle Text (deobfuscated)
* ==================================
* Done as part of the "ImDrawList coding party" challenge:
* https://github.com/ocornut/imgui/issues/3606#issuecomment-734636054
* https://twitter.com/algebrandon/status/1332182010593304576
*/
#include <algorithm>
// 2D rotation formula. This demo uses Euler angles, and so this formula is used
@bdero
bdero / brainfuck.rs
Last active July 28, 2019 23:01
Brainfuck
use std::env;
use std::fs::File;
use std::io::prelude::*;
use std::io::stdin;
fn get_program_from_args() -> Option<String> {
let mut args = env::args();
args.next(); // Ignore the first argument, which is always the program name
let mut program: Option<String> = None;