Skip to content

Instantly share code, notes, and snippets.

View slonkazoid's full-sized avatar
💭
How do you get dark mode

slonkazoid slonkazoid

💭
How do you get dark mode
View GitHub Profile
// ==UserScript==
// @name Photopea Premium
// @namespace http://tampermonkey.net/
// @version 2024-02-03
// @description Unlock Photopea Premium by patching their JS
// @author mat
// @match https://www.photopea.com/
// @match https://www.photopea.com/?utm_source=homescreen
// @icon https://www.google.com/s2/favicons?sz=64&domain=photopea.com
// @grant GM_webRequest
@slonkazoid
slonkazoid / commands_in_particubes.lua
Last active November 4, 2021 17:01
Command parsing with arguments in Particubes
-- define your commands here
commands = {
help = {
description = "List all commands, or see one's description",
exec = function(cmd)
if cmd[2] ~= nil then -- if user supplied a command name
if commands[cmd[2]] ~= nil then -- and if that command exists
print(cmd[2] .. ": " .. commands[cmd[2]].description) -- print the command's description
else -- if it does not exist
print("Command not found: " .. cmd[2]) -- inform the user
@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