Skip to content

Instantly share code, notes, and snippets.

-- light
local style = require "core.style"
local common = require "core.common"
local NIGHT_MODE_INTENSITY = 30 -- [0, 1, ... 100]
local function clamp(min, max, value)
return math.max(min, math.min(max, value))
end
-- mod-version:3
local core = require "core"
local command = require "core.command"
local keymap = require "core.keymap"
-------------------
-- Configuration --
-------------------
##
PersistentVector
32-way persistent vector, equivalent to Clojure's PersistentVector.
Public API:
Instantiation:
let vec = PersistentVector.empty()
@0riginaln0
0riginaln0 / frequration.lua
Last active July 25, 2026 14:11
Lua library for duration and frequencies unit-aware time arithmetic
--[[
-- ===========
-- Usage
-- ===========
local F = require("frequration")
-- Full list of avaliable constructors can be found in the source code.
F.register_globals()
-- ======================================================
@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,
}