Skip to content

Instantly share code, notes, and snippets.

View meepen's full-sized avatar

Devin Korb meepen

View GitHub Profile
// Copyright © Kat ‘MeepDarknessMeep’ LastNameHere
LOCALS = LOCALS or setmetatable( { }, {
__mode = "k";
} );
local _nil = {};
local _debug_getinfo = debug.getinfo;
local _debug_getlocal = debug.getlocal;
@meepen
meepen / FMList.cs
Last active December 30, 2015 21:47
don't hurt me please
using System.Collections.Generic;
namespace FollowMe
{
class FMList<T> : List<T>
{
// Returns a value for each item in the list to compare with
// the others
public delegate Q Valuer<Q>(T t);
@meepen
meepen / cl_antigarry.lua
Last active May 12, 2021 05:48
antigarry - idea by leystryku
hook.Add("FakeIDDetect", "FakeIDDetectExample", function(ply)
chat.AddText(Color(255,0,0,255), ply:Nick().." has a fake id. Do not let him fool you. If you are an admin please ban him.");
end);
steamids = steamids or {};
local Old = FindMetaTable"Player".SteamID64;
net.Receive("weapon_smg1", function(len, cl)
local ent = net.ReadEntity();
@meepen
meepen / structuralequals.lua
Last active January 11, 2016 00:27
table.StructuralEquals
local TableEqualsIntrnl
local NaN = {};
local function NaNSafe(n) return n ~= n and NaN or n; end
local EqualOps = {
["function"] = function(f1, f2)
local s, dump = pcall(string.dump, f1)
@meepen
meepen / serializer.lua
Created January 11, 2016 00:11
Serializer
local types = require "./serialize/types"
-- with: 4.4840000
-- without: 4.5080000
local pack = string.pack
local concat = table.concat;
local unpack = table.unpack;
local type = type;
if(SERVER) then
net.Receive("weapon_smg1", function(len, cl)
local which = net.ReadUInt(4);
local t = net.ReadTable();
local a = function(bool, msg)
if(not bool) then print(msg or "assertion failed"); debug.Trace(); end
@meepen
meepen / cl_meepopt_hud.lua
Created March 2, 2016 07:03
meepopt static hud shit
opt = opt or {}
opt.static_rts = opt.static_rts or {}
local static_mat = CreateMaterial("meepopt_statichud", "GMODScreenspace", {
["$translucent"] = 0,
["$alpha"] = 1,
["$texturealpha"] = 1,
["$vertexalpha"] = 0,
})
@meepen
meepen / outline.lua
Last active June 5, 2020 04:46
Outliner
function render.CreateOutlineData(length, passes, color)
local step = length * 2 / 2 ^ (math.Round(passes) - 1)
local matrices = {}
for coord = -length, length, step do
matrices[#matrices + 1] = Matrix()
matrices[#matrices]:Translate(Vector(0, 0, coord))
matrices[#matrices + 1] = Matrix()
@meepen
meepen / circlepicker.lua
Created April 19, 2016 23:33
base circular divided panel for gmod
DEFINE_BASECLASS "EditablePanel"
local mat = surface.GetTextureID("vgui/white")
function PANEL:Init()
self.ObjectCount = 3
self:InvalidateLayout(true)
end
function PANEL:SetObjectCount(n)
@meepen
meepen / lujlu.lua
Last active February 9, 2024 09:18
LuaJit VM in Lua. Comes with fully operational bytecode interpreter. License is: contact me before using it commercially. - Now runs itself inside itself and itself inside itself inside itself
local bytecodes = {}
local BC, run_function = {}
local VARG_CONST = {}
local lujlu_mt_funcs
local lujlu_cache = setmetatable({}, {__mode = "k"})
local lujlu_identifier_mt = {
__tostring = function(self)
return tostring(lujlu_cache[self].data)
end,