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