Skip to content

Instantly share code, notes, and snippets.

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

jill oatmealine

🔨
conk2.ogg
View GitHub Profile
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 / 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:

@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 / example.lua
Created February 26, 2022 15:37
Simple, fast Lua uwu-ifier
local uwuify = require 'uwu'
assert(uwuify('really') == 'weawwy')
-- constants
SCREEN_WIDTH = 24
SCREEN_HEIGHT = 24
sw, sh = SCREEN_WIDTH, SCREEN_HEIGHT
-- timer
local ticks = 0
local time = 0

A metatable can be defined like

local t = setmetatable({}, {
  __tostring = function() return 'custom tostring behavior!' end
})

Here are the metamethods that you can define, and their behavior

Operators

@oatmealine
oatmealine / formulas.js
Created December 27, 2021 19:11
Formulas.exe but in plain JS
// skills
function calculateSkill(exp, mult = 1) {
return Math.max(Math.floor(mult * (32 * Math.log(exp + 534.5) - 200)), 1);
}
function calculateExp(skill, mult = 1) {
return Math.exp((skill / mult + 200) / 32) - 534.6;
}
@oatmealine
oatmealine / .luacheckrc
Created October 30, 2021 03:51
Luacheck config meant to be used for Isaac modding
-- isaac-related luacheck config
-- please use luacheck while possible!!
-- if you disagree with any of the policies given here
-- id suggest you discuss it with the team before you change it
-- (unless its a global mistake or similar)
return {
-- isaac has lots of globals and doesnt just drop them into one Isaac
-- namespace like the name would imply. fun!
// rhythmbox database collage tool
//
// dependencies: jimp, xml-js
//
// this code is licensed under a [copyleft](https://en.wikipedia.org/wiki/Copyleft) license: this code is completely okay to modify, copy, redistribute and improve upon, as long as you keep this license notice
// ↄ Jill "oatmealine" Monoids 2021
const Jimp = require('jimp');
const fs = require('fs');
const { xml2js } = require('xml-js');
@oatmealine
oatmealine / categories.json
Last active December 5, 2020 01:31
notitg template analyzer script
[
{
"name": "unknown",
"checks": []
},
{
"name": "no template",
"checks": [
{
"type": "filecontent",