Skip to content

Instantly share code, notes, and snippets.

View SpazElectro's full-sized avatar
🖥️
programming away

stev SpazElectro

🖥️
programming away
View GitHub Profile
@kgriffs
kgriffs / string_util.lua
Created May 27, 2020 17:41
Lua string utilities (contains, startswith, endswith, replace, insert)
function string:contains(sub)
return self:find(sub, 1, true) ~= nil
end
function string:startswith(start)
return self:sub(1, #start) == start
end
function string:endswith(ending)
@Meshiest
Meshiest / godot multiplayer.md
Last active February 15, 2025 23:09
Godot 4 Multiplayer Overview

Godot 4 Scene Multiplayer

I'm too lazy to write this as official documentation so I'm transcribing my experiences here for reference.

This is high level and does not cover how to setup your peer, only how to use the API itself.

This is not a tutorial.

If you are just getting started, this tutorial by DevLogLogan is worth watching.

@dingzeyuli
dingzeyuli / check_github_repo_size
Created December 16, 2016 22:34
Check the size of a github repo before downloading
# http://webapps.stackexchange.com/questions/39587/view-estimated-size-of-github-repository-before-cloning
# tested on macOS
echo https://github.com/torvalds/linux.git | perl -ne 'print $1 if m!([^/]+/[^/]+?)(?:\.git)?$!' | xargs -I{} curl -s -k https://api.github.com/repos/'{}' | grep size
# output:
# "size": 1746294,
-- Consider using Thread instead!
-- https://gist.github.com/CloneTrooper1019/538f0ab2541ef98912a2694dd8d274e7
local RunService = game:GetService("RunService")
local threads = {}
RunService.Stepped:Connect(function ()
local now = tick()
local resumePool