Skip to content

Instantly share code, notes, and snippets.

@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 / robot_name.odin
Last active February 1, 2026 19:25
Solution for Robot Name in Odin on Exercism
package robotname
import "core:fmt"
import "core:math/rand"
MAX_ROBOT_NAMES :: 26 * 26 * 10 * 10 * 10
Robot_Storage :: struct {
names: [dynamic]string,
index: int,
@0riginaln0
0riginaln0 / get_in.lua
Created January 31, 2026 07:39
Get values from deeply nested tables
x = {
a = {
b = {
c = ";)"
}
}
}
print(x.a.b.c)
@0riginaln0
0riginaln0 / docgen.cr
Created January 18, 2026 07:56
Crystal script to generate local documentation for specified dependencies
require "file_utils"
require "wait_group"
# {name, link, refname}
DEPS = [
{"kemal", "https://github.com/kemalcr/kemal", "master"},
{"db", "https://github.com/crystal-lang/crystal-db", "master"},
{"sqlite3", "https://github.com/crystal-lang/crystal-sqlite3", "master"},
{"radix", "https://github.com/luislavena/radix", "master"},
{"backtracer", "https://github.com/Sija/backtracer.cr", "master"},
@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" }