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 / config.toml
Last active September 12, 2025 10:50
My global config.toml setup for ultra fast Rust compile times
[unstable]
codegen-backend = true
[profile]
incremental = true
[profile.dev]
codegen-backend = "cranelift"
# If you want to attach a debugger, set this to true
debug = "line-tables-only"
@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 {
@janhohenheim
janhohenheim / random_wikipedia_article.py
Last active August 24, 2017 13:35
save a random german wikipedia article
import wikipedia, re, os
articles_path = 'articles/'
def get_random_wikipedia_article():
title = wikipedia.random()
try:
content = wikipedia.page(title)
except wikipedia.exceptions.DisambiguationError as err:
print('⚠️ Randomly picked disambiguation page: ' + err.title + ', picking new one...')
@janhohenheim
janhohenheim / main.rs
Last active July 26, 2017 15:25
ncollide example
extern crate nalgebra;
extern crate alga;
extern crate ncollide;
use nalgebra::{self as na, Vector2, Isometry2, Point2};
use alga::linear::{AffineTransformation, Translation};
use ncollide::query::Proximity;
use ncollide::world::{CollisionObject2, CollisionGroups, CollisionWorld2, GeometricQueryType};
use ncollide::narrow_phase::{ProximityHandler, ContactHandler, ContactAlgorithm2};
use ncollide::shape::{ShapeHandle2, Ball, Cuboid, Plane};