Skip to content

Instantly share code, notes, and snippets.

View jacmoe's full-sized avatar

Jacob Moena jacmoe

View GitHub Profile
@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.
@keenanwoodall
keenanwoodall / _ Raylib + microui for Odin.md
Last active August 31, 2025 23:05
Easy two-line raylib + microui integration for the Odin programming language

Odin + Raylib + microui

  1. Copy/paste rlmu.odin into an rlmu/ folder in your Odin project
  2. Import rlmu package import "rlmu"
  3. Import microui package import mu "vendor:microui"
  4. Call rlmu lifecycle procs like so:
main :: proc() {
    rl.SetWindowState({ rl.ConfigFlag.WINDOW_RESIZABLE })
 rl.InitWindow(720, 600, "Odin/Raylib/microui Demo")
@jakubtomsu
jakubtomsu / collision_3d.odin
Last active September 7, 2025 06:23
Simple raylib example of 3d FPS player movement with triangle collision
package main
import "core:fmt"
import "core:math"
import "core:math/linalg"
import rl "vendor:raylib"
main :: proc() {
rl.SetConfigFlags({.VSYNC_HINT, .WINDOW_RESIZABLE, .MSAA_4X_HINT})
rl.InitWindow(800, 600, "collision")
@cpbotha
cpbotha / init.el
Last active February 6, 2023 10:45
;; minimal version of my Emacs setup which approximates the effective points per inch on your screen
;; and then selects your default font pts based on that
;; Also works on wayland / WSLg because it parses out physical dims from weston.log (necessary in 2023-01)
;; LIMITATION: Will probably not work on multi-monitor setups. Exercise for the reader!
;; BSD 3-clause copyright Charl P. Botha <[email protected]>
(defun get-mon-attr (which)
(cdr (assoc which (car (display-monitor-attributes-list)))))
(defun get-monitor-width-mm ()
@tim-tx
tim-tx / qutebrowser_remap.py
Created August 14, 2021 00:45
Remap qutebrowser default keybindings to colemak
qwerty_to_colemak = {
'Q': 'Q',
'W': 'W',
'E': 'F',
'R': 'P',
'T': 'G',
'Y': 'J',
'U': 'L',
'I': 'U',
'O': 'Y',
@pianocomposer321
pianocomposer321 / colors.lua
Last active October 10, 2022 22:26
Feline.nvim config
-- ~/.config/nvim/lua/plugins/feline/colors.lua
-- One-dark colors
local _M = {
bg = '#2c323c',
fg = none,
yellow = '#e5c07b',
cyan = '#8abeb7',
darkblue = '#528bff',
green = '#98c379',
@ityonemo
ityonemo / test.md
Last active August 19, 2025 14:21
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@kylekatarnls
kylekatarnls / yii2-pug-php3
Created October 24, 2017 12:42
Pg-php 3 for Yii2 adapter
<?php
namespace rmrevin\yii\pug;
use Pug\Pug;
use Yii;
use yii\base\View;
use yii\helpers\FileHelper;
/**
@vcidst
vcidst / quotesOnCurses.py
Last active December 9, 2017 07:52
Structure of a curses application by [Sean Zicari](https://www.youtube.com/watch?v=eN1eZtjLEnU)
# This gist is transcribed from a talk by Sean Zicari
# Talk: Use Curses, don't swear https://www.youtube.com/watch?v=eN1eZtjLEnU
#
# I haven't written the function which he used to fetch quotes from the web
# This only presents the barebones structure of his application
#
# If debugging a curses application messes up your terminal, type `tset` to reset terminal
import curses
@squeek502
squeek502 / CMakeLists.txt
Last active November 5, 2024 15:44
Lua 5.3.x Windows CMake build script
project ( lua C )
cmake_minimum_required ( VERSION 2.8 )
include_directories ( src ${CMAKE_CURRENT_BINARY_DIR} )
set ( SRC_CORE src/lapi.c src/lcode.c src/lctype.c src/ldebug.c src/ldo.c src/ldump.c src/lfunc.c src/lgc.c src/llex.c
src/lmem.c src/lobject.c src/lopcodes.c src/lparser.c src/lstate.c src/lstring.c src/ltable.c
src/ltm.c src/lundump.c src/lvm.c src/lzio.c )
set ( SRC_LIB src/lauxlib.c src/lbaselib.c src/lbitlib.c src/lcorolib.c src/ldblib.c src/liolib.c
src/lmathlib.c src/loslib.c src/lstrlib.c src/ltablib.c src/lutf8lib.c src/loadlib.c src/linit.c )