This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { h } from "onejs-preact"; | |
import { useEffect, useMemo, useRef } from "onejs-preact/hooks"; | |
import { useSvgTexture } from "src/contexts/svg-cache/use-svg-texture"; | |
import { tv } from "tailwind-variants"; | |
import filledIcons from "src/generated/icons/filled.json"; | |
import outlinedIcons from "src/generated/icons/outlined.json"; | |
export type IconSize = "x-small" | "small" | "medium" | "large" | "x-large" | "xx-large"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Returns whether the given value is a binding. | |
@param value The value to check. | |
@return Whether the value is a binding. | |
]] | |
local function isBinding(value: unknown): boolean | |
return ReactIs.isBinding(value) | |
end | |
--[[ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Based on this Typescript implementation by Littensy: | |
-- https://github.com/littensy/charm-example/blob/7def4fbbfafe13d482edd7b6b89417d4ee42516b/src/client/composables/use-px.ts | |
local React = require("@pkg/react") | |
local useState = React.useState | |
local useCallback = React.useCallback | |
local useEffect = React.useEffect | |
local useMemo = React.useMemo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- GLOBAL TYPES | |
export type Array<T> = {T} | |
export type Map<K, V> = {[K]: V} | |
export type String = { | |
includes: (a: string, b: string) -> boolean, | |
startsWith: (a: string, searchTerm: string) -> boolean, | |
endsWith: (a: string, searchTerm: string) -> boolean, | |
lower: (str: string) -> string, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Create a new DynamicMesh instance | |
local dynamicMesh = Instance.new("DynamicMesh") | |
-- Function to get perlin noise | |
local function perlinNoise(x, y, scale, height) | |
return math.noise(x * scale, y * scale) * height | |
end | |
local size = 50 -- Size of the terrain | |
local scale = 0.1 -- Scale factor for Perlin noise |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A physical model of a spring, based off: | |
// https://github.com/Quenty/NevermoreEngine/blob/2ad8cea7dd3ad79a39afd7d7b785b489b90553fd/src/spring/src/Shared/Spring.lua | |
// | |
// A spring is an object that will compute based upon Hooke's law. Properties only evaluate upon index making this class | |
// good for lazy applications. | |
using System; | |
using UnityEngine; | |
public class Spring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
ELEVATED PLUGIN DEMOTER | |
"One-click" script to demote elevated (usually internal) plugins by removing or | |
replacing their elevated API calls. | |
NOTE: | |
I've only tested this on the "Developer" Storybook plugin (the irony). It will probably | |
need some modification for other internal plugins, like the Roact Inspector. | |
STEPS TO USE: |