Skip to content

Instantly share code, notes, and snippets.

View Bobbias's full-sized avatar

Blair Stacey Bobbias

  • Barrie, Ontario, Canada
View GitHub Profile
@Bobbias
Bobbias / todo.py
Created June 16, 2022 00:36
todo-finder
import argparse
import glob
import re
# language/comment types supported
cpp = r'//'
python = r'#'
# keywords supported
todo = r'todo:'
@Bobbias
Bobbias / gist:6202836
Created August 11, 2013 00:34
enemy nations CPU speed check
// get the CPU speed (needed before screen res)
// FIXME: Excise this monstrosity. This has NO reason to exist any more.
if ( (m_iCpuSpeed = GetProfileInt ("Advanced", "CPUspeed", 0)) < 60 )
{
BOOL bGotSpeed = FALSE;
SYSTEM_INFO si;
::GetSystemInfo ( &si );
if ( (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL) && (si.wProcessorLevel >= 5) )
{
/*
/----------------------------------------------------------------
|
| DIBWND.CPP Window containing a bitmap.
|
| Child window containing a bitmap. Handles
| scrolling and resize.
|
| Copyright (c) 1996-1998 Ulrich von Zadow
|
@Bobbias
Bobbias / file format breakdown
Created October 10, 2012 01:16
ojn file format information so far
OJN file documentation
LITTLE ENDIAN
HEADER
INT genre
FLOAT bpm
short easy-leve
short med-level
class MyPawn extends UTPawn;
simulated function bool CalcCamera(float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV)
{
local vector start, end, hl, hn;
local actor a;
start = Location;
if (Controller != none)
import matplotlib.pyplot as plt
import numpy as np
import re
import string
from bitstring import BitStream, BitArray
from construct import *
in_file = open("dump.bin", "rb")
file_bytes = in_file.read()
s = structure
c = GreedyRepeater(SBInt16("foo"))
import matplotlib.pyplot as plt
import numpy as np
import re
import string
from bitstring import BitStream, BitArray
from construct import *
in_file = open("dump.bin", "rb")
file_bytes = in_file.read()
c = GreedyRepeater(SBInt16("foo"))
parsed = c.parse(file_bytes)
import matplotlib.pyplot as plt
import numpy as np
import re
import string
from bitstring import BitStream, BitArray
in_file = open("dump2.bin", "r")
file_bytes = bytearray(in_file.read())
i = 0
b = 0
for byte in file_bytes:
output looks like this:
F
A
3
G
5
D
etc.
@Bobbias
Bobbias / gist:2592829
Created May 4, 2012 07:19
For converting hex text to bin data for 0x10c ARG
import string
from bitstring import BitStream, BitArray
in_file = open("dump.log", "r")
out_file = open("dump.bin", "w")
text = in_file.read()
in_file.close()
split_text = text.splitlines()
for line in split_text:
blocks = line.split(' ')
for block in blocks: