Skip to content

Instantly share code, notes, and snippets.

View JJL772's full-sized avatar
:shipit:

Jeremy L. JJL772

:shipit:
View GitHub Profile
/**
*
* 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
/**
*
* Key Values parser
*
*/
#include "keyvalues.h"
#include <memory.h>
#include <stdlib.h>
#include <ctype.h>
#!/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 = [
@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
@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
#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);
animationsystem.dll: AnimationSystemUtils_001
animationsystem.dll: AnimationSystem_001
bakedlodbuilder.dll: BakedLODBuilderMgr001
engine2.dll: GameServerData001
engine2.dll: ServerUploadGameStats001
@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 ---
@JJL772
JJL772 / .vimrc
Last active December 16, 2019 08:37
THIS IS MY VIMRC THAT I USE ALWAYS. IT MAKE VIM GOOD
set runtimepath+=~/.vim_runtime
set number
colorscheme monokai
let g:ycm_global_ycm_extra_conf = '~/.vim/.ycm_extra_conf.py'
" All plugins will be in this folder
call plug#begin('~/.vim/bundle')
import os
import os.path
import fnmatch
import logging
import ycm_core