Skip to content

Instantly share code, notes, and snippets.

View Reselim's full-sized avatar

Nicole Reselim

  • Toronto, Canada
  • 09:47 (UTC -04:00)
  • X @reselim_
View GitHub Profile
@Reselim
Reselim / Buffer.lua
Last active August 29, 2020 14:21
Relatively fast buffer module
local powersOfTwo = setmetatable({}, {
__index = function(self, exponent)
local value = 2 ^ exponent
self[exponent] = value
return value
end
})
local function encodeFloat(value, mantissaBits, exponentBits)
if value == 0 then
@Reselim
Reselim / Grid.lua
Last active August 29, 2020 14:22
asdfsddfgsdrfg
shared()
local Roact = require("Roact")
local Math = require("Math")
local Dictionary = require("Dictionary")
local PIXELS_PER_STUD = 20
local TRANSPARENCY = 0.25
local function GridAxis(props)
--[[
CC BY-SA 4.0 - creativecommons.org/licenses/by-sa/4.0
Roact.createElement(RadialImage, {
Clockwise = true,
Progress = 0.6,
Image = "rbxassetid://3942975478",
ImageSize = Vector2.new(640, 624),
shared()
local Event = require("Event")
local EventTree = {}
EventTree.__index = EventTree
function EventTree.new()
local self = setmetatable({
_downstreamEvent = Event.new(),
-- GENERATED MESH: https://www.roblox.com/library/2983070137/Circle
local NUM_POINTS = 90
local Vertices = {}
local Faces = {}
for index = 1, NUM_POINTS do
local rotation = index / NUM_POINTS * math.pi * 2
local Roact = require("Roact")
local Segments = {}
for index = 1, 8 do
local X = (index - 1) % 4
local Y = math.floor((index - 1) / 4)
table.insert(Segments, {
Angle = 360 / (2 ^ index),
-- this is an old version
-- see: https://github.com/Reselim/Base64
local FILLER_CHARACTER = 61
local alphabet = {}
local indexes = {}
for index = 65, 90 do table.insert(alphabet, index) end -- A-Z
for index = 97, 122 do table.insert(alphabet, index) end -- a-z
local Base64 = {
Filler = "=",
Indexes = {},
Alphabet = {
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
"N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
"n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
-- black frames not included
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
local Camera = Workspace.CurrentCamera
local Module = {}
Module.Position = UDim2.new(0, 0, 0, 0)