Skip to content

Instantly share code, notes, and snippets.

View howmanysmall's full-sized avatar
😎
pobam L+

howmanysmall

😎
pobam L+
  • Utah
View GitHub Profile
local function GetService(ServiceName: string)
return game:GetService(ServiceName)
end
local ServicesMetatable = {}
function ServicesMetatable:__index(Index)
local Success, Object = pcall(GetService, Index)
local Service = Success and Object
self[Index] = Service
return Service
export default class ObjectPool<T extends object> {
public ExpansionSize = 5;
public Generator: () => T;
public Cleaner: (object: T) => void;
public Reserve: Array<T>;
public InUse: Array<T>;
public constructor(precreateAmount: number, generator: () => T, cleaner: (object: T) => void) {
this.Generator = generator;
$Key = "HKCU:\Software\ROBLOX Corporation\Environments\roblox-player"
while ($true)
{
$CurrentValue = (Get-ItemProperty -Path $Key -Name "LaunchExp").LaunchExp
if ($CurrentValue -eq "InApp")
{
#Write-Output "Value is InApp."
Set-ItemProperty -Path $Key -Name "LaunchExp" -Value "InBrowser"
}
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
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],
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 December 31, 2022 23:33
Fastest (?) Lzw on Luau
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 = {}
local BoxMeta = {}
BoxMeta.__index = BoxMeta
function BoxMeta:get()
return self._value
end
function BoxMeta:set(v)
self._value = v
end
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?,
local Class = {}
Class.__index = Class
function Class:Destroy()
setmetatable(self, nil)
end
function Class:Method()
return 1
end