Skip to content

Instantly share code, notes, and snippets.

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

howmanysmall

😎
pobam L+
  • Utah
View GitHub Profile
@howmanysmall
howmanysmall / iterable-weak-map.ts
Created October 18, 2024 21:28
iterable weak map
export default class IterableWeakMap<K extends WeakKey, V> implements Iterable<[K, V]> {
public constructor() {
this.finalizationRegistry = new FinalizationRegistry((reference: WeakRef<K>) => {
this.references.delete(reference);
this.referenceToValue.delete(reference);
});
}
public set(key: K, value: V) {
const reference = new WeakRef(key);
--!optimize 2
--!strict
local fs = require("@lune/fs")
local process = require("@lune/process")
local FileInstance = {}
FileInstance.ClassName = "FileInstance"
FileInstance.__index = FileInstance
local function Constructor(FilePath: string, FileName: string?)
{
"ExperienceMultiplier": 1
}
{
"ExperienceMultiplier": 1
}
9473567656,
13934778636,
5677059413,
7964908102,
10890146719,
9120652292,
7416424539,
9648474597,
10052561125,
10379922624,
const AXES = ["X" as const, "Y" as const, "Z" as const];
export default function axisIndexToVector3Property(axisIndex: number) {
return AXES[axisIndex];
}
--!optimize 2
--!strict
local fs = require("@lune/fs")
local process = require("@lune/process")
local stdio = require("@lune/stdio")
getfenv(1).Vector2 = {
new = function()
return {X = 0, Y = 0}
--!optimize 2
--!strict
local fs = require("@lune/fs")
local process = require("@lune/process")
local task = require("@lune/task")
local FileInstance = {}
FileInstance.__index = FileInstance
local function Constructor(FilePath: string, FileName: string?)
@howmanysmall
howmanysmall / React.lua
Created June 5, 2023 15:16
react bench
local HttpService = game:GetService("HttpService")
local React = require(script.Parent.Parent.Packages.Roact)
local tree
local function Component()
local value, setValue = React.useState("")
React.useEffect(function()
local connection = ReplicatedStorage:GetAttributeChangedSignal("Value"):Connect(setValue)
@howmanysmall
howmanysmall / can-backstab.lua
Last active April 6, 2023 16:14
determines if you can backstab
-- Compiled with roblox-ts v2.1.0
local NORMALIZER_VECTOR3 = Vector3.new(1, 0, 1)
local CanBackstab = function(attacker, victim)
local attackerHead = attacker:FindFirstChild("Head")
if attackerHead and attackerHead:IsA("BasePart") then
local victimHead = victim:FindFirstChild("Head")
if victimHead and victimHead:IsA("BasePart") then
local _exp = victim:GetPivot().Position * NORMALIZER_VECTOR3
local _arg0 = attacker:GetPivot().Position * NORMALIZER_VECTOR3
local attackerToVictim = (_exp - _arg0).Unit