Skip to content

Instantly share code, notes, and snippets.

Avatar
😎
pobam L+

howmanysmall

😎
pobam L+
View GitHub Profile
View BetterPages.lua
local BetterPages = {}
function BetterPages.new(Pages: Pages)
return setmetatable({Pages = Pages}, BetterPages)
end
function BetterPages.FromPcall(Success: boolean, ValueOrError: Pages | string)
if Success then
return true, setmetatable({Pages = ValueOrError}, BetterPages)
else
View Simplex.ts
const GRAD_3 = [
[1, 1, 0],
[-1, 1, 0],
[1, -1, 0],
[-1, -1, 0],
[1, 0, 1],
[-1, 0, 1],
[1, 0, -1],
[-1, 0, -1],
[0, 1, 1],
View EdgeRounded.lua
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Llama = require(ReplicatedStorage.Shared.Vendor.Llama)
local Roact = require(ReplicatedStorage.Shared.Vendor.Roact)
local Types = require(ReplicatedStorage.Shared.Types)
export type IEdgeRoundedProps = {
-- EdgeRounded Properties
RoundedEdge: "Bottom" | "Left" | "Right" | "Top",
} & Types.IImageLabelProps
@howmanysmall
howmanysmall / Lzw2.lua
Last active May 24, 2022
Fastest (?) Lzw on Luau
View Lzw2.lua
local Memoize = require(script.Memoize)
local StringRep = require(script.StringRep)
--[=[
A utility library for compressing strings with LZW. This was made as fast
as possible by using fun tricks like *lots* of memoization.
@class Lzw
]=]
local Lzw = {}
View Test.lua
local BoxMeta = {}
BoxMeta.__index = BoxMeta
function BoxMeta:get()
return self._value
end
function BoxMeta:set(v)
self._value = v
end
View ScaleFusion.lua
local Workspace = game:GetService("Workspace")
local GuiService = game:GetService("GuiService")
local Fusion = require("Fusion")
local Janitor = require("Janitor")
local TopInset, BottomInset = GuiService:GetGuiInset()
export type Properties = {
Scale: number?,
View ExportType.lua
local Class = {}
Class.__index = Class
function Class:Destroy()
setmetatable(self, nil)
end
function Class:Method()
return 1
end
@howmanysmall
howmanysmall / Thread.lua
Last active Aug 4, 2021
for a quick fix
View Thread.lua
local EnumList = require(script.Parent.EnumList)
local Timer = require(script.Parent.Timer)
local Thread = {}
Thread.DelayRepeatBehavior = EnumList.new("DelayRepeatBehavior", {"Delayed", "Immediate"})
function Thread.SpawnNow(func, ...)
local args = table.pack(...)
task.spawn(function()
func(table.unpack(args, 1, args.n))
View BasicState.lua
local BindableEvent = require("BindableEvent")
local StringRep = require("StringRep")
local Symbol = require("Symbol")
local BasicState = {}
BasicState.ClassName = "BasicState"
BasicState.None = Symbol.new("BasicState.None")
BasicState.__index = BasicState
local BindableEvent_new = BindableEvent.new
View startup.lua
local Immutable = require("Immutable")
local string_format = string.format
local string_find = string.find
local string_sub = string.sub
local tostring = tostring
local type = type
local NewMath = {}