Skip to content

Instantly share code, notes, and snippets.

View LolloDev5123's full-sized avatar
☣️

LolloDev LolloDev5123

☣️
  • Indirecta
  • Italy
  • 04:10 (UTC +01:00)
View GitHub Profile
@Alexior3000
Alexior3000 / BASIC2.0.lua
Last active September 11, 2024 16:28
Chat GPT Version of the commodore basic (simple)
local variables = {}
local program = {}
local running = false
local totalMemory = 38911 -- Pamięć BASIC w Commodore 64 w bajtach
local basicBytesFree = totalMemory
local programName = ""
-- Funkcja do obliczania ilości wolnej pamięci
local function calculateFreeMemory()
local usedMemory = 0
@TheGreatSageEqualToHeaven
TheGreatSageEqualToHeaven / LuauAllOpcodes.luau
Last active November 28, 2025 04:45
Hellborn abomination
-- LOP_BREAK, LOP_COVERAGE and LOP_NOP aren't possible without the C API
-- Vector constants are supported but need to be commented in and need the ctor renamed
-- LOADKX and JUMPX support can be commented out
---------------------------------------------------------------------------------------
-- PREPVARARGS
local a = "hello world"; -- LOADK
a,a,a,a,a,a = nil, true, false, 1, 9e9, function() --[[ RETURN ]] end; -- LOADNIL, LOADB 1, LOADB 0, LOADN 1, LOADK 9e9, DUPCLOSURE (no captures)
FUNC_GLOBAL = newproxy; -- GETIMPORT, SETGLOBAL
local t = { }; -- NEWTABLE 1 1
local function stub() -- NEWCLOSURE (ref, val, ref captures)
@MCJack123
MCJack123 / taskmaster.lua
Last active December 11, 2025 01:52
Taskmaster: A simple and highly flexible task runner/coroutine manager for ComputerCraft
-- Taskmaster: A simple and highly flexible task runner/coroutine manager for ComputerCraft
-- Supports adding/removing tasks, early exits for tasks, event white/blacklists, automatic
-- terminal redirection, task pausing, promises, and more.
-- Made by JackMacWindows
-- Licensed under CC0 in the public domain
--[[
Examples:
- Run three functions in parallel, and wait for any to exit.
@TheGreatSageEqualToHeaven
TheGreatSageEqualToHeaven / LuaVersion.lua
Last active November 2, 2025 19:49
Runtime Lua version detection without _VERSION
local function luaVersion()
local f = function()
return function() end
end
if 0xffffffffffffffffffffffffffffffffffffffffffffff == 2 ^ 64 then
return "Luau"
end
if ({nil,[1] = true})[1] then
@TheGreatSageEqualToHeaven
TheGreatSageEqualToHeaven / LuauOptimizeLevel.lua
Created March 28, 2024 01:34
Getting the Luau optimize level at runtime safely
local function getOptimizeLevel()
local function dupclosure()
return function() end
end
local O0 = dupclosure() ~= dupclosure()
local function inlinefunction()
return debug.info(1, "f")
end
@afonya2
afonya2 / AES.lua
Last active May 29, 2024 12:56
an AES implementation for CC: Tweaked
-- Advanced Encryption Standard (AES) libary for CC: Tweaked
-- ©️ 2024 afonya All rights reserved.
-- MIT License
-- Link: https://gist.github.com/afonya2/489c3306a7d85f8f9512df321d904dbb
-- Documentation: https://gist.github.com/afonya2/489c3306a7d85f8f9512df321d904dbb#file-docs-md
-- Last updated: February 25 2024
local SBox = {[0]=99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118,
202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192,
183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21,
4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117,
@MineRobber9000
MineRobber9000 / basic.lua
Last active August 29, 2024 17:38
Dartmouth BASIC interpreter
local functions = {}
for v in ("ABS ATN COS EXP INT LOG RND SIN SQR TAN "):gmatch("(.-) ") do
functions[v]=true
end
for c in ("ABCDEFGHIJKLMNOPQRSTUVWXYZ"):gmatch("(.)") do
functions["FN"..c]=true
end
local statements = {}
for v in ("LET PRINT END READ DATA GOTO IF FOR NEXT GOSUB RETURN DEF DIM REM STOP INPUT "):gmatch("(.-) ") do
statements[v]=true
@MCJack123
MCJack123 / ans.lua
Last active August 29, 2024 17:41
Tabled Asymmetrical Numeral Systems (aka Finite State Entropy) for Lua 5.2 (PoC)
-- Tabled Asymmetrical Numeral Systems (aka Finite State Entropy) for Lua 5.2
--
-- MIT License
--
-- Copyright (c) 2023 JackMacWindows
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@MCJack123
MCJack123 / M6502.lua
Created March 17, 2023 07:05
MOS 6502 emulator written in pure Lua
-- MIT License
--
-- Copyright (c) 2018-2022 JackMacWindows
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
@Gimanua
Gimanua / base64.lua
Last active August 6, 2023 13:43
Computercraft Teletext
--[[
base64 -- v1.5.3 public domain Lua base64 encoder/decoder
no warranty implied; use at your own risk
Needs bit32.extract function. If not present it's implemented using BitOp
or Lua 5.3 native bit operators. For Lua 5.1 fallbacks to pure Lua
implementation inspired by Rici Lake's post:
http://ricilake.blogspot.co.uk/2007/10/iterating-bits-in-lua.html