Skip to content

Instantly share code, notes, and snippets.

View Kefta's full-sized avatar
🤠
out on the range like an ArrayOutOfBoundsException

code_gs Kefta

🤠
out on the range like an ArrayOutOfBoundsException
View GitHub Profile
LUA_FUNCTION( Vector_Serialize )
{
LUA->CheckType(1, GarrysMod::Lua::Type::Vector);
const Vector& vec = *LUA->GetUserType<Vector>(1, GarrysMod::Lua::Type::Vector);
const char* const separator = LUA->GetType(2) <= GarrysMod::Lua::Type::Nil
? LUA->CheckString(2) : " ";
LUA->PushFormattedString("%u%s%u%s%u", vec.x, separator, vec.y, separator, vec.z);
@Kefta
Kefta / RYMDeleteWishlist.js
Last active September 29, 2021 11:33
Run in your devtool snippets on chrome while on the DomainLink
// Overengineered script to remove items from an RYM wishlist
const DomainLink = "rateyourmusic.com" // Base domain link
const WishlistLinkPath = "/collection/username/wishlist,ss.d"; // Link to the wishlist
const MinPageNum = 1; // inclusive, <1 == 1
const MaxPageNum = 0; // inclusive, <1 == Max wishlist page
const MinRequestTime = 8000; // ms
const MaxRequestTime = 10000;
@Kefta
Kefta / rym_collection_buttons.js
Created February 21, 2020 02:44
RateYourMusic Collection Buttons
// ==UserScript==
// @name RateYourMusic Collection Buttons
// @include *://rateyourmusic.com/collection/*
// @grant metadata
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
// ==/UserScript==
const tReleaseTypes = [["typs", "albums"],
["type", "eps"],
["typi", "singles"],
@Kefta
Kefta / 20190903.lua
Last active September 3, 2019 16:34
Lua program for planning my radio show
--[=[
// 2019-09-03 - 2:48:49 //
[1] Ghettotech/Juke/Footwork - 24:18
1.Feelin - DJ Rashad feat. DJ Spinn & Taso - Double Cup - 4:31
2.Feelin' - DJ Rashad - TEKLIFE Vol. 1: Welcome to the Chi - 4:02
3.Move Da Booty - D.J. Funk - Booty House Anthems 2 - 0:28
4.Have'n Sex ???? Hell Yea!!!!! - D.J. Funk - Booty House Anthems 2 - 1:15
5.Footworkin on Air - Traxman - Da Mind of Traxman - 4:01
6.Itz Crack - Traxman - Da Mind of Traxman - 3:02
@Kefta
Kefta / gs_common.lua
Last active November 11, 2018 00:20
Rainbow mode for Robotboy655's lightsabers. Works but the code is still pretty atrocious
-- gs_common by code_gs
-- Last updated 11/10/2018
-- Goes in lua/gs_common.lua
-- gs_lib on the way, but for now, here's a common file to dump everything for misc scripts
AddCSLuaFile()
-- Localise globals to save on global lookups in type checking functions
-- Need to eek out as much performance as possible to have a minimal footprint on runtime
/// Lua method declaration ///
// Placeholders, better methods probably already defined somewhere
bool CheckDefaultValue( int iStackPos, int iType )
{
int iRetType = g_Lua->GetType( iStackPos );
if ( iRetType == iType )
return true;