This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'hook' -- make sure it's loaded | |
local function stringifyArgs(...) | |
local limit = select('#', ...) | |
local function stringifyHelper(n, a, ...) | |
if n > limit then return end | |
local t = type(a) | |
if t == 'player' then | |
return '('..n..') ' .. a:Name() .. "(" .. a:SteamID() .. ")", stringifyHelper(n + 1, ...) | |
elseif t == 'number' or t == 'string' then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local texture = GetRenderTarget('uniquert'..os.time(), 512, 100, false) | |
local mat = CreateMaterial("uniquemat"..os.time(),"UnlitGeneric",{ | |
['$basetexture'] = texture, | |
}); | |
hook.Add('HUDPaint', 'sao', function() | |
local scrw, scrh = ScrW(), ScrH() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- INSTALLATION INSTRUCTIONS: | |
-- 1) copy this file into garrysmod/lua/diagnostic-dump.lua creating the file if it does not exist | |
-- 2) run the script by loging into your rcon or commandline and typing lua_openscript diagnostic-dump.lua | |
-- 3) copy the text in garrysmod/data/diagnostic-dump.txt and upload it to hastebin.com or pastebin.com and provide it as a link in your | |
-- support ticket. | |
local dumpers = {} | |
local biggestHeaderLength = 0 | |
local function dumpFunction(func) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dumpbin /exports lua_shared.dll > lua_shared.def | |
then setup the def file with the format: | |
EXPORTS | |
FUNC1 | |
FUNC2 | |
... | |
lib /machine:x86 /def:lua_shared.def /out:lua_shared.lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local quotes = { | |
['\''] = true, | |
['\"'] = true | |
} | |
local function parseString(line) | |
local function skipWhiteSpace(index) | |
return string.find(line, '%S', index) | |
end | |
local function findNextSpace(index) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
JsonStream by Gareth George | |
LICENSE: The do whatever the heck you want with it license. | |
Do what you want with it, when you want to do it. I take no responsibility for any damages that may occur in the usage of this script. This means no guaranties as to its reliability or stability. | |
USAGE: | |
file = open_stream('filename.json', 'rb') # opens the file with the given file name to be read as a json stream | |
file = open_stream('filename.json.gz', 'rb') # opens the COMPRESSED file with the file name to be read as a json stream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aiohttp | |
import asyncio | |
async def fetch(session, url): | |
with aiohttp.Timeout(10): | |
async with session.get(url) as response: | |
return await response.text() | |
async def fetch_all(session, urls, loop): | |
results = await asyncio.gather( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://2097152` | |
/usr/sbin/diskutil erasevolume HFS+ "RamDisk" $DISK | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 2.8) | |
project(game) | |
find_package(Threads) | |
find_package(OpenGL) | |
find_package(SDL) | |
set(POLYCODE_DIR /Users/garethgeorge/Desktop/GameDev/Polycode-Framework) | |
set(POLYCODE_LIBS | |
${POLYCODE_DIR}/Core/lib/libPolycore.a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import os.path | |
import fnmatch | |
import logging | |
import ycm_core | |
BASE_FLAGS = [ | |
'-Wall', | |
'-Wextra', | |
'-Werror', |
OlderNewer