Skip to content

Instantly share code, notes, and snippets.

View oatmealine's full-sized avatar
🔨
conk2.ogg

jade oatmealine

🔨
conk2.ogg
View GitHub Profile
-- constants
SCREEN_WIDTH = 24
SCREEN_HEIGHT = 24
sw, sh = SCREEN_WIDTH, SCREEN_HEIGHT
-- timer
local ticks = 0
local time = 0
@oatmealine
oatmealine / example.lua
Created February 26, 2022 15:37
Simple, fast Lua uwu-ifier
local uwuify = require 'uwu'
assert(uwuify('really') == 'weawwy')
@oatmealine
oatmealine / smelte.lua
Created April 5, 2022 03:11
smelte - a very, very dumb proof-of-concept Lua DSL HTML framework
-- smelte 1.0
-- a very, very dumb proof-of-concept Lua DSL HTML framework
--
-- smelte.declare 'name' (function() return span 'custom element' end)
-- -> void
-- declares a custom element
--
-- smelte.compile (function() return
-- {
-- head = {
@oatmealine
oatmealine / random-values-in-isaac.md
Created May 2, 2022 20:03
I want to get a random value in Isaac!

I want to get a random value in Isaac!

Well I'm glad you asked, because this simple question has many anwsers depending on how much effort you want to put in!

There are 3 types of random you can use in Isaac, going from the one that requires the least amount of effort to the one that requires the most amount of effort. There is no "objectively best" method, as it depends on your usecase, the size of your mod, and how much you truly care.

Why?

For this guide, let's assume your usecase is for adding a random vector to an entity's velocity:

local sm = {}
local function filterComments(text)
local lines = {}
for line in string.gmatch(text, '([^\n\r]*)[\n\r]?') do
if not string.match(line, '^%s*//.+') and string.len(line) > 0 then
table.insert(lines, line)
end
end
return table.concat(lines, '\n')
@oatmealine
oatmealine / xdrv.lua
Last active October 2, 2024 13:41
Lua type definitions for EX-XDRiVER
---@meta
xdrv = {}
-- 0. https://github.com/tari-cat/XDRV/blob/main/Assets/Scripts/XDRVEditorScripts/ChartMod.cs#L90
-- 1. /ChartModLookup\.Add\("/ -> ''
-- 2. /", ChartModType\..+\)/ -> ''
-- 3. /^//.+/ -> ''
-- 4. /^([\w]+);\n+/ -> ''$1' | '
---@alias xdrv.ModName 'speed' | 'camera_position_x' | 'camera_position_y' | 'camera_position_z' | 'camera_rotation_x' | 'camera_rotation_y' | 'camera_rotation_z' | 'camera_move_x' | 'camera_move_y' | 'camera_move_z' | 'camera_rotate_x' | 'camera_rotate_y' | 'camera_rotate_z' | 'camera_fov' | 'camera_field_of_view' | 'note_move_x' | 'note_move_y' | 'note_move_z' | 'note_rotate_x' | 'note_rotate_y' | 'note_rotate_z' | 'note1_move_x' | 'note1_move_y' | 'note1_move_z' | 'note1_rotate_x' | 'note1_rotate_y' | 'note1_rotate_z' | 'note2_move_x' | 'note2_move_y' | 'note2_move_z' | 'note2_rotate_x' | 'note2_rotate_y' | 'note2_rotate_z' | 'note3_move_x' | 'note3_move_y' | 'note3_move_z' | 'note3_rotate_x' | 'note3_rotate_y' | 'note3_rotate_z' | 'note4_move_x' | 'note4_move_y' |
@oatmealine
oatmealine / sbox.lua
Last active January 15, 2025 12:36
Sandboxing library implemented according to the Metafields specification (v0, draft)
-- Public domain Lua sandboxing library intended for use with parsing Metafields
-- files. Made by Jade "oatmealine"
local _M = {}
local ALLOWED_MODULES = {
'math', 'os', 'coroutine', 'string', 'table'
}
local ALLOWED_GLOBAL_FUNCTIONS = {
'tonumber', 'tostring', 'print', 'pairs', 'ipairs', 'assert', 'error',