Skip to content

Instantly share code, notes, and snippets.

View Earu's full-sized avatar
🤸‍♂️
Making LLMs actually useful.

Ryan Earu

🤸‍♂️
Making LLMs actually useful.
  • France
View GitHub Profile
@Earu
Earu / Shader.tsx
Created October 10, 2024 08:46
A react component capable of rendering webgl shaders
import { createRef, HTMLAttributes, useEffect, useState } from "react"
const positions = [
-1, -1, // Bottom left
1, -1, // Bottom right
-1, 1, // Top left
1, 1 // Top right
];
function createShader(gl: WebGLRenderingContext, type: GLenum, source: string): WebGLShader | null {
@Earu
Earu / simple_profiler.lua
Created October 10, 2024 13:06
Dead simple profiler in Lua
local profiler = {
call_stack = {}, -- Stack to keep track of active function calls
timings = {}, -- Stores the total time spent in each function
call_counts = {} -- Stores how many times each function was called
}
local function get_time()
return os.clock()
end
@Earu
Earu / water_scanner.lua
Created May 19, 2025 17:42
Scan Garry's Mod maps for bodies of water for various things.
--[[
THIS IS A LIBRARY THAT SCANS FOR THE SURFACE OF BODIES OF WATER IN A SECLUDED AREA.
IT IS USED TO FIND RANDOM POSITIONS IN WATER FOR ENTITIES TO SPAWN IN.
OR TO CHECK IF A SPECIFIC POSITION IS IN WATER.
/!\ IT IS HIGHLY RECOMMENDED TO CALL THIS FUNCTION ONCE AND STORE THE RESULT AS IT A VERY INTENSIVE FUNCTION!
EXAMPLE USAGE:
local origin = landmark.get("land_fish1") -- The origin point of the scan
local scan_precision = 100 -- The precision of the scan, higher = more accurate but slower