Skip to content

Instantly share code, notes, and snippets.

View dphfox's full-sized avatar
🏗️
Building something neat

Daniel P H Fox dphfox

🏗️
Building something neat
View GitHub Profile
Elttob Workroom @ 08 Feb 2023 16:36 auto-recovery file was created
builtin_9SliceEditor.rbxm.9SliceEditor.Packages._Index.Scheduler.Scheduler.forks.SchedulerHostConfig.default:117:
------ Error caught by React ------
attempt to call a nil value
------ Error caught by React ------
9SliceEditor.9SliceEditor.Packages._Index.ReactReconciler.ReactReconciler.ReactFiberHostContext.new:78 function pushHostContainer
9SliceEditor.9SliceEditor.Packages._Index.ReactReconciler.ReactReconciler.ReactFiberBeginWork.new:1199 function updateHostRoot
9SliceEditor.9SliceEditor.Packages._Index.ReactReconciler.ReactReconciler.ReactFiberBeginWork.new:3592 function beginWork
builtin_9SliceEditor.rbxm.9SliceEditor.Packages._Index.ReactReconciler.ReactReconciler.ReactFiberWorkLoop.new:254
@dphfox
dphfox / tags_early.json
Created December 8, 2022 14:40
Early version of Vanilla colour tags in JSON
{
"all_tags": [
"2D UI",
"2D UI Buttons",
"2D UI Constraints",
"2D UI Images",
"2D UI Input",
"2D UI Inputs",
"2D UI Labels",
"2D UI Layouts",
@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.
@dphfox
dphfox / Serde.lua
Created July 27, 2022 19:12
Serialisation/deserialisation of values to attribute-safe and storage-safe formats
--[[
Utilities for serialising and deserialising values for safe representation
in limited media, for example when saving to plugin storage or attributes.
(c) Elttob 2022 - Licensed under MIT
]]
local HttpService = game:GetService("HttpService")
local Serde = {}
@dphfox
dphfox / Facing.lua
Created April 30, 2022 20:50
A better enum for working with directions and faces in Roblox.
--!strict
--[[
Facing
A better enum for working with directions and faces.
-----
© Elttob 2022 - Available under MIT license
]]
type Facing = {
@dphfox
dphfox / Cascade.lua
Created December 8, 2021 01:59
A possible implementation of cascading values for a future version of Fusion.
local function Cascade<T>(): Cascade
local self = {}
local definedValues: {[Instance]: T} = {}
local definedValueChangeListeners: {[Instance]: (forInstance) -> ()} = {}
local function getCascadedValue(target: Instance): T?
return definedValues[target]
or if target.Parent ~= nil then getNearestDefinedAncestor(target.Parent)
else nil
@dphfox
dphfox / .lua
Created August 12, 2021 07:56
Roblox GC issue
local function new()
local ref = {instance = Instance.new("TextButton")}
ref.instance.Parent = workspace
local function updateRefStrength()
if game:IsAncestorOf(ref.instance) then
setmetatable(ref, {})
else
setmetatable(ref, {__mode = "v"})
end