Skip to content

Instantly share code, notes, and snippets.

View cxmeel's full-sized avatar
🔒
: ••••••••••••

cxmeel

🔒
: ••••••••••••
View GitHub Profile
export type Value<T> =
((value: (T | (current: T) -> T)?, bypassSignals: boolean?) -> T)
& {
changed: RBXScriptSignal<T, T>,
initialValue: T,
destroy: () -> (),
reset: () -> (),
onChange: (callback: (prev: T, next: T) -> (), runOnInit: boolean?) -> (),
onReset: (() -> ())?,
}
@cxmeel
cxmeel / fromInstance.luau
Created August 19, 2024 21:27
Generates a React component from an existing Instance. Alternatively, set `clone = false` to "inverse portal."
local React = require("@pkgs/React")
local useEffect = React.useEffect
local e = React.createElement
local function applyProps(target: Instance, props, applyRef)
for propName, propValue in props do
if propName == "children" or propName == "Parent" then
continue
end
@cxmeel
cxmeel / useDpiScale.lua
Last active April 8, 2026 01:57
React-lua hook for determining DPI scale.
local UserInputService = game:GetService("UserInputService")
local React = require(script.Parent.Parent.Packages.React)
local useState = React.useState
local useEffect = React.useEffect
local function calculateDpiScale()
local BUTTON_CONTENTID = UserInputService:GetImageForKeyCode(Enum.KeyCode.ButtonA)
local BUTTON_SCALE = BUTTON_CONTENTID:lower():match("@([%d%.]-)x%.%w+$")
@boatbomber
boatbomber / release.luau
Last active September 1, 2025 23:55
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")
@mvyasu
mvyasu / createWireChainWith.lua
Last active July 5, 2025 15:26
chains together different wireable objects with wires in an easy to understand manner
--!strict
type AudioModifier = AudioEcho | AudioFader | AudioChorus | AudioReverb | AudioFlanger | AudioEqualizer | AudioCompressor | AudioDistortion | AudioPitchShifter
type AudioProcessor = AudioAnalyzer | AudioListener
type AudioOutput = AudioEmitter | AudioDeviceOutput
type AudioInput = AudioDeviceInput | AudioPlayer
export type Wireable = AudioModifier | AudioProcessor | AudioOutput | AudioInput
local function createWire(source: Wireable, target: Wireable, sourceName: string, targetName: string, parent: Instance): Wire
local Frustum = {}
local function planeFromPoints(p0, p1, p2)
local normal = (p1 - p0):Cross(p2 - p1).Unit
return {
normal = normal,
d = -normal:Dot(p0),
}
end
@torcado194
torcado194 / cleanEdge-shadertoy.glsl
Last active March 15, 2026 02:42
cleanEdge, a pixel art upscaling algorithm for clean rotations
/*** MIT LICENSE
Copyright (c) 2022 torcado
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 furnished to do so, subject to the following
@cxmeel
cxmeel / README.md
Last active April 8, 2026 16:58
Markdown buttons

Markdown Buttons

The documentation has been moved to this gist in order to reduce lag.

(function(namespace) {
function Create(className = "span", attributes = {}, ...children) {
const node = document.createElement(className)
let onInit = null
const events = {
event: {},
}
for (const [attributeName, attributeValue] of Object.entries(attributes)) {
@boatbomber
boatbomber / publish.yml
Last active October 26, 2025 12:22
A publishing workflow for Roblox projects
## Welcome to boatbomber's publish workflow.
# You'll need a few things in your GitHub Action secrets for this to work:
# - ROBLOSECURITY : A cookie of a Roblox account (used to install Studio for testing)
# - RBXID : Another cookie from the account (also used in Studio install)
# - PUBLISHCLOUD : A Roblox OpenCloud API key with Write permission in Place Management for your game
# This workflow assumes that you have:
# - A `aftman.toml` with rojo, wally, selene, darklua, and run-in-roblox
# - A `default.project.json` that builds a place file