Skip to content

Instantly share code, notes, and snippets.

@MCJack123
MCJack123 / struct.lua
Last active February 21, 2025 23:12
Lua 5.3+ C struct parser library for declarative binary file serialization
-- MIT License
--
-- Copyright (c) 2023-2025 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:
@L0laapk3
L0laapk3 / fireworks.lua
Last active August 9, 2022 17:46
computercraft fireworks screensaver animation
-- Fireworks screensaver animation
-- By L0laapk3, based on Rectar's Fireworks
launchRate = 0.03
fireworks = {}
particles = {}
fcolors={1,2,4,8,16,32,64,512,1024,2048,8192,16384}
particleChars = {"#","X","+","*","."}
@MCJack123
MCJack123 / on-writing-an-os.md
Last active February 27, 2025 20:46
On Writing a ComputerCraft OS

On Writing a ComputerCraft OS

One of the most common projects I've seen for ComputerCraft is to write an operating system. People look at the limited command-line interface that CraftOS provides, and think, "I want this to work like my normal computer does!" Time and time again, a new post pops up on the ComputerCraft forums or Discord either announcing an OS, or asking for help with an OS, or releasing an OS. Usually, there are some very obvious flaws in these "OS"es, ranging from poor design choices, to overstating what they are and underdelivering. There are many common misunderstandings and undersights that newbie developers run into when writing an operating system, and these end up creating mediocre products at best.

A Critical Distinction

The term "OS" is thrown around a lot, and in my opinion it's very overused. According to [Wikipedia]: "An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs." However, m

@MCJack123
MCJack123 / modemshark.lua
Last active May 7, 2023 13:50
ModemShark: Modem packet sniffer for ComputerCraft
-- ModemShark: Modem packet sniffer for ComputerCraft
-- By JackMacWindows
-- Licensed under GPLv2+
local stackWindow, viewerWindow, lines, scrollPos
local w, h = term.getSize()
local selectedLine
local stack = {}
local file