Skip to content

Instantly share code, notes, and snippets.

View JJL772's full-sized avatar
:shipit:

Jeremy L. JJL772

:shipit:
View GitHub Profile
@JJL772
JJL772 / tools.txt
Last active December 13, 2019 18:37
Tools
Some tools I think are useful
--- GDB w/ TUI MODE ---
tui enable - enables the TUI
when in the TUI: ctrl-x o switches window focus, used because the command window wont accept arrow keys when not selected.
--- Voltron ---
Tool for GDB, very useful.
--- LLDB ---
animationsystem.dll: AnimationSystemUtils_001
animationsystem.dll: AnimationSystem_001
bakedlodbuilder.dll: BakedLODBuilderMgr001
engine2.dll: GameServerData001
engine2.dll: ServerUploadGameStats001
#include <stdint.h>
typedef uint32_t(*fnInstallSchemaBindings_t)(int64_t,int64_t);
typedef int32_t(*fnGetResourceManifestCount_t)(void);
typedef int64_t(*fnGetResourceManifests)(uint32_t,int64_t,int64_t);
typedef uint64_t(*fnBinaryProperties_GetValue)(int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t,int64_t);
@JJL772
JJL772 / launch.sh
Created April 1, 2020 10:15
Launch script for half life alyx on proton
#!/bin/bash
# To use this script:
# VCON_PORT=port for vconsole2, or 29000 if not set
# PROTON_DIR=path to proton, fails if not set
# HLA_PATH=path to half life alyx, fails if not set
export STEAM_COMPAT_DATA_PATH=$HOME/proton
[[ -z "$VCON_PORT" ]] && VCON_PORT=29000
[[ -z "$HLA_PATH" ]] && echo "HLA_PATH is not set" && exit 1
[[ -z "$PROTON_DIR" ]] && echo "PROTON_DIR is not set" && exit 1
@JJL772
JJL772 / listener_example.lua
Created April 3, 2020 01:47
example script thingy
-- Stop listening to the events if we're already listening to them (this is so we can safely reload the script)
if onplayershoot_handle == nil then
StopListeningToGameEvent(onplayershoot_handle)
StopListeningToGameEvent(onplayerhurt_handle) -- we can assume this is valid too since they're added at the same time
end
function OnPlayerHurt(dmginfo)
Msg("Player has been hurt")
end
#!/usr/bin/env python3
# Plots a dataset of voltage/current measurements to test ohm's law
import matplotlib, sys, os, math, random, matplotlib.pyplot
import matplotlib.pyplot as plt
import numpy as np
# Measured voltages (No epsilon added)
datapointsx = [
/**
*
* Key Values parser
*
*/
#include "keyvalues.h"
#include <memory.h>
#include <stdlib.h>
#include <ctype.h>
/**
*
* keyvalues.h
*
* Parser for KeyValues files
*
* TODO: Add better memory management. Right now keys are all strduped and freed when the key is removed.
* this will probably lead to memory fragmentation.
* TODO: Improve the error handling
* TODO: Add support for conditionals
@JJL772
JJL772 / math_proxy.cpp
Created July 18, 2020 22:34
Fixes unresolved symbols when compiling the Source SDK 2013 on newer GCC toolchains. Note: you will need to enable -fabi-compat=2 for GCC to link properly
/**
*
* math_proxy.cpp - Implements certain unresolved symbols and points them to their proper endpoints
*
*/
#include <math.h>
#if __GNUC__ > 5
extern "C" float __powf_finite(float x, float y)
@JJL772
JJL772 / steamrt-setup.sh
Created July 28, 2020 03:29
steamrt docker setup script
#!/bin/bash
if [ $EUID -ne 0 ]; then
echo "Please run script as root"
exit 1
fi
function download_runtime()
{
URLROOT=https://repo.steampowered.com/steamrt-images-scout/snapshots/latest-steam-client-general-availability/