Skip to content

Instantly share code, notes, and snippets.

View EngineerSmith's full-sized avatar
🔧
🦆

Engineer Smith EngineerSmith

🔧
🦆
View GitHub Profile
local patterns = {
boot = "%[love \"boot%.lua\"%]:%d+:",
callbacks = "%[love \"callbacks%.lua\"%]:%d+:",
}
local match = function(line, pattern)
return type(line) == "string" and line:find(pattern)
end
local filterPatterns = {
@EngineerSmith
EngineerSmith / MintMouse's traceback cleanup.lua
Created November 6, 2025 20:22
Snippet of MintMouse's traceback cleanup function
local filterPatterns = {
{ -- Remove the `logger.error` instance call
pattern = "/logger/init%.lua:%d+: in function 'error'",
condition = function(lines, i)
local previousLine = lines[i-1]
return love.mintmousse._insideError and type(previousLine) == "string" and previousLine:find("%[C%]: in function 'error'")
end,
counts = 1,
},
{ -- Remove the `love.errorhandler` call
@EngineerSmith
EngineerSmith / conf.lua
Last active September 6, 2025 21:20
Add custom hitTest SDL via ffi calls - for love2d
love.conf = function(t)
t.window.borderless = true
end
name: Build for web
on:
push:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest

This is a workaround for an issue in Wiki.js v3-alpha (and likely earlier versions) where a "Cannot find package 'pako'" error occurs when trying to render the page. As discussed in requarks/wiki#7096.

Quick fix

The quickest way to resolve this is to manually install the pako package within the Wiki.js Docker container.

Using docker-compose:

docker-compose exec wiki npm install pako

After running this command, you may need to re-save the affected page to trigger a successful render.

Love Jam 2024

Theme: Interface

Core Mechanics

Limb Removal and Grafting

  • Players can freely remove and attach limbs to themselves or their partner. Different limbs offer unique abilities:
    • Legs: Standard movement speed, jumping, climbing.
    • Arms: Grabbing objects, manipulating switches, throwing limbs.
    • Heads: Special abilities. (?)
@EngineerSmith
EngineerSmith / main.lua
Last active February 14, 2024 20:33
Adds color back into text wrapped by font:getWrap
getWrapColored = function(font, text, limit)
local width, wrappedText = font:getWrap(text, limit)
local wrappedTextColored, textIndex = { }, 1
local currentColoredText, color = text[textIndex+1], text[textIndex]
for i, line in ipairs(wrappedText) do -- for each line
wrappedTextColored[i] = { }
while true do
-- if line fits within the current color string
if #line <= #currentColoredText then
table.insert(wrappedTextColored[i], color)
local dict = {
"commonly",
"used",
"strings", -- these strings, are not just values but keys too in a table!
}
-- send dict to client from server, so they are in sync and can decode the messages
local buffer = require("string.buffer)"
local data = buffer.encode(dict) -- send string to client, and do buffer.decode on it, so it can use it same as the server
-- recive dict, or already has dict if the server
@EngineerSmith
EngineerSmith / button.lua
Created July 8, 2022 12:12
Modules for android buttons - doesn't handle scaling for you; you can add that
local input = require("input")
local button = { }
button.__index = button
button.new = function(x, y, w, h)
return setmetatable({ x = x, y = y, w = w, h = h}, button)
end
button.setTapCallback = function(self, callback, ...)
-- Copyright 2015 Paul Kulchenko, ZeroBrane LLC; All rights reserved
local updateneeded
local indicator = 12
return {
name = "Highlight selected",
description = "Highlights all instances of a selected word.",
author = "Paul Kulchenko",
version = 0.11,
dependencies = 0.71,