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
@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 August 5, 2025 20:59
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
//
@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 October 2, 2024 20:30
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))
@gingerBill
gingerBill / odin.ebnf
Last active July 16, 2025 23:29
Odin EBNF (Work In Progress)
/* characters */
newline = /* the Unicode code point U+000A */ .
unicode_char = /* an arbitrary Unicode codepoint except newline */ .
unicode_letter = /* a Unicode code point categorized as "Letter" */ .
unicode_digit = /* a Unicode code point categorized as "Number, decimal digit" */ .
letter = unicode_letter | "_" .
decimal_digit = "0" ... "9" .
binary_digit = "0" | "1" .
@tilacog
tilacog / transaction_manager.rs
Created October 20, 2022 22:49
Transaction manager
use std::time::{Duration, Instant};
/// How many confirmations to wait for
const REQUIRED_CONFIRMATIONS: u32 = 1;
const WAIT_TIME_IN_SECONDS: u64 = 60;
const HARD_TIMEOUT_FACTOR: u64 = 10;
/// Time before giving up on waiting for transaction confirmation. After this time, we expect the
/// Transaction Monitor to bump the gas price and re-broadcast the transaction.