Skip to content

Instantly share code, notes, and snippets.

#version 300 es
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
out vec4 fragColor;
uniform vec2 resolution;
uniform vec3 orientation;
@erikyuzwa
erikyuzwa / CMakeLists.txt
Last active March 22, 2025 18:26
CMakeLists.txt for SDL3 projects
# CMakeLists.txt project file for SDL3 projects
#
# NB: SDL_image, SDL_ttf and SDL_mixer are not yet tagged properly
# in github to be included via this fetch mechanism.
# As they are updated, I will endevour to keep this gist updated
cmake_minimum_required(VERSION 3.30)
project(hello_sdl3_with_cmake C)
set(CMAKE_C_STANDARD 23)

From Zigling 058.

//                          u8  single item
//                         *u8  single-item pointer
//                        []u8  slice (size known at runtime)
//                       [5]u8  array of 5 u8s
//                       [*]u8  many-item pointer (zero or more)
//                 enum {a, b}  set of unique values a and b
//                error {e, f}  set of unique error values e and f
@GuvaCode
GuvaCode / collision_3d.odin
Created August 22, 2023 17:39 — forked from jakubtomsu/collision_3d.odin
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")
@sumofat
sumofat / collision_3d.odin
Created August 19, 2023 15:21 — forked from jakubtomsu/collision_3d.odin
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")
@raohmaru
raohmaru / requestAnimationFrame.js
Last active January 28, 2024 19:04
requestAnimationFrame() in node.js
const callbacks = [];
const fpsInterval = 1000 / 60;
let time = performance.now();
function requestAnimationFrameLoop() {
const now = performance.now();
const delta = now - time;
if (delta >= fpsInterval) {
// Adjust next execution time in case this loop took longer to execute
time = now - (delta % fpsInterval);
@artokun
artokun / Hierarchy.txt
Last active April 17, 2025 09:41
Godot 4 3D RTS Camera Controller
World (Node3D)
|- RTSController (Node3D)
|- Elevation (Node3D)
|- MainCamera (Camera3D)
@mccutchen
mccutchen / .envrc
Last active January 30, 2025 14:48
Example direnv .envrc for Python projects that manages a local virtualenv that updates automatically when requirements.txt changes
#!/bin/bash
set -euo pipefail
VIRTUAL_ENV=".venv"
REQUIREMENTS_HASH_FILE="$VIRTUAL_ENV/requirements.shasum"
REQUIREMENTS_HASH_FUNC="shasum"
REQUIREMENTS_HASH_VAL=$($REQUIREMENTS_HASH_FUNC requirements.txt | cut -d ' ' -f 1)
function reset_venv() {
if ! has uv; then
@DGriffin91
DGriffin91 / main.rs
Last active April 20, 2025 21:00
Bevy Combine Meshes with Transforms
// License: Apache-2.0 / MIT
// Combine multiple meshes in Bevy with Transforms
// Adapted from https://github.com/bevyengine/bevy/blob/main/examples/3d/3d_shapes.rs
use std::f32::consts::PI;
use bevy::{
math::Vec4Swizzles,
prelude::*,
render::{
@koakh
koakh / gist:fbbc37cde630bedcf57acfd4d6a6956b
Last active March 24, 2025 14:40
SurrealDB : How to use signin and signup (server + client nodesjs)
**As a developer you have complete control over the signup and signin functionality...**
```shell
$ surreal sql --conn http://localhost:8000 --user root --pass root --ns test --db test
```
```sql
-- optional : this is the default see --ns test --db test start server flags
-- USE NS test DB test;