Skip to content

Instantly share code, notes, and snippets.

@looterz
looterz / gist:8018091
Created December 18, 2013 06:25
Starbind Early API Hook code
Detours::tChat__startChat Detours::oChat__startChat = NULL;
void __stdcall Detours::hChat__startChat(void)
{
// Preserve ECX
PBYTE *pThis = NULL;
__asm mov pThis, ecx
// Log that we were called
Output::Msg("hChat__startChat called!\n");
@looterz
looterz / getplayersummary
Created May 31, 2014 20:15
Garrysmod Steam API GetPlayerSummary example
local APIKey = "xxx";
function GetPlayerSummary( steamid64, callback )
local uri = string.format( "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=%s&steamids=%s", tostring( APIKey ), tostring( steamid64 ) );
local onSuccess = function( body, len, headers, code )
local json = (body and util.JSONToTable( tostring( body ) ) or {});

Keybase proof

I hereby claim:

  • I am looterz on github.
  • I am looter (https://keybase.io/looter) on keybase.
  • I have a public key whose fingerprint is 39ED A92D 3B25 08C2 C920 F264 70AC 9E3B 3323 ACE1

To claim this, I am signing this object:

@looterz
looterz / Mdmp.lua
Created June 28, 2017 11:39 — forked from Velkon/Mdmp.lua
local red = Color(255,0,0)
local green = Color(0,255,0)
local function log(color,s)
MsgC(color,s .. "\n")
end
function mdmp(out)
local files,_ = file.Find("*.mdmp","BASE_PATH")
if out then log(red,"Found " .. #files .. " files!") end
#!/bin/bash
# export DBUS_SESSION_BUS_ADDRESS environment variable because cron hates me
PID=$(pgrep -u USER gnome-session-b)
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
/usr/bin/gsettings set org.gnome.shell.extensions.user-theme name 'Flat-Plat'
/usr/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Flat-Plat'
/usr/bin/gsettings set org.gnome.desktop.background picture-uri 'file://WALLPAPER-PATH'
/usr/bin/gsettings --schemadir ~/.local/share/gnome-shell/extensions/drop-down-terminal@gs-extensions.zzrough.org set org.zzrough.gs-extensions.drop-down-terminal background-color 'rgb(69,90,100)'
local function _W(f) local e=setmetatable({}, {__index = _ENV or getfenv()}) if setfenv then setfenv(f, e) end return f(e) or e end
local bit=_W(function(_ENV, ...)
--[[
This bit API is designed to cope with unsigned integers instead of normal integers
To do this we add checks for overflows: (x > 2^31 ? x - 2 ^ 32 : x)
These are written in long form because no constant folding.
]]
local floor = math.floor
@looterz
looterz / Install-LinuxToolChain
Last active February 4, 2018 23:55 — forked from megamorf/Install-LinuxToolChain
Powershell function to help setting up the Linux toolchain for UE4
function Install-LinuxToolChain {
<#
.SYNOPSIS
Downloads and installs the UE4 linux toolchain components.
.DESCRIPTION
Downloads the clang compiler to $ToolChainDestination and creates a
system-wide environment variable pointing to it.
Afterwards you have to regenerate the UE4 engine project files and
@looterz
looterz / README.md
Last active October 17, 2021 17:59
UE4 Loading Screen with Progress

This will only work in cooked builds with Event Driven Loader enabled (enabled by default). Currently this only shows the specified packages loading progress, but not dependant packages, which is an annoying issue since that is where most of the loading time is for maps.