Skip to content

Instantly share code, notes, and snippets.

View Reselim's full-sized avatar

Nicole Reselim

  • Toronto, Canada
  • 21:13 (UTC -04:00)
  • X @reselim_
View GitHub Profile
@Reselim
Reselim / Discord Experiments.js
Created October 6, 2022 02:20 — forked from MeguminSama/Discord Experiments.js
Discord Experiments.js
webpackChunkdiscord_app.push([["wp_isdev_patch"], {}, r => cache=Object.values(r.c)]);
var UserStore = cache.find(m => m?.exports?.default?.getCurrentUser).exports.default;
var actions = UserStore._dispatcher._actionHandlers._orderedActionHandlers["CONNECTION_OPEN"];
var user = UserStore.getCurrentUser();
actions.find(n => n.name === "ExperimentStore").actionHandler({
type: "CONNECTION_OPEN", user: {flags: user.flags |= 1}, experiments: [],
});
actions.find(n => n.name === "DeveloperExperimentStore").actionHandler();
webpackChunkdiscord_app.pop(); user.flags &= ~1; "done";
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
local Llama = require(ReplicatedStorage.packages.Llama)
local PathCommandType = require(ReplicatedStorage.shared.enum.PathCommandType)
local Renderer = require(ReplicatedStorage.shared.Renderer)
@Reselim
Reselim / Buffer.lua
Last active September 3, 2021 18:36
Buffer with string.pack/string.unpack
local function createReadBuffer(data)
local index = 1
local function readRaw(byteCount)
local startIndex = index
index = index + byteCount
local endIndex = index - 1
return string.byte(data, startIndex, endIndex)
end
local function merge(...)
local output = {}
for index = 1, select("#", ...) do
local source = select(index, ...)
if source ~= nil then
for key, value in pairs(source) do
output[key] = value
end
@Reselim
Reselim / ECS.lua
Last active May 30, 2022 08:18
Simple pure-data ECS
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Signal = require(ReplicatedStorage.packages.Signal)
local Llama = require(ReplicatedStorage.packages.Llama)
local globalEntityIdCounter = 0
local function createEntityId()
globalEntityIdCounter += 1
return tostring(globalEntityIdCounter)
end
@Reselim
Reselim / LockingMaid.lua
Last active April 24, 2021 06:41
Locking maids
local LOCKED_ERROR = "Maid no longer usable, create a new maid if you wish to add events"
local TABLE_SEARCH_FUNCTIONS = {
"Destroy", "destroy",
"Disconnect", "disconnect"
}
local function dispose(object)
local objectType = typeof(object)
@Reselim
Reselim / RegionHeader.lua
Last active November 29, 2020 04:05
Region headers
local Roact = require("Roact")
local Flipper = require("Flipper") -- github.com/Reselim/Flipper
local Promise = require("Promise") -- github.com/evaera/roblox-lua-promise
local ACTIVE_TIME = 3
local RegionHeader = Roact.PureComponent:extend("RegionHeader")
function RegionHeader:init()
self.motor = Flipper.SingleMotor.new(0)
@Reselim
Reselim / RadialImage-bindings.lua
Last active March 28, 2021 05:57
RadialImage but written around bindings. CC BY-SA 4.0
local TRANSPARENCY_SEQUENCE = NumberSequence.new({
NumberSequenceKeypoint.new(0, 1),
NumberSequenceKeypoint.new(0.5 - 0.001, 1),
NumberSequenceKeypoint.new(0.5 + 0.001, 0),
NumberSequenceKeypoint.new(1, 0)
})
local RadialProgress = Roact.PureComponent:extend("RadialProgress")
RadialProgress.defaultProps = {
local Event = {}
Event.__index = Event
function Event.new()
return setmetatable({
_listeners = {},
_threads = {},
-- TODO: Remove when Roblox fixes coroutine.yield in pcall
_compatibilityEvent = Instance.new("BindableEvent")
const discord = require("discord.js")
const akairo = require("discord-akairo")
const jimp = require("jimp")
const borderSize = 0.04
const prideFlags = {
gay: [ "#FF000E", "#FF5000", "#FAD220", "#138F3E", "#3558A0", "#880082" ],
bisexual: [ "#D60270", "#9B4F96", "#0038A8" ],
trans: [ "#5BCEFA", "#F5A9B8", "#EEEEEE", "#F5A9B8", "#5BCEFA" ],
nonbinary: [ "#FFF433", "#FFFFFF", "#9B59D0", "#2D2D2D" ],