Skip to content

Instantly share code, notes, and snippets.

View grilme99's full-sized avatar
๐Ÿ’œ
:o

Brooke Rhodes grilme99

๐Ÿ’œ
:o
View GitHub Profile
@boatbomber
boatbomber / release.luau
Last active April 8, 2025 22:54
Release workflow using Lune
--[[
release.luau - A Lune script for publishing Roblox games
MPL 2.0 License
(c) 2024, Zack Ovits
usage: lune run release
--]]
-- Lune libraries
local stdio = require("@lune/stdio")
--bresenham line walk
function MathUtils:BresLine(x0, y0, x1, y1, callback)
local sx,sy,dx,dy
if x0 < x1 then
sx = 1
dx = x1 - x0
else
@dphfox
dphfox / Flex.lua
Last active February 28, 2024 10:51
--[[
A special key for property tables.
When applied to a UIListLayout, enables flexible sizing on the laid out UI
objects.
When applied to a GuiObject in a [Flex]-ed UIListLayout, opts the object
into flexible sizing - the object's size will be overwritten along the
direction of layout to fill up spare space.
@boatbomber
boatbomber / GlobalStorage.lua
Last active March 6, 2025 09:08
This is a module for handling data that can be read from/written to from multiple servers at a time. It is made only for commutative updates. This is so that your operations can be applied locally and globally at different times and still end up at the same value eventually. Uses MemoryStore for atomic locking.
--[[
GlobalStorage
by boatbomber (c) 2021
This is a module for handling data that can be read from/written to
from multiple servers at a time. It is made only for commutative updates.
This is so that your operations can be applied locally and globally at different
times and still end up at the same value eventually. Uses MemoryStore for atomic locking.
@stravant
stravant / GoodSignal.lua
Last active May 4, 2025 08:59
Good Roblox Signal Implementation
--------------------------------------------------------------------------------
-- Batched Yield-Safe Signal Implementation --
-- This is a Signal class which has effectively identical behavior to a --
-- normal RBXScriptSignal, with the only difference being a couple extra --
-- stack frames at the bottom of the stack trace when an error is thrown. --
-- This implementation caches runner coroutines, so the ability to yield in --
-- the signal handlers comes at minimal extra cost over a naive signal --
-- implementation that either always or never spawns a thread. --
-- --
-- API: --
@EgoMoose
EgoMoose / RthroScaleFix.lua
Last active October 24, 2024 16:16
Adjusts Roblox Rthro avatars so that their height scales match a 5 stud high R15 rig
--[[
MIT License
Copyright (c) 2021 EgoMoose
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@evaera
evaera / Clean Code.md
Last active May 5, 2025 00:31
Best Practices for Clean Code
  1. Use descriptive and obvious names.
    • Don't use abbreviations, use full English words. player is better than plr.
    • Name things as directly as possible. wasCalled is better than hasBeenCalled. notify is better than doNotification.
    • Name booleans as if they are yes or no questions. isFirstRun is better than firstRun.
    • Name functions using verb forms: increment is better than plusOne. unzip is better than filesFromZip.
    • Name event handlers to express when they run. onClick is better than click.
    • Put statements and expressions in positive form.
      • isFlying instead of isNotFlying. late intead of notOnTime.
      • Lead with positive conditionals. Avoid if not something then ... else ... end.
  • If we only care about the inverse of a variable, turn it into a positive name. missingValue instead of not hasValue.