Skip to content

Instantly share code, notes, and snippets.

View fearofcode's full-sized avatar
🎵
Take that chance / All day long / Fucking up so fucking strong

Warren Henning fearofcode

🎵
Take that chance / All day long / Fucking up so fucking strong
View GitHub Profile
@fearofcode
fearofcode / CMakeLists.txt
Created November 7, 2025 01:20
simple console rendering proof of concept code for FreeType
cmake_minimum_required(VERSION 4.0)
project(ute CXX C)
set(CMAKE_CXX_STANDARD 17)
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_FOUND}")
message(STATUS "Using ccache for compilation.")
endif()
@fearofcode
fearofcode / main.odin
Created October 31, 2025 04:43
WebGPU Odin simple texture example
package vendor_wgpu_example_triangle
import "core:time"
import "base:runtime"
import "core:fmt"
import "core:math"
import "vendor:wgpu"
import "vendor:glfw"
import "vendor:wgpu/glfwglue"
import glm "core:math/linalg/glsl"
@fearofcode
fearofcode / main.odin
Last active October 29, 2025 03:11
wgpu Uniform buffers in Odin
package vendor_wgpu_example_triangle
import "core:time"
import "base:runtime"
import "core:fmt"
import "core:math"
import "vendor:wgpu"
import "vendor:glfw"
import "vendor:wgpu/glfwglue"
import glm "core:math/linalg/glsl"
@fearofcode
fearofcode / true_minimal_midnight.icls
Last active October 23, 2025 15:57
dark blue monochrome IntelliJ color scheme
<scheme name="True Minimal Midnight" version="142" parent_scheme="Darcula">
<metaInfo>
<property name="created">2025-10-26T13:30:00</property>
<property name="ide">idea</property>
<property name="ideVersion">2023.2.5.0.0</property>
<property name="modified">2025-10-26T13:30:00</property>
<property name="originalScheme">True Minimal Midnight</property>
</metaInfo>
<colors>
<option name="CARET_ROW_COLOR" value="11233a" />
@fearofcode
fearofcode / README.md
Last active September 28, 2025 00:27
DPI-aware Odin Dear imgui setup using odin-imgui

imgui setup:

  • Download Inconsolata from https://fonts.google.com/specimen/Inconsolata and extract its file Inconsolata-Regular.ttf to a directory called assets if you want the assets/Inconsolata-Regular.ttf font the code uses to work as is

  • Clone https://gitlab.com/L-4/odin-imgui to a submodule: git submodule add [email protected]:L-4/odin-imgui.git odin-imgui

  • Clone dear_bindings to a submodule: git submodule add [email protected]:dearimgui/dear_bindings.git dear_bindings

  • Make a python venv and install dear_bindings requirements (ply):

    • python3 -m venv venv
    • source venv/bin/activate
    • cd dear_bindings
@fearofcode
fearofcode / debug_ui_microui_opengl.odin
Created September 11, 2025 03:58
Simple microui Odin OpenGL basic example
package main
import "core:fmt"
import glm "core:math/linalg/glsl"
import gl "vendor:OpenGL"
import mu "vendor:microui"
Microui_Vertex :: struct {
pos : glm.vec2,
@fearofcode
fearofcode / benchmark.cpp
Created March 7, 2025 00:47
either this benchmark is fucked or C++ style I/O is slow as shit
#include <iostream>
#include <chrono>
#include <vector>
#include <fstream>
#include <string>
#include <cstdlib>
#include <cstdio>
using namespace std;
using namespace std::chrono;
@fearofcode
fearofcode / raylib_zig_high_dpi_ttf.zig
Created February 18, 2025 01:38
conditional high DPI window + proper text on retina display with Raylib and zig
const rl = @cImport(@cInclude("raylib.h"));
const std = @import("std");
fn isHighDpi() bool {
rl.SetConfigFlags(rl.FLAG_WINDOW_HIDDEN);
rl.InitWindow(100, 100, "");
const high_dpi = rl.GetWindowScaleDPI().x > 1.0;
rl.CloseWindow();
return high_dpi;
@fearofcode
fearofcode / autocrafter.py
Last active November 9, 2024 05:15
Send space to semi-AFK equipment bench in Satisfactory (Satisfactory window does not need to be active)
import ctypes
from ctypes import wintypes
import time
import sys
# Windows API constants
WM_KEYDOWN = 0x0100
WM_KEYUP = 0x0101
VK_SPACE = 0x20
@fearofcode
fearofcode / export.py
Last active September 17, 2024 00:52
Simple anki export of a Plover steno dictionary using the genanki (https://github.com/kerrickstaley/genanki) library
# Copyright (C) 2024 Warren Henning
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the