Skip to content

Instantly share code, notes, and snippets.

@0riginaln0
0riginaln0 / why.lua
Last active March 28, 2026 15:35
Lua... why?
pp = function(t)
print("{ " .. table.concat(t, ", ") .. " }")
end
a = function() return 1, 2 end
b = function() return 11, 12 end
pp { a(), b(), "why?"} -- { 1, 11, "why?" }
@0riginaln0
0riginaln0 / packer.lua
Created March 11, 2026 10:32
Pack the Lua files in the current folder into an archive and unpack the archive
local function unzip(input_path)
-- Open the archive file for reading
local archive_file = io.open(input_path, "r")
if not archive_file then
error("Could not open file: " .. input_path)
end
local current_file = nil
local current_content = {}
@0riginaln0
0riginaln0 / lite-light.focus-theme
Last active March 8, 2026 12:46
Port of Lite themes for Focus editor
[16] # Version number. Do not delete.
# Based on the original Lite Light theme:
# https://github.com/pragtical/colors/blob/master/colors/lite-light.lua
[colors]
background0: F5F5F5FF
background1: E0E0E0FF
background2: E0E0E0FF
background3: E0E0E0FF
@0riginaln0
0riginaln0 / a.moon
Created March 8, 2026 07:26
MoonScript and Python comparison
------------------
-- Basic Syntax --
------------------
if condition
do_something!
do_another_thing!
else
do_different_thing!
@0riginaln0
0riginaln0 / language_bolt.lua
Last active November 2, 2025 09:51
Syntax highlighting for Bolt for Lite XL
-- mod-version:3
local syntax = require "core.syntax"
--[[
Here is the list of all pattern types which could be used in themes:
normal
symbol
comment
keyword
@0riginaln0
0riginaln0 / fsm.odin
Created September 7, 2025 04:20
Odin FSM example via Enumerated arrays
package main
import "core:fmt"
States :: enum {
initial,
state_1,
state_final,
}
@0riginaln0
0riginaln0 / jpegs_to_pdf.py
Created July 18, 2025 10:01
create pdf from images
# pip install fpdf
from fpdf import FPDF
# List of JPEG image filenames
image_filenames = [
"1.jpeg",
"2.jpeg",
"3.jpeg",
"4.jpeg",
] # Replace with your image filenames
@0riginaln0
0riginaln0 / default-light.lua
Last active February 18, 2026 17:20
Default Light Theme for Lite XL
local style = require "core.style"
local common = require "core.common"
style.background = { common.color "#f5f5f5" } -- Docview
style.background2 = { common.color "#e0e0e0" } -- Treeview
style.background3 = { common.color "#e0e0e0" } -- Command view
style.text = { common.color "#333333" }
style.caret = { common.color "#0078D7" }
style.accent = { common.color "#0078D7" }
style.dim = { common.color "#a0a0a0" }
@0riginaln0
0riginaln0 / dynamic_from_static.odin
Last active March 25, 2025 11:23
Dynamic array interface for a statically allocated array.
package main
// odin run dynamic_from_static.odin -file
import "core:fmt"
import "core:slice"
MY_STATIC_ARRAY_LENGTH :: 6
MY_STATIC_ARRAY: [MY_STATIC_ARRAY_LENGTH]int
@0riginaln0
0riginaln0 / input.zig
Created March 14, 2025 09:04
Input handling "library" in Zig for WASM-4
const w4 = @import("wasm4.zig");
pub const Input = struct {
previous_frame_gamepad: u8,
current_frame_gamepad: u8,
previous_frame_mouse: u8,
current_frame_mouse: u8,
previous_frame_mouse_x: i16,