Skip to content

Instantly share code, notes, and snippets.

@dig1t
dig1t / Leaderstats.luau
Last active May 6, 2025 22:14
Roblox module for managing player leaderstats.
-- https://gist.github.com/dig1t/e7555d724300d2faf51419fba5d6783a
--[=[
@class Leaderstats
Author: dig1t
Description: A module for managing player leaderstats
]=]
@dig1t
dig1t / LavaParts.luau
Last active April 23, 2025 03:13
Creating a lava part using CollectionService
--!strict
local CollectionService = game:GetService("CollectionService")
-- This will be the tag you'll be adding
-- to every part that can damage players
local LAVA_TAG = "Lava"
-- We'll save our connections here so we can clean them up later
local connections: { [BasePart]: RBXScriptConnection } = {}
@dig1t
dig1t / aftman.sh
Last active March 24, 2025 23:12
wally/rojo/aftman Permissions Fix for Mac
# Give all aftman tools full permissions
sudo chmod -R 755 ~/.aftman
sudo chown -R $(whoami):staff ~/.aftman
@dig1t
dig1t / extensions.json
Created November 13, 2024 17:57
Repo Files for Styling and Validation
// .vscode/extensions.json
{
"recommendations": [
"evaera.vscode-rojo",
"JohnnyMorganz.luau-lsp",
"Kampfkarren.selene-vscode",
"JohnnyMorganz.stylua"
]
}
@dig1t
dig1t / aftman.toml
Last active February 22, 2025 22:34
Roblox Luau Linter - Runs on Pull Requests
[tools]
luau-lsp = "JohnnyMorganz/[email protected]"
rojo = "rojo-rbx/[email protected]"
selene = "Kampfkarren/[email protected]"
wally = "UpliftGames/[email protected]"
wally-package-types = "JohnnyMorganz/[email protected]"
@dig1t
dig1t / docs.yml
Last active February 22, 2025 22:50
GitHub Action to automatically deploy moonwave docs to GitHub Pages
# .github/workflows/docs.yml
name: Deploy documentation to GitHub Pages
on:
push:
branches:
- main
paths:
- 'src/**'
const yourAsyncFunction = async () => {
// do stuff
console.log('this will run first')
await new Promise((resolve, reject) => {
console.log('this will run second in 1000ms')
setTimeout(() => resolve(), 1000)
})
@dig1t
dig1t / typeahead-highlighter.js
Last active March 5, 2023 00:44
Highlights words matching all or parts of the inputted text. Visual feature for typeahead search results.
const highlighter = (text, toSelect) => {
const keywords = toSelect.split(' ').filter(word => word.length > 0)
return keywords.length > 0 ? text.replace(new RegExp(
'(\\w*(' + keywords.join('|') + '))\\w*', 'gi'),
match => `<b>${match}</b>`
) : text
}
// Test Cases