Skip to content

Instantly share code, notes, and snippets.

View SwadicalRag's full-sized avatar
👨‍⚕️
working :)

swadical SwadicalRag

👨‍⚕️
working :)
View GitHub Profile
@SwadicalRag
SwadicalRag / repoloader.lua
Last active May 14, 2023 23:30
Load gmod addons from github repositories
local function FetchSync(url)
local this = coroutine.running()
http.Fetch(url,function(...)
local suc,err = coroutine.resume(this,...)
if not suc then error(err) end
end,function(...)
-- local suc,err = coroutine.resume(this,...)
-- if not suc then error(err) end
end)
@SwadicalRag
SwadicalRag / A E S T H E T I C 2.js
Created March 9, 2016 23:35
rainbow navbar on FLO and Student Admin
// ==UserScript==
// @name A E S T H E T I C 2
// @namespace https?://stuadmin.flinders.edu.au/*
// @version 1
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @grant none
// ==/UserScript==
waitForKeyElements("#divBanner",function() {
var clk = 0;
@SwadicalRag
SwadicalRag / gist:a3a9b29b88229384046d
Created January 19, 2016 04:23
720p ASCII mandelbrot
This file has been truncated, but you can view the full file.
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░▒▒▒▒▒▒▒▓▓▓▓░░░░░░▒▒▓▓▒▓▒░▒▒▒░░▓▒▒░░░░░░▒▒▒▓▓▓▓▓░░░░░▒▒░░▓▒░░░▓▒▒░░░░░░░▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
@SwadicalRag
SwadicalRag / Quotes.md
Last active January 12, 2024 19:07
John Lua - In Memoriam

#The Wisdoms of John Lua

“An error doesn't become a mistake until you refuse to correct it.” - John Lua

“In the beginning was the Statement, and the Statement was with Lua, and the Statement was Lua.” - John Lua

“Lua was the answer to my prayers.” - John Lua

function net.InlineMessage(id,fn)
local thread = coroutine.create(fn)
coroutine.resume(thread)
net.Receive(id,function(...)
if coroutine.status(thread) == "suspended" then
coroutine.resume(thread,...)
end
end)
end
local spawnProtectionNetchannel = "meme_protect_spawn"
if(SERVER) then
util.AddNetworkString(spawnProtectionNetchannel)
hook.Add("PlayerSpawn","meme_protect_spawn",function(ply)
ply:GodEnable()
timer.Simple(5,function()
if not IsValid(ply) then return end
ply:GodDisable()
net.Start(spawnProtectionNetchannel)
@SwadicalRag
SwadicalRag / lao.lua
Last active September 20, 2015 08:42
Lao "G" in Lua
hook.Add("Message","Lao G",function(_,__,msg)
if(msg:match("(%a*[Gg]%a*)")) then
for g in msg:gmatch("(%a*[Gg]%a*)") do
local g2,n = g:gsub("([Gg])","'G'")
print(g2)
end
print("There's the 'G'!")
end
end)
@SwadicalRag
SwadicalRag / compare.lua
Created September 10, 2015 05:36
compare tables
local function compare(tbl1,tbl2,compared)
compared = compared or {}
for k,v in pairs(tbl1) do
if(type(v) == "table") then
if not compared[v] then
if(type(tbl2[k]) == "table") then
compared[v] = true
if not compare(v,tbl2[k],compared) then
return false
end
@SwadicalRag
SwadicalRag / repeat.lua
Last active April 21, 2017 12:17
Repeat after me
local function ParseStatement(msg,repper)
if(msg:match("^repeat[ \n\r\t]-after[ \n\r\t]-.-[ \n\r\t]-.+[ \n\r\t]-ty")) then
local to_repeat = msg:match("^repeat[ \n\r\t]-after[ \n\r\t]-.-[ \n\r\t]-[\"'](.+)[\"'][ \n\r\t]-x[ \n\r\t]-%d-[ \n\r\t]-ty")
local n = msg:match("^repeat[ \n\r\t]-after[ \n\r\t]-.-[ \n\r\t]-[\"'].+[\"'][ \n\r\t]-x[ \n\r\t]-(%d+)[ \n\r\t]-ty")
local person = msg:match("^repeat[ \n\r\t]-after[ \n\r\t]-([^ ]+)[ \n\r\t]-[\"'].+[\"'][ \n\r\t]-x[ \n\r\t]-%d+[ \n\r\t]-ty")
if not (to_repeat and tonumber(n) and person) then return end
local out = ""
local repper = (repper or "\n")
for i=1,tonumber(n) do
out = out..to_repeat..repper
cookie.maymays.flipTable = function(unflip)
local flips = {
"(╯°□°)╯︵ ┻━┻",
"(ノ ゜Д゜)ノ ︵ ┻━┻",
"(╯°□°)╯︵ ┻━┻ ︵ ╯(°□° ╯)",
"┬─┬ ︵ /(.□. \\)",
"(ノಥ益ಥ)ノ ┻━┻",
"(╯°Д°)╯︵ /(.□ . \\)",
"(╯'□')╯︵ ┻━┻",
"(ノಥДಥ)ノ︵┻━┻・/",