repo stringclasses 341
values | file_path stringlengths 29 173 | language stringclasses 2
values | file_type stringclasses 4
values | code stringlengths 2 1.66M | tokens int64 2 598k |
|---|---|---|---|---|---|
ffrostfall/ByteNet | ffrostfall-ByteNet-fbdb156/src/data_types/map.luau | luau | .luau | local types = require("../types")
@native
local function map(
keyType: types.DataType<any>,
valueType: types.DataType<any>
): types.DataType<{ [any]: any }>
-- Cache these functions to avoid the overhead of the index
local key_write = keyType.write
local value_write = valueType.write
return {
read = @native f... | 314 |
ffrostfall/ByteNet | ffrostfall-ByteNet-fbdb156/src/data_types/nothing.luau | luau | .luau | local types = require("../types")
local nothing = {
write = @native function() end,
read = @native function()
return nil, 0
end,
}
return @native function(): types.DataType<nil>
return nothing
end
| 50 |
ffrostfall/ByteNet | ffrostfall-ByteNet-fbdb156/src/data_types/optional.luau | luau | .luau | local types = require("../types")
@native
local function optional<T>(value_type: types.DataType<T>): types.DataType<T?>
local value_read = value_type.read
local value_write = value_type.write
return {
--[[
first byte is a boolean, if it's true, the next bytes are the value of valueType
if it's false, its l... | 221 |
ffrostfall/ByteNet | ffrostfall-ByteNet-fbdb156/src/data_types/string.luau | luau | .luau | local types = require("../types")
local str = {
-- 2 bytes for the length, then the string
read = @native function(b: buffer, cursor: number)
local length = buffer.readu16(b, cursor)
return buffer.readstring(b, cursor + 2, length), length + 2
end,
write = @native function(data: string)
local length = strin... | 122 |
ffrostfall/ByteNet | ffrostfall-ByteNet-fbdb156/src/data_types/struct.luau | luau | .luau | local types = require("../types")
type structData = {
[string]: number,
}
return function<T, V>(input: T & {
[string]: types.DataType<V>,
}): types.DataType<T>
local index_value_type_pairs: {
[number]: types.DataType<any>,
} = {}
local index_key_pairs: { [number]: string } = {}
local count = 0
for key in in... | 276 |
ffrostfall/ByteNet | ffrostfall-ByteNet-fbdb156/src/data_types/uint16.luau | luau | .luau | local types = require("../types")
local uint16 = {
write = writeu16,
read = @native function(b: buffer, cursor: number)
return buffer.readu16(b, cursor), 2
end,
}
return @native function(): types.DataType<number>
return uint16
end
| 62 |
ffrostfall/ByteNet | ffrostfall-ByteNet-fbdb156/src/data_types/uint32.luau | luau | .luau | local types = require("../types")
local uint32 = {
write = writeu32,
read = @native function(b: buffer, cursor: number)
return buffer.readu32(b, cursor), 4
end,
}
return @native function(): types.DataType<number>
return uint32
end
| 62 |
ffrostfall/ByteNet | ffrostfall-ByteNet-fbdb156/src/data_types/uint8.luau | luau | .luau | local types = require("../types")
local uint8 = {
write = writeu8,
read = @native function(b: buffer, cursor: number)
return buffer.readu8(b, cursor), 1
end,
}
return @native function(): types.DataType<number>
return uint8
end
| 62 |
ffrostfall/ByteNet | ffrostfall-ByteNet-fbdb156/src/data_types/unknown.luau | luau | .luau | local read_refs = require("../process/readRefs")
local types = require("../types")
@native
local function unknown(): types.DataType<unknown>
return {
write = @native function(value: unknown)
alloc(1)
writeReference(value)
end,
read = @native function(b: buffer, cursor: number)
local refs = read_refs.g... | 118 |
ffrostfall/ByteNet | ffrostfall-ByteNet-fbdb156/src/data_types/vec2.luau | luau | .luau | local types = require("../types")
local vec2 = {
--[[
2 float32s, one for X, one for Y
]]
read = @native function(b: buffer, cursor: number)
return Vector2.new(buffer.readf32(b, cursor), buffer.readf32(b, cursor + 4)), 8
end,
write = @native function(value: Vector2)
buffer.writef32(0, 0, value.X)
buffer... | 131 |
ffrostfall/ByteNet | ffrostfall-ByteNet-fbdb156/src/data_types/vec3.luau | luau | .luau | local types = require("../types")
local vec3 = {
__T = ... :: vector,
read = @native function(b: buffer, cursor: number)
return vector.create(
buffer.readf32(b, cursor),
buffer.readf32(b, cursor + 4),
buffer.readf32(b, cursor + 8)
),
12
end,
write = @native function(value: vector)
buffer.writef... | 136 |
ffrostfall/ByteNet | ffrostfall-ByteNet-fbdb156/src/init.luau | luau | .luau | local RunService = game:GetService("RunService")
local array = require("@self/data_types/array")
local bool = require("@self/data_types/bool")
local buff = require("@self/data_types/buff")
local cframe = require("@self/data_types/cframe")
local client = require("@self/process/client")
local define_packet = require("@s... | 452 |
ffrostfall/ByteNet | ffrostfall-ByteNet-fbdb156/src/packets/packet.luau | luau | .luau | --!native
--!optimize 2
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local types = require("../types")
local client = require("../process/client")
local server = require("../process/server")
local run_context: "server" | "client" = if RunService:IsServer() then "server" ... | 820 |
ffrostfall/ByteNet | ffrostfall-ByteNet-fbdb156/src/process/channel_state.luau | luau | .luau | local types = require("../types")
local channel_state: types.ChannelState = {
buff = buffer.create(0),
ref_map = {},
cursor = 0,
}
return channel_state
| 37 |
ffrostfall/ByteNet | ffrostfall-ByteNet-fbdb156/src/process/client.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local read = require("./read")
local types = require("../types")
@native
local function onClientEvent(receivedBuffer, ref)
read(receivedBuffer, ref)
end
-- Shared with: src/process/server.luau (Infeasible... | 502 |
ffrostfall/ByteNet | ffrostfall-ByteNet-fbdb156/src/process/read.luau | luau | .luau | --!optimize 2
--!native
local packetIDs = require("../a")
local readRefs = require("./readRefs")
local ref = packetIDs.ref()
local free_thread: thread?
@native
local function function_passer(fn, ...)
local aquiredThread = free_thread
free_thread = nil
fn(...)
free_thread = aquiredThread
end
@native
local functio... | 264 |
ffrostfall/ByteNet | ffrostfall-ByteNet-fbdb156/src/process/server.luau | luau | .luau | --!native
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local buffer_writer = require("./buffer_writer")
local read = require("./read")
local types = require("../types")
local write_packet = buffer_writer.writ... | 1,029 |
ffrostfall/ByteNet | ffrostfall-ByteNet-fbdb156/src/types.luau | luau | .luau | export type ChannelState = {
buff: buffer,
cursor: number,
ref_map: { [number]: unknown },
}
export type PacketProps<T> = {
value: T,
reliability: ("Reliable" | "Unreliable")?,
max_per_frame: number?,
}
export type DataType<T> = {
read __T: T,
write: (value: T) -> (),
read: (b: buffer, cursor: number) -> ... | 234 |
paradoxum-games/lyra | paradoxum-games-lyra-e8927a9/src/Constants.luau | luau | .luau | --[=[
@class Constants
@private
Module containing constant values used throughout the Lyra library.
]=]
-- Estimated bytes reserved within the DataStore value for Lyra's internal metadata
-- (like appliedMigrations, orphanedFiles list, and File object overhead when sharded).
-- This ensures that the actual user da... | 489 |
paradoxum-games/lyra | paradoxum-games-lyra-e8927a9/src/Log.luau | luau | .luau | --[=[
@class Log
@private
Provides a structured logging implementation for the Lyra library.
**Design:**
- **Callback-based:** Instead of directly printing or sending logs, this module
uses a callback function (`logCallback`) provided during logger creation. This
allows the consuming application to decide ... | 1,495 |
paradoxum-games/lyra | paradoxum-games-lyra-e8927a9/src/Migrations.luau | luau | .luau | --[=[
@class Migrations
@private
Provides functionality for managing and applying data migrations.
**Concept:** As data schemas evolve over time, older data stored
in DataStores needs to be updated to match the new structure. This module
allows defining a series of migration steps (`Types.MigrationStep`) that
... | 1,880 |
paradoxum-games/lyra | paradoxum-games-lyra-e8927a9/src/MockDataStoreService.luau | luau | .luau | local HttpService = game:GetService("HttpService")
local Tables = require(script.Parent.Tables)
local MAX_QUEUE_SIZE = 30
local RATE_LIMITS = {
GetAsync = { Base = 60, PlayerMultiplier = 10 },
SetAsync = { Base = 60, PlayerMultiplier = 10 },
UpdateAsync = { Base = 60, PlayerMultiplier = 10 },
RemoveAsync = { Base... | 3,923 |
paradoxum-games/lyra | paradoxum-games-lyra-e8927a9/src/MockMemoryStoreService.luau | luau | .luau | local HttpService = game:GetService("HttpService")
local Tables = require(script.Parent.Tables)
local MAX_QUEUE_SIZE = 30
local RATE_LIMITS = {
GetAsync = { Base = 100, PlayerMultiplier = 10 },
SetAsync = { Base = 100, PlayerMultiplier = 10 },
UpdateAsync = { Base = 100, PlayerMultiplier = 10 },
RemoveAsync = { B... | 2,352 |
paradoxum-games/lyra | paradoxum-games-lyra-e8927a9/src/PlayerStore.luau | luau | .luau | --[=[
A PlayerStore wraps a regular Store to provide a more convenient API for working with Player data.
It automatically converts Players to UserId keys and handles player kicks on data errors.
```lua
local playerStore = PlayerStore.create({
name = "PlayerData",
template = {
coins = 0,
items = {},
},
... | 4,456 |
paradoxum-games/lyra | paradoxum-games-lyra-e8927a9/src/PromiseQueue.luau | luau | .luau | --[=[
@class PromiseQueue
@private
Implements a queue that processes asynchronous operations (represented by functions
returning Promises or synchronous functions) one at a time, ensuring serial execution.
**Purpose:** Useful for scenarios where operations on a shared resource must not
run concurrently to preve... | 2,710 |
paradoxum-games/lyra | paradoxum-games-lyra-e8927a9/src/Types.luau | luau | .luau | --[=[
@class Types
@private
Common types shared among different modules.
]=]
local Log = require(script.Parent.Log)
local t = require(script.Parent.Parent.t)
--[=[
Represents a single operation within a JSON Patch array.
Used for describing changes between data states.
@interface PatchOperation
@within Types... | 1,799 |
paradoxum-games/lyra | paradoxum-games-lyra-e8927a9/src/hashMapRetry.luau | luau | .luau | --[=[
@class hashMapRetry
@private
Provides a utility function to wrap Roblox MemoryStoreService HashMap API calls
(like `GetAsync`, `SetAsync`, `UpdateAsync`) with automatic retries for specific,
commonly transient error conditions identified by error message strings.
**Purpose:** Similar to [dataStoreRetry], ... | 1,255 |
paradoxum-games/lyra | paradoxum-games-lyra-e8927a9/src/init.luau | luau | .luau | --[=[
@class Lyra
The main entry point and public facade for the Lyra library.
This module re-exports the primary functions and constructors needed to interact
with Lyra, simplifying the public API and hiding internal module structure.
Users of the library should typically only need to require this top-level mod... | 383 |
paradoxum-games/lyra | paradoxum-games-lyra-e8927a9/src/noYield.luau | luau | .luau | --[[
Calls a function and throws an error if it attempts to yield.
Pass any number of arguments to the function after the callback.
This function supports multiple return; all results returned from the
given function will be returned.
]]
local function resultHandler(co: thread, ok: boolean, ...)
if not ok then
... | 169 |
howmanysmall/Janitor | howmanysmall-Janitor-47acf39/.lune/BuildRelease.luau | luau | .luau | --!native
--!optimize 2
--!strict
local Destroy = require("./Utilities/Destroy")
local FileInstance = require("./Classes/FileInstance")
local PathUtilities = require("./Utilities/PathUtilities")
local warn = require("./Utilities/Warn")
local fs = require("@lune/fs")
local process = require("@lune/process")
local serd... | 1,847 |
howmanysmall/Janitor | howmanysmall-Janitor-47acf39/.lune/Classes/FileInstance.luau | luau | .luau | --!native
--!optimize 2
--!strict
local Destroy = require("../Utilities/Destroy")
local PathUtilities = require("../Utilities/PathUtilities")
local fs = require("@lune/fs")
local process = require("@lune/process")
export type FileInstance = {
FilePath: string,
IsDirectory: boolean,
Name: string,
Parent: FileInst... | 1,288 |
howmanysmall/Janitor | howmanysmall-Janitor-47acf39/.lune/EnableLoadModule.luau | luau | .luau | --!native
--!optimize 2
local fs = require("@lune/fs")
local process = require("@lune/process")
local serde = require("@lune/serde")
if process.env.windir ~= nil then
local appDataPath = process.env.LOCALAPPDATA
local robloxVersionsPath = `{appDataPath}\\Roblox\\Versions`
if not fs.isDir(robloxVersionsPath) then
... | 520 |
howmanysmall/Janitor | howmanysmall-Janitor-47acf39/.lune/Packages/SemanticVersion.luau | luau | .luau | --!native
--!optimize 2
--!strict
local function ParsePrereleaseAndBuildWithSign(value: string): (string, string)
local prereleaseWithSign, buildWithSign = string.match(value, "^(-[^+]+)(+.+)$")
if prereleaseWithSign == nil or buildWithSign == nil then
prereleaseWithSign = string.match(value, "^(-.+)$")
buildWit... | 1,829 |
howmanysmall/Janitor | howmanysmall-Janitor-47acf39/.lune/UpdateVersion.luau | luau | .luau | --!native
--!optimize 2
local SemanticVersion = require("./Packages/SemanticVersion")
local fs = require("@lune/fs")
local serde = require("@lune/serde")
local stdio = require("@lune/stdio")
local wally = serde.decode("toml", fs.readFile("wally.toml"))
local lastVersion = wally.package.version
local lastVersionSema... | 366 |
howmanysmall/Janitor | howmanysmall-Janitor-47acf39/.lune/Utilities/Destroy.luau | luau | .luau | --!native
--!optimize 2
--!strict
local fs = require("@lune/fs")
local process = require("@lune/process")
local HAS_RIM_RAF = (function()
if process.os ~= "windows" then
return false
end
return pcall(function()
fs.writeDir("swage")
process.spawn("rimraf", {"swage"})
end)
end)()
local Destroy: (path: strin... | 145 |
howmanysmall/Janitor | howmanysmall-Janitor-47acf39/.lune/Utilities/FileSystemUtilities.luau | luau | .luau | --!native
--!optimize 2
--!strict
local fs = require("@lune/fs")
local FileSystemUtilities = {}
function FileSystemUtilities.JustFileName(path: string)
return string.match(string.match(path, "^(.+)%..+$") or path, "([^\\/]+)$") or path
end
function FileSystemUtilities.JustFileNameWithExtension(path: string)
return... | 435 |
howmanysmall/Janitor | howmanysmall-Janitor-47acf39/.lune/Utilities/PathUtilities.luau | luau | .luau | --!native
--!optimize 2
local process = require("@lune/process")
local PathUtilities = {}
local SEPARATOR = if process.os == "windows" then "\\" else "/"
PathUtilities.Separator = SEPARATOR
--- Fixes the path so that it's properly formatted to the local operating system
--- @param path The path to format
--- @return... | 531 |
howmanysmall/Janitor | howmanysmall-Janitor-47acf39/.lune/Utilities/Warn.luau | luau | .luau | --!native
--!optimize 2
--!strict
local Chalk = require("../Packages/Chalk")
local ORANGE = Chalk.Rgb(255, 142, 60)
local function Concat(...: unknown)
local length = select("#", ...)
if length == 0 then
return ""
end
if length == 1 then
return tostring(...)
end
if length == 2 then
local a, b = ...
r... | 387 |
howmanysmall/Janitor | howmanysmall-Janitor-47acf39/benchmarks/FairComparison.bench/Duster.luau | luau | .luau | --!native
-- duster
-- fast and lightweight maid impl ( thats also better than janitor )
type Types = "table" | "function" | "thread" | "Instance" | "RBXScriptConnection"
type TableCleanupMethod = <V>(self: (V & {})) -> ()
export type Cleanable =
| { Disconnect: TableCleanupMethod }
| { disconnect: TableCleanupMe... | 1,432 |
howmanysmall/Janitor | howmanysmall-Janitor-47acf39/benchmarks/FairComparison.bench/Janitor18/FastDefer.luau | luau | .luau | --!native
--!optimize 2
--!strict
local FreeThreads: {thread} = table.create(500)
local function RunFunction<Arguments...>(callback: (Arguments...) -> (), thread: thread, ...: Arguments...)
callback(...)
table.insert(FreeThreads, thread)
end
local function Yield()
while true do
RunFunction(coroutine.yield())
en... | 193 |
howmanysmall/Janitor | howmanysmall-Janitor-47acf39/benchmarks/FairComparison.bench/Trove.luau | luau | .luau | --!optimize 2
--!strict
local RunService = game:GetService("RunService")
export type Trove = {
Extend: (self: Trove) -> Trove,
Clone: <T>(self: Trove, instance: T & Instance) -> T,
Construct: <T, A...>(self: Trove, class: Constructable<T, A...>, A...) -> T,
Connect: (self: Trove, signal: SignalLike | RBXScriptSig... | 1,927 |
howmanysmall/Janitor | howmanysmall-Janitor-47acf39/benchmarks/FairComparison.bench/init.luau | luau | .luau | --!optimize 2
--!strict
local Duster = require(script.Duster)
local Janitor17 = require(script.Janitor17)
local Janitor18 = require(script.Janitor18)
local Maid = require(script.Maid)
local Trove = require(script.Trove)
local UltraJanitor18 = require(script.UltraJanitor18)
type IProfiler = {
Begin: (label: string) -... | 2,174 |
howmanysmall/Janitor | howmanysmall-Janitor-47acf39/benchmarks/UnfairComparison.bench/Janitor18/init.luau | luau | .luau | --!optimize 2
--!strict
local FastDefer = require(script.FastDefer)
local Promise = require(script.Promise)
type Promise<T...> = Promise.TypedPromise<T...>
local LinkToInstanceIndex = setmetatable({}, {
__tostring = function()
return "LinkToInstanceIndex"
end;
})
local INVALID_METHOD_NAME =
"Object is a %* and ... | 3,155 |
howmanysmall/Janitor | howmanysmall-Janitor-47acf39/benchmarks/UnfairComparison.bench/Troveitor/init.luau | luau | .luau | --!optimize 2
--!strict
local RunService = game:GetService("RunService")
local Janitor = require(script.Parent.Janitor18)
local Promise = require(script.Promise)
type ConnectionLike = {
Connected: boolean,
Disconnect: (self: ConnectionLike) -> (),
}
type SignalLike = {
Connect: (self: SignalLike, callback: (...any... | 1,296 |
howmanysmall/Janitor | howmanysmall-Janitor-47acf39/benchmarks/UnfairComparison.bench/init.luau | luau | .luau | --!optimize 2
--!strict
-- for reference, unfair in this case means unfair to JANITOR.
local Janitor17 = require(script.Janitor17)
local Janitor18 = require(script.Janitor18)
local Maid = require(script.Maid)
local Trove = require(script.Trove)
local Troveitor = require(script.Troveitor)
type IProfiler = {
Begin: (... | 1,891 |
howmanysmall/Janitor | howmanysmall-Janitor-47acf39/luau/run-package-tests.luau | luau | .luau | --!optimize 2
--!strict
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Jest = require(ReplicatedStorage.DevPackages.Jest)
local processServiceExists, ProcessService = pcall(function()
local s = "ProcessService"
return game:GetService(s)
end)
local status, result = Jest.runCLI(ReplicatedStorag... | 187 |
howmanysmall/Janitor | howmanysmall-Janitor-47acf39/src/__tests__/Janitor.test.luau | luau | .luau | --!optimize 2
--!strict
_G.__IS_UNIT_TESTING__ = true
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Workspace = game:GetService("Workspace")
local JestGlobals = require(script.Parent.Parent.Parent.DevPackages.JestGlobals)
local Janitor = require(script.Parent.Parent)
local Promise = require(sc... | 3,712 |
howmanysmall/Janitor | howmanysmall-Janitor-47acf39/src/jest.config.luau | luau | .luau | type Serialize = (
value: unknown,
config: unknown,
indentation: number,
depth: number,
refs: unknown,
printer: Serialize
) -> string
type Serializer = {
serialize: Serialize,
test: (value: unknown) -> boolean,
}
type JestConfiguration = {
clearmocks: boolean?,
displayName: nil | string | {
name: string,
... | 296 |
1Axen/blink | 1Axen-blink-73695d1/.lune/build.luau | luau | .luau | local fs = require("@lune/fs")
local log = require("./libs/log")
local process = require("@lune/process")
type Archs = | "aarch64" | "x86_64"
type Platforms = | "macos" | "linux" | "windows"
local EXE_NAME = "blink"
local RELEASE_DIR = "release"
local PLUGIN_SOURCE_DIR = `plugin/src`
local PLUGIN_RELEASE_DIR = `{RE... | 895 |
1Axen/blink | 1Axen-blink-73695d1/.lune/bump.luau | luau | .luau | local darklua_version = require("./libs/darklua_version")
local pesde_version = require("./libs/pesde_version")
local stdio = require("@lune/stdio")
local PESDE_CONFIG = "pesde.toml"
local DARKLUA_CONFIG = "build/.darklua.json"
local curr_version = darklua_version.read_from(DARKLUA_CONFIG)
local new_version = stdio.p... | 134 |
1Axen/blink | 1Axen-blink-73695d1/.lune/libs/darklua_version.luau | luau | .luau | local fs = require("@lune/fs")
local serde = require("@lune/serde")
local log = require("./log")
type DarkluaRules =
| "inject_global_value"
| "N/A"
type DarkluaConfig = {
rules: {
DarkluaRules | {
rule: DarkluaRules,
identifier: string,
value: any
}
... | 347 |
1Axen/blink | 1Axen-blink-73695d1/.lune/libs/log.luau | luau | .luau | local function log(text: string)
print(`* {text}`)
end
return log | 18 |
1Axen/blink | 1Axen-blink-73695d1/.lune/libs/pesde_version.luau | luau | .luau | local fs = require("@lune/fs")
local log = require("./log")
local serde = require("@lune/serde")
type PesdeConfig = {
version: string,
}
local function read_version(config_path: string): string
local contents = fs.readFile(config_path)
local config = serde.decode("toml", contents) :: PesdeConfig
return config.ver... | 172 |
1Axen/blink | 1Axen-blink-73695d1/benchmark/run.luau | luau | .luau | local RunService = game:GetService("RunService")
if not RunService:IsRunning() then
print("Press F5 to start the benchmark.")
while task.wait(9e9) do
end
end
local Result: StringValue
while Result == nil do
Result = game:FindFirstChild("Result")
task.wait(1)
end
print("--RESULTS JSON--")
print(Result.Value)
| 82 |
1Axen/blink | 1Axen-blink-73695d1/benchmark/src/client/init.client.luau | luau | .luau | local Benches = require("./shared/benches")
local Modes = require("./shared/modes")
local HttpService = game:GetService("HttpService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local StarterGui = game:GetSe... | 1,052 |
1Axen/blink | 1Axen-blink-73695d1/benchmark/src/server/init.server.luau | luau | .luau | local HttpService = game:GetService("HttpService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Benches = require("./shared/benches")
local Modes = require("./shared/modes")
function CompareTables(a, b)
if a == b then
return true
end
if type(a) ~= type(b) then
return false
end
if ty... | 562 |
1Axen/blink | 1Axen-blink-73695d1/benchmark/src/shared/benches/Booleans.luau | luau | .luau | return table.create(1000, true)
| 9 |
1Axen/blink | 1Axen-blink-73695d1/benchmark/src/shared/benches/Entities.luau | luau | .luau | local Array = {}
for Index = 1, 100 do
table.insert(Array, {
id = math.random(1, 255),
x = math.random(1, 255),
y = math.random(1, 255),
z = math.random(1, 255),
orientation = math.random(1, 255),
animation = math.random(1, 255),
})
end
return Array
| 93 |
1Axen/blink | 1Axen-blink-73695d1/benchmark/src/shared/benches/init.luau | luau | .luau | local Benches = {}
for Index, Bench in script:GetChildren() do
--> Reset random seed to a constant value
--> This results in the same values being generated on both server and client
math.randomseed(0)
Benches[Bench.Name] = require(Bench)
end
return Benches
| 67 |
1Axen/blink | 1Axen-blink-73695d1/benchmark/src/shared/modes/blink.luau | luau | .luau | local RunService = game:GetService("RunService")
if RunService:IsServer() then
return require("../blink/Server")
elseif RunService:IsClient() then
return require("../blink/Client")
end
| 43 |
1Axen/blink | 1Axen-blink-73695d1/benchmark/src/shared/modes/init.luau | luau | .luau | local DISABLED_MODES = {
warp = true,
}
local Modes = {}
for Index, Mode in script:GetChildren() do
if DISABLED_MODES[Mode.Name] then
continue
end
Modes[Mode.Name] = require(Mode)
end
return Modes
| 60 |
1Axen/blink | 1Axen-blink-73695d1/benchmark/src/shared/modes/roblox.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local Benches = require("../benches")
local Events = {}
local IsServer = RunService:IsServer()
for Name in Benches do
local Event: RemoteEvent
if IsServer then
Event = Instance.new("RemoteEvent")
Eve... | 116 |
1Axen/blink | 1Axen-blink-73695d1/benchmark/src/shared/modes/warp.luau | luau | .luau | local RunService = game:GetService("RunService")
local Benches = require("../benches")
local Warp = require("../../../packages/warp")
local Events = {}
local Method = RunService:IsServer() and "Server" or "Client"
for Name in Benches do
Events[Name] = Warp[Method](Name, {
interval = 0,
maxEntrance = math.huge,
... | 93 |
1Axen/blink | 1Axen-blink-73695d1/benchmark/src/shared/modes/zap.luau | luau | .luau | local RunService = game:GetService("RunService")
if RunService:IsServer() then
return require("../zap/Server")
elseif RunService:IsClient() then
return require("../zap/Client")
end
| 43 |
1Axen/blink | 1Axen-blink-73695d1/plugin/src/Editor/Styling/AutoBracket.luau | luau | .luau | local Hook = {}
local Brackets = {
["("] = ")",
["{"] = "}",
["["] = "]",
["<"] = ">",
}
local ClosingBrackets = {
[")"] = true,
["}"] = true,
["]"] = true,
[">"] = true,
}
local IgnoredCharacters = {
["\n"] = true,
[""] = true,
[")"] = true,
["}"] = true,
["]"] = true,
[">"] = true,
}
local function ... | 401 |
1Axen/blink | 1Axen-blink-73695d1/plugin/src/Editor/Styling/AutoIndent.luau | luau | .luau | local Utility = require("../Utility")
local Hook = {}
local IndentKeywords = {
"{\n",
}
local function ShouldAutoIndent(Text: string, Cursor: number): boolean
for Index, Keyword in IndentKeywords do
local Position = (Cursor - #Keyword)
if Position <= 0 then
continue
end
local Previous = string.sub(Text,... | 433 |
1Axen/blink | 1Axen-blink-73695d1/plugin/src/Editor/init.luau | luau | .luau | --!strict
-- ******************************* --
-- AX3NX / AXEN --
-- ******************************* --
---- Services ----
local ContentProvider = game:GetService("ContentProvider")
local RunService = game:GetService("RunService")
local TextService = game:GetService("TextService")
---- Imports ----
local S... | 6,263 |
1Axen/blink | 1Axen-blink-73695d1/plugin/src/Profiler.luau | luau | .luau | --!strict
---- Services ----
---- Imports ----
---- Settings ----
---- Constants ----
local Profiler = {}
--> Interface Instances
local Container: typeof(script.Parent.Widget) = script.Widget
local DebugContainer = Container.Debug
local MetricTemplate = DebugContainer.Metric:Clone()
type Profile = {
Label: stri... | 562 |
1Axen/blink | 1Axen-blink-73695d1/plugin/src/State.luau | luau | .luau | --!strict
-- ******************************* --
-- AX3NX / AXEN --
-- ******************************* --
---- Services ----
---- Imports ----
---- Settings ----
---- Constants ----
local State = {}
State.__index = State
export type Class<T> = typeof(setmetatable(
{} :: {
Value: T,
Observers: { [(T) -... | 302 |
1Axen/blink | 1Axen-blink-73695d1/plugin/src/Table.luau | luau | .luau | local Table = {}
function Table.MergeArrays(a: { any }, b: { any }): { any }
local Array = table.create(#a + #b)
for _, Element in a do
table.insert(Array, Element)
end
for _, Element in b do
table.insert(Array, Element)
end
return Array
end
function Table.MergeDictionaries(a: { [any]: any }, b: { [any]:... | 199 |
1Axen/blink | 1Axen-blink-73695d1/plugin/src/init.server.luau | luau | .luau | --!strict
-- ******************************* --
-- AX3NX / AXEN --
-- ******************************* --
---- Services ----
local RunService = game:GetService("RunService")
local ScriptEditorService = game:GetService("ScriptEditorService")
local Selection = game:GetService("Selection")
local ServerStorage = g... | 2,959 |
1Axen/blink | 1Axen-blink-73695d1/src/CLI/Utility/GetDefinitionFilePath.luau | luau | .luau | --!strict
---- Imports ----
local PathParser = require("../../Modules/Path")
local fs = require("@lune/fs")
---- Settings ----
local EXTENSIONS = { "", ".txt", ".blink" }
return function(Path: string): string
local Directory, Filename = PathParser.Components(Path)
Directory = Directory or "./"
assert(Filename, ... | 131 |
1Axen/blink | 1Axen-blink-73695d1/src/CLI/Utility/Watch.luau | luau | .luau | --!strict
---- Imports ----
local dateTime = require("@lune/datetime")
local fs = require("@lune/fs")
local stdio = require("@lune/stdio")
local task = require("@lune/task")
local Compile = require("./Compile")
local GetDefinitionFilePath = require("./GetDefinitionFilePath")
local PathParser = require("../../Modules... | 726 |
1Axen/blink | 1Axen-blink-73695d1/src/CLI/init.luau | luau | .luau | --!native
--!optimize 2
---- Imports ----
local process = require("@lune/process")
local stdio = require("@lune/stdio")
local Compile = require("@self/Utility/Compile")
local Watch = require("@self/Utility/Watch")
---- Settings ----
type Argument = {
Hidden: true?,
Aliases: { string },
Description: string,
}
l... | 821 |
1Axen/blink | 1Axen-blink-73695d1/src/Generator/Blocks.luau | luau | .luau | type BranchType = "Conditional" | "Default"
type EqualityOperator = "Not" | "Equals" | "Greater" | "Less" | "GreaterOrEquals" | "LessOrEquals"
type Method = "Read" | "Allocate" | "None"
type Operation = {
Method: Method,
Bytes: number,
Counts: number,
Variable: string?,
}
local DEFAULT_UNIQUE = "BLOCK_START"
loca... | 2,045 |
1Axen/blink | 1Axen-blink-73695d1/src/Generator/Prefabs.luau | luau | .luau | --!native
--!optimize 2
local Blocks = require("./Blocks")
local Parser = require("../Parser")
type Block = Blocks.Block
type Writer = (Value: string, Block: Block, Range: NumberRange?, Components: { string }?) -> ()
type Reader = (Variable: string, Block: Block, Range: NumberRange?, Components: { string }?) -> ()
ty... | 5,305 |
1Axen/blink | 1Axen-blink-73695d1/src/Modules/Builder.luau | luau | .luau | --!native
--!optimize 2
local Builder = {}
function Builder.new(): Builder
local Strings = table.create(512)
local function PushLines(Lines: { string }, Returns: number?, Tabs: number?)
local Size = #Lines
local Last = Lines[Size]
local Tabs = Tabs or 0
local Returns = Returns or 0
--> FAST PATH :SUNGL... | 459 |
1Axen/blink | 1Axen-blink-73695d1/src/Modules/Error.luau | luau | .luau | --!native
--!optimize 2
local IS_ROBLOX = (game ~= nil)
local stdio
local process
if not IS_ROBLOX then
stdio = require("@lune/stdio")
process = require("@lune/process")
end
type Slice = {
Line: number,
Text: string,
Spaces: number,
Underlines: number,
}
export type Label = {
Span: Span,
Text: string,
}
ty... | 1,872 |
1Axen/blink | 1Axen-blink-73695d1/src/Modules/Format.luau | luau | .luau | --!strict
local stdio = require("@lune/stdio")
local function Style(text: any, style: stdio.Style): string
return `{stdio.style(style)}{text}{stdio.style("reset")}`
end
local function Color(text: any, color: stdio.Color): string
return `{stdio.color(color)}{text}{stdio.color("reset")}`
end
local KEYWORDS = {
["a... | 786 |
1Axen/blink | 1Axen-blink-73695d1/src/Modules/Path.luau | luau | .luau | --!strict
---- Imports ----
---- Settings ----
---- Constants ----
local Utility = {}
---- Variables ----
---- Private Functions ----
---- Public Functions ----
function Utility.PathType(Path: string): "absolute" | "relative"
-- on unix-based systems, '/' is root
if string.sub(Path, 1, 1) == "/" then
return... | 355 |
1Axen/blink | 1Axen-blink-73695d1/src/Modules/Table.luau | luau | .luau | return {
Merge = function(...: { any }): { any }
local Tables = { ... }
local Allocate = 0
for _, Table in Tables do
Allocate += #Table
end
local Index = 1
local Merged = table.create(Allocate)
for _, Table in Tables do
table.move(Table, 1, #Table, Index, Merged)
Index += #Table
end
retu... | 230 |
1Axen/blink | 1Axen-blink-73695d1/src/Settings.luau | luau | .luau | type NumberRange = { Min: number, Max: number }
local NumberRange = {
new = function(Min: number, Max: number?): NumberRange
return {
Min = Min,
Max = Max or Min,
}
end,
}
export type Case = "Camel" | "Snake" | "Pascal"
export type Cases = {
Fire: string,
FireAll: string,
FireList: string,
FireExcept: ... | 1,444 |
1Axen/blink | 1Axen-blink-73695d1/src/Templates/Base.luau | luau | .luau | return [[local Invocations = 0
local SendSize = 64
local SendOffset = 0
local SendCursor = 0
local SendBuffer = buffer.create(64)
local SendInstances = {}
local RecieveCursor = 0
local RecieveBuffer = buffer.create(64)
local RecieveInstances = {}
local RecieveInstanceCursor = 0
local Null = newproxy()
type Entry =... | 658 |
1Axen/blink | 1Axen-blink-73695d1/src/Templates/Client.luau | luau | .luau | return [[local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
-- SPLIT --
if not RunService:IsClient() then
error("Client network module can only be required from the client.")
end
local Reliable: RemoteEvent = ReplicatedStorage:WaitForChild(BASE_EVENT_NA... | 216 |
1Axen/blink | 1Axen-blink-73695d1/src/Templates/Server.luau | luau | .luau | return [[local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
-- SPLIT --
if not RunService:IsServer() then
error("Server network module can only be required from the server.")
end
local Reliable: RemoteEvent = R... | 380 |
littensy/ripple | littensy-ripple-c33bb8b/.lute/build.luau | luau | .luau | local fs = require("@std/fs")
local process = require("@lute/process")
fs.createdirectory("build")
process.run({ "rojo", "build", "--output=build/ripple.rbxm" }, { stdio = "inherit" })
| 52 |
littensy/ripple | littensy-ripple-c33bb8b/.lute/check.luau | luau | .luau | local fs = require("@std/fs")
local net = require("@lute/net")
local process = require("@lute/process")
process.run({ "rojo", "sourcemap", "--output=sourcemap.json" }, { stdio = "inherit" })
fs.writestringtofile(
"roblox.d.luau",
net.request("https://luau-lsp.pages.dev/globalTypes.None.d.luau", { method = "GET" }).... | 314 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/bench.luau | luau | .luau | local function bench(name: string, test: () -> ())
local start = os.clock()
local iterations = 0
while os.clock() - start < 3 do
iterations += 1
test()
end
local elapsed = os.clock() - start
local micros = string.format("%.2f", elapsed / iterations * 1000 * 1000)
print(`{name}: {micros} µs/iter`)
end
ret... | 97 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/otter/AnimationStepSignal.luau | luau | .luau | --[[
Copyright (c) 2018-2023 Roblox Corporation
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, publi... | 341 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/otter/assign.luau | luau | .luau | --[[
MIT License
Copyright (c) Roblox
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, dist... | 771 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/otter/createGroupMotor.luau | luau | .luau | --[[
Copyright (c) 2023 Roblox Corporation
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, d... | 1,263 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/otter/createSignal.luau | luau | .luau | --[[
Copyright (c) 2023 Roblox Corporation
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, d... | 618 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/otter/createSingleMotor.luau | luau | .luau | --[[
Copyright (c) 2018-2023 Roblox Corporation
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, publi... | 979 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/otter/ease.luau | luau | .luau | --[[
Copyright (c) 2018-2023 Roblox Corporation
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, publi... | 2,037 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/otter/types.luau | luau | .luau | --[[
Copyright (c) 2018-2023 Roblox Corporation
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, publi... | 467 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/tween.luau | luau | .luau | local bench = require("./bench")
local ITERATIONS = 10000
do
local tween = require("../packages/ripple/src/tween")
local createTween = tween.createTween
local scheduler = tween.scheduler
bench("ripple", function()
createTween(0, { start = true }):setGoal(1)
for _ = 1, ITERATIONS do
scheduler.step(1 / ITE... | 199 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/vide/effect.luau | luau | .luau | --[[
MIT License
Copyright (c) 2022 centau
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,... | 339 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/vide/flags.luau | luau | .luau | --[[
MIT License
Copyright (c) 2022 centau
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,... | 287 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/vide/graph.luau | luau | .luau | --[[
MIT License
Copyright (c) 2022 centau
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,... | 2,173 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/vide/root.luau | luau | .luau | --[[
MIT License
Copyright (c) 2022 centau
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,... | 495 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.