Skip to content

Instantly share code, notes, and snippets.

@handsomematt
handsomematt / kill_steam.js
Created October 16, 2014 18:13
Chrome extension to kill Steam link filter
chrome.webRequest.onBeforeRequest.addListener(function(pre_req) {
var url = pre_req.url;
var match = url.match("url=(.*)");
if (match && match[1]) {
return { redirectUrl: match[1] };
}
}, {
// ==UserScript==
// @name acecooled
// @namespace http://gayyyyy.com
// @version 0.1
// @description enter something useful
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @match http://*facepunch.com/showthread.php?t=*
// @copyright 2012+, You
// ==/UserScript==
local gmod = gmod
local pairs = pairs
local isfunction = isfunction
local isstring = isstring
local IsValid = IsValid
local unpack = unpack
module( "hook" )
local Hooks = {}
#ifndef _LND_H_
#define _LND_H_
// Includes
#include <mvmath.h> // This include file includes the math functions
#include <ddraw.h> // for DXT3
//
// Structures
@handsomematt
handsomematt / tradable.lua
Created June 28, 2013 17:14
Example usage of classes.
local Tradable = Class(function(self, inst)
self.inst = inst
self.goldvalue = 0
end)
function Tradable:CollectUseActions(doer, target, actions)
if target.components.trader and target.components.trader.enabled then
table.insert(actions, ACTIONS.GIVE)
end
end
@handsomematt
handsomematt / class.lua
Created June 28, 2013 17:11
Classes in Lua.
-- class.lua
-- Compatible with Lua 5.1 (not 5.0).
function Class(base, _ctor)
local c = {} -- a new class instance
if not _ctor and type(base) == 'function' then
_ctor = base
base = nil
elseif type(base) == 'table' then
-- our new class is a shallow copy of the base class!
for i,v in pairs(base) do