Skip to content

Instantly share code, notes, and snippets.

View janhohenheim's full-sized avatar
🌱
Doing business

Jan Hohenheim janhohenheim

🌱
Doing business
View GitHub Profile
@janhohenheim
janhohenheim / inspector_at_home.rs
Created October 17, 2025 22:17
Print all Components
fn plugin(app: &mut App) {
app.add_systems(
Update,
trigger_print.run_if(input_just_pressed(KeyCode::F3)),
);
app.add_observer(print);
}
#[derive(EntityEvent)]
def process_graph [prefix: string; target: string] {
ktx create --format R32G32B32A32_SFLOAT $'assets/raw_assets/($prefix)_base_color.exr' $'($target)/($prefix)_base_color.ktx2'
ktx create --format R32G32B32A32_SFLOAT $'assets/raw_assets/($prefix)_normal_map.exr' $'($target)/($prefix)_normal_map.ktx2'
ktx create --format R32G32B32A32_SFLOAT $'assets/raw_assets/($prefix)_metallic_roughness.exr' $'($target)/($prefix)_metallic_roughness.ktx2'
oiiotool $'assets/raw_assets/($prefix)_depth_map.exr' -chnames R -o $'($target)/($prefix)_intermediate_depth_map.exr'
ktx create --format R32_SFLOAT $'($target)/($prefix)_intermediate_depth_map.exr' $'($target)/($prefix)_depth_map.ktx2'
}
# convert the "processed_single" images into the "processed" directory
# process_graph "floor_graph" "assets/processed-single"
@janhohenheim
janhohenheim / config.toml
Last active October 5, 2025 03:20
My global config.toml setup for ultra fast Rust compile times
[unstable]
codegen-backend = true
[profile.dev]
# Compile using cranelift for massively faster compilation
codegen-backend = "cranelift"
# If you want to attach a debugger, set this to true
debug = "line-tables-only"
# Consider compiling deps with cranelift if you want cold-compilation to be faster
@janhohenheim
janhohenheim / lightstimulus_arduino.cpp
Created December 5, 2024 19:07 — forked from Pleasegivemeamango/lightstimulus_arduino.cpp
Use Welford's online algorithm
#include <ArduinoGraphics.h>
#include <Arduino_MKRRGB.h>
#include <Stream.h>
#define let auto const
using namespace std;
const double CALIBRATION_SECONDS = 1.0;
const double STANDARD_DEVIATION_ABOVE_NOISE_MEAN = 3.0;
@janhohenheim
janhohenheim / macos_scancodes.txt
Created February 16, 2023 16:13
macOS ScanCodes
Escape: 0x35
F1: 0x7a
F2: 0x78
F3: 0x63
F4: 0x76
F5: 0x60
F6: 0x61
F7: 0x62
F8: 0x64
F9: 0x65
@janhohenheim
janhohenheim / codex_crypto_bot.py
Created September 8, 2021 11:56
Crypto trading bot generated by OpenAI Codex
#! /usr/env/python3
# Implement a fully automatic cryptocurrency trading bot
import requests
import json
import time
import datetime
from bs4 import BeautifulSoup as bs
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
@janhohenheim
janhohenheim / PlanetSystem.cs
Last active September 6, 2020 23:09
gravity
using Unity.Collections;
using Unity.Entities;
using Unity.Mathematics;
using Unity.Physics;
using Unity.Physics.Extensions;
using Unity.Transforms;
namespace Planet
{
public class PlanetSystem: SystemBase
using Player;
using Unity.Collections;
using Unity.Entities;
using Unity.Mathematics;
using Unity.Physics;
using Unity.Physics.Systems;
using Unity.Transforms;
using UnityEngine;
namespace Camera
@janhohenheim
janhohenheim / main.rs
Created April 30, 2019 15:04
Dependency injection in Rust MVP
use core::any::TypeId;
use maplit::hashmap;
use std::collections::HashMap;
use std::rc::Rc;
fn main() {
let container = Container::new();
let _string: Rc<String> = container.resolve_shared();
#include <string>
#include <memory>
#include <functional>
#include <vector>
#include <iostream>
using namespace std;
namespace App {
namespace Entity {