A collection of Luau snippets that can be copied and pasted directly into your code.
Decodes a URL-encoded string back into human-readable characters.
UrlDecode("https%3A%2F%2Fcreate%2Eroblox%2Ecom") -- "https://create.roblox.com"
--!strict | |
export type IFont = { | |
AssetId: string, | |
Name: string, | |
Aliases: { string }, | |
Weights: { Enum.FontWeight }, | |
Styles: { Enum.FontStyle }, | |
} | |
local fonts: { IFont } = { |
A collection of JavaScript snippets, mostly used in custom UserScripts.
You can paste them into your code directly, or @require
them using the GitHub raw link.
// equivalent to `const container = document.querySelector("div.container")`
const container = $("div.container")
# Converts a Shortcut to a Symbolic Link. | |
# Place this somewhere on your PATH. | |
# | |
# Usage: | |
# $ to-symlink .\path-to-shortcut.lnk | |
# Converted ".\path-to-shortcut.lnk" to symlink. | |
$obj = New-Object -ComObject WScript.Shell | |
function Convert-ShortcutToSymlink { | |
param ( |
This has been replaced with
default-props
. See the project page here:
A small utility module for creating React/Roact components with default props.
--!strict | |
--[[ | |
Provides a set of functions for comparing semver strings. | |
See https://semver.org/ for more information. | |
Types: | |
type SemverRecord = { | |
major: number, | |
minor: number, | |
patch: number, |
Displays a popup with additional information when hovering over user or group links on the Roblox website.
A custom fetch
/GM_xmlhttpRequest
wrapper for UserScripts.
Extends the default fetch
options.
If using GM_xmlhttpRequest
(useFetch: false
), the timeout is 60 seconds.
local function parseImageString(imageString: string) | |
local contentId = imageString:match("(%w+://%S+)") | |
local width = tonumber(select(1, imageString:match("[wW](%d+)"))) | |
local height = tonumber(select(1, imageString:match("[hH](%d+)"))) | |
local x = tonumber(select(1, imageString:match("[xX](%d+)"))) | |
local y = tonumber(select(1, imageString:match("[yY](%d+)"))) | |
local color = imageString:match("(#%x+)") | |
local transparency = tonumber(select(1, imageString:match("(%d+)%%"))) |
type Set<T> = { [T]: true } | |
-- Asymmetric difference | |
local function difference<V>(set: Set<V>, ...: Set<V>): Set<V> | |
local diff = table.clone(set) | |
for index, nextSet in { ... } do | |
for value in nextSet do | |
diff[value] = nil | |
end |