Skip to content

Instantly share code, notes, and snippets.

View RuizuKun-Dev's full-sized avatar
🦊

Kitsune RuizuKun-Dev

🦊
  • F2P
  • Area 51
View GitHub Profile
@EgoMoose
EgoMoose / ViewportModel.lua
Last active September 7, 2024 18:54
Lua class to calculate camera distance/cframe for fitting models into viewport frames
--[[
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
@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
@howmanysmall
howmanysmall / FastBitBuffer.lua
Last active November 29, 2020 04:06
MOVED TO A REPO - https://github.com/howmanysmall/FastBitBuffer. My BitBuffer module versus other BitBuffers. Mine is the FastBitBuffer one below. CC0 license.
--[[
==========================================================================
== API ==
Differences from the original:
Using metatables instead of a function returning a table.
Added Vector3, Color3, Vector2, and UDim2 support.
Deprecated BrickColors.
Changed the creation method from BitBuffer.Create to BitBuffer.new.
-- Elliptic Curve Cryptography in Computercraft
local byteTableMT = {
__tostring = function(a) return string.char(unpack(a)) end,
__index = {
toHex = function(self, s) return ("%02x"):rep(#self):format(unpack(self)) end,
isEqual = function(self, t)
if type(t) ~= "table" then return false end
if #self ~= #t then return false end
local ret = 0
------------------------------------------------------------------------------------------------------------------
-- CFrameSerializer.lua
-- Written by CloneTrooper1019
-- @ 3/7/2019
------------------------------------------------------------------------------------------------------------------
-- Usage
-- string CFrameSerializer:EncodeCFrame(CFrame cf) < Compresses a CFrame into a JSON string.
-- CFrame CFrameSerializer:DecodeCFrame(string cf) < Decompresses a JSON CFrame string.
------------------------------------------------------------------------------------------------------------------
-- Utility Functions
------------------------------------------------------------------------
-- Freecam
-- Cinematic free camera for spectating and video production.
------------------------------------------------------------------------
local pi = math.pi
local abs = math.abs
local clamp = math.clamp
local exp = math.exp
local rad = math.rad
local CHARACTERS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~`!@#$%^&*()-_=+[{]}\\|;:'\",<.>/?"
local RandomLib = Random.new(os.clock() % 1 * 1E7)
local function RandomString(Length)
local String = ""
for _ = Length, 0, -1 do
local Index = RandomLib:NextInteger(1, 94)
String ..= string.sub(CHARACTERS, Index, Index)
end
local Functions = {}
local random = math.random
math.randomseed(tick() % 1 * 1E7)
Functions["local"] = function()
return random()
end
Functions["global"] = function()
return math.random()
@bradtraversy
bradtraversy / vscode_shortcuts.md
Last active November 17, 2024 12:21
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@evaera
evaera / Clean Code.md
Last active November 16, 2024 11:05
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.