Skip to content

Instantly share code, notes, and snippets.

View MattJeanes's full-sized avatar
🏳️‍🌈

Matt Jeanes MattJeanes

🏳️‍🌈
View GitHub Profile
@MattJeanes
MattJeanes / StringInput.vb
Created October 8, 2013 18:59
Example of console.readkey usage to read an authorisation code without the need to press enter
Module Module1
Function GetString(ByVal InputS As String) As String
Dim TempS As String = ""
Dim TempC As ConsoleKeyInfo
Do
TempC = Console.ReadKey()
If TempC.Key = ConsoleKey.Escape Or TempC.Key = ConsoleKey.Enter Then
Console.Write(vbNewLine)
Return False
Else
@MattJeanes
MattJeanes / TickFinder.lua
Last active August 29, 2015 13:56
Get's the current tickrate of Garry's Mod and prints it to console, one line so it can be used in lua_run|lua_run_cl.
local n=0 hook.Add("Tick", "TickFinder", function() n=n+1 end) timer.Simple(1,function() hook.Remove("Tick", "TickFinder") print("Tickrate: " .. n) end)
@MattJeanes
MattJeanes / PoseParamTest.lua
Created February 17, 2014 00:41
This tests poseparameters (specifically ones called "switch" but can be modified in the code). To use simply aim at entity and run code.
local e,n e=player.GetAll()[1]:GetEyeTraceNoCursor().Entity n=0 hook.Add("Think", "test", function() n=n+0.01 if n>=1 then n=0 end e:SetPoseParameter("switch", n) end)
@MattJeanes
MattJeanes / HighestPlayTime.lua
Last active August 29, 2015 13:56
Finds the player with the most playtime of a certain rank, one line for console command usage.
local rank="trustedrespected" local p="" local n=0 for k,v in pairs(evolve.PlayerInfo) do if v.Rank==rank and v.PlayTime>n then p=v.Nick n=v.PlayTime end end evolve:Notify(evolve.colors.white, "The "..evolve.ranks[rank].Title.." with the highest playtime is ", evolve.colors.blue, p, evolve.colors.white, " with ", evolve.colors.red, math.floor(n/60/60/24).." days", evolve.colors.white, ".")
@MattJeanes
MattJeanes / KickCommand.lua
Created March 1, 2014 02:49
Adds a chat command to kick a player, only works if you're admin or super admin.
hook.Add("PlayerSay", "kick", function(ply,text)
if ply:IsAdmin() or ply:IsSuperAdmin() then
local t=string.Explode(" ", text)
if t and t[1] and t[1]:lower()=="!kick" then
if t[2] and string.len(t[2])>0 then
local n=t[2]
local pl={}
for k,v in pairs(player.GetAll()) do
if string.find(v:Nick():lower(), n:lower()) then
table.insert(pl,v)
@MattJeanes
MattJeanes / linkfilter_bypass.user.js
Last active August 29, 2015 14:04
Bypasses the steam link filter
// ==UserScript==
// @name Steam linkfilter bypass
// @namespace http://www.mattjeanes.com/
// @description Automatically bypasses the steam linkfilter.
// @include http*://steamcommunity.com/linkfilter/?url=*
// @run-at document-start
// ==/UserScript==
var str = window.location.href
var search = "?url="
@MattJeanes
MattJeanes / purge.lua
Last active August 29, 2015 14:04
Purge script for Garry's Mod, based on film 'The Purge'.
-- Purge. Written by Dr. Matt, initial version/idea by Paft.
AddCSLuaFile()
if SERVER then
util.AddNetworkString("purge")
local purge=false
local cooldown=false
local cooldowntime=15
@MattJeanes
MattJeanes / evolve_mass_privileges.lua
Last active August 29, 2015 14:13
Can be used to mass set/unset privileges
local thing=""
for k,v in pairs(evolve.privileges) do
if string.sub(v,0,thing:len())==thing then
local privilege = v
for k,v in pairs(evolve.ranks) do
local rank = k
if v.Immunity>=15 and v.Immunity < 99 then
if ( !table.HasValue( evolve.ranks[ rank ].Privileges, privilege ) ) then
table.insert( evolve.ranks[ rank ].Privileges, privilege )
end
@MattJeanes
MattJeanes / e2names.lua
Last active August 29, 2015 14:26
Quick one-liner to print the names, op counts, time-benches and player info of all currently spawned E2s
for k,v in pairs(ents.FindByClass("gmod_wire_expression2")) do print(v.name,math.Round(v.context.prfbench).." ops",math.Round(v.context.timebench*1000000).." us", v.context.player:Nick(), v.context.player:SteamID()) end
@MattJeanes
MattJeanes / gulpfile.js
Created January 18, 2017 22:01
Wallboard gulpfile
/// <binding BeforeBuild='build' Clean='clean' ProjectOpened='watch' />
var gulp = require('gulp');
var sass = require('gulp-sass');
var changed = require('gulp-changed');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var sourcemaps = require('gulp-sourcemaps');
var plumber = require('gulp-plumber');
var path = require('path');
var del = require('del');