Skip to content

Instantly share code, notes, and snippets.

@noche-x
noche-x / website_template.lua
Created October 14, 2022 21:59
RosaWorld Website Template
-- Creating text
--- Call the function `site:text(text: string, style?: table) to draw text.
-- Putting custom text styles
--- Call 'site:text' with the second parameter ('style') with a table full of styles you want.
-- Text Styles
--- center: boolean | Centers the text.
--- foregroundColor: integer | Foreground color of the text.
--- backgroundColor: integer | Background color of the text.
@jrus
jrus / lua-uuid.lua
Created July 29, 2012 09:26
quick lua implementation of "random" UUID
local random = math.random
local function uuid()
local template ='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
return string.gsub(template, '[xy]', function (c)
local v = (c == 'x') and random(0, 0xf) or random(8, 0xb)
return string.format('%x', v)
end)
end