Skip to content

Instantly share code, notes, and snippets.

View evaporei's full-sized avatar
🔮
spell caster

Eva Pace evaporei

🔮
spell caster
View GitHub Profile
name ask-questions-if-underspecified
description Clarify requirements before implementing. Do not use automatically, only when invoked explicitly.

Ask Questions If Underspecified

Goal

Ask the minimum set of clarifying questions needed to avoid wrong work; do not start implementing until the must-have questions are answered (or the user explicitly approves proceeding with stated assumptions).

@maskrosen
maskrosen / raylib_render_extras.h
Created December 10, 2024 10:06
Some extended Raylib rendering functions
/**
raylib-render-extras - Some render functions that avoids extra overhead when rendering multiple instances.
Tested with Raylib 4.2 might work with other versions
See https://youtu.be/2EOjGwhYXds?si=fcJzO1VjbLQ1dzRW&t=319 for a brief explanation of the functions
Copyright (c) 2024 Lingon Studios
The code is derived from Raylib Copyright (c) 2013-2024 Ramon Santamaria (@raysan5)
This software is provided "as-is", without any express or implied warranty. In no event
@jakubtomsu
jakubtomsu / obj.odin
Created October 6, 2024 09:34
Simple .obj 3d model parser, doesn't support 100% features like curves and whatnot but it's good enough for most regular models.
package obj
import "core:fmt"
import "core:math/linalg"
import "core:os"
import "core:strconv"
import "core:strings"
// https://en.wikipedia.org/wiki/Wavefront_.obj_file
@lassade
lassade / fixed_swiss_hashmap.zig
Last active August 31, 2024 03:59
A fixed (no allocations) hashmap that follows the Google Swiss Table design principles
const std = @import("std");
const builtin = @import("builtin");
pub const StringContext = struct {
pub inline fn hash(_: @This(), s: []const u8) u64 {
return std.hash_map.hashString(s);
}
pub inline fn eql(_: @This(), a: []const u8, b: []const u8) bool {
return std.mem.eql(u8, a, b);
}
@jakubtomsu
jakubtomsu / realtime_collision_detection.odin
Last active March 6, 2026 18:39
Port of some functions from 'Real Time Collision Detection' book by Christer Ericson to Odin
// Port of some collision functions to Odin by Jakub Tomšů.
//
// from Real-Time Collision Detection by Christer Ericson, published by Morgan Kaufmann Publishers, © 2005 Elsevier Inc
//
// This should serve as an reference implementation for common collision queries for games.
// The goal is good numerical robustness, handling edge cases and optimized math equations.
// The code isn't necessarily very optimized.
//
// There are a few cases you don't want to use the procedures below directly, but instead manually inline the math and adapt it to your needs.
// In my experience this method is clearer when writing complex level queries where I need to handle edge cases differently etc.
@mmozeiko
mmozeiko / wic.h
Last active August 7, 2025 06:17
simple wrapper to load or save D3D11 texture from/to image file with Windows Imaging Component
#pragma once
#define COBJMACROS
#include <windows.h>
#include <d3d11.h>
//
// interface
//
@JuanDiegoMontoya
JuanDiegoMontoya / opengl_resource_indexing.md
Last active February 3, 2026 18:42
How to do bindless in OpenGL without blowing your legs off.

The Definitive Guide to Non-Uniform Resource Indexing in OpenGL

Code

For those short on time:

#extension GL_NV_gpu_shader5 : enable
#extension GL_EXT_nonuniform_qualifier : enable

#ifdef GL_EXT_nonuniform_qualifier
#define NonUniformIndex(x) nonuniformEXT(x)
@Sharktheone
Sharktheone / Arch-Mojo.md
Last active December 10, 2024 14:08
Install the new mojo programming language on Arch. This will be obsolete when mojo adds official Arch support.
@silversquirl
silversquirl / .gitignore
Last active January 9, 2026 10:37
A fast, simple allocator for Zig
.zig-cache/
@Gavinok
Gavinok / AOC-d1.el
Created December 15, 2022 00:23
Emacs lisp solution for day one of advent of code 2022
(defun cals-per-elf ()
(with-temp-buffer
(progn (insert "((")
(insert-file-contents "~/res.txt")
(while (re-search-forward "^$" nil t)
(replace-match ")(" nil nil))
(end-of-buffer)(insert "))")
(goto-char 0))
(mapcar (lambda (food-carried)
(cl-reduce #'+ food-carried))