Skip to content

Instantly share code, notes, and snippets.

@Jan200101
Jan200101 / test.cpp
Last active January 15, 2024 17:15
Test Program to verify the implicit behavior of DirectSoundCaptureCreate making use of winmm
#include <windows.h>
#include <cstdio>
#include <dsound.h>
typedef HRESULT(*tDirectSoundCaptureCreate)(LPCGUID lpcGUID, IDirectSoundCapture** ppDSC, IUnknown* pUnkOuter);
tDirectSoundCaptureCreate pDirectSoundCaptureCreate;
int main()
{
HMODULE hModule;
// pack.src
// NAME!BASE64
shell = get_shell
computer = shell.host_computer
// start ../lib-src/libbase64.src
// libbase64.src
// based on https://github.com/iskolbin/lbase64
// MIT License
@Jan200101
Jan200101 / ubuild_bs.src.lua
Last active January 5, 2024 22:18
ubuild bootstrap
// ubuild.src
if params.len != 2 or params[0] == "-h" or params[0] == "--help" then exit("<b>Usage: "+program_path.split("/")[-1]+" [CODE] [OUT]</b>")
shell = get_shell
computer = shell.host_computer
// start ../lib-src/pathsep.src
PATHSEP = "/"
// end ../lib-src/pathsep.src
import random
min_val = 0
max_val = 100
max_list = list(range(min_val, max_val, 1))
min_list = max_list[::-1]
random_list = [random.randrange(min_val, max_val) for x in range(len(max_list))]
@Jan200101
Jan200101 / struct_offset_calc.py
Created December 4, 2023 11:56
Calculate Structs and relevant padding for Northstar offset structs
import sys
if len(sys.argv) != 2:
print("calc.py [input]")
exit(1)
with open(sys.argv[1], "r") as fd:
data = fd.read()
MAX_SIZE = None
@Jan200101
Jan200101 / pagerank.py
Created November 24, 2023 08:28
pagerank
from __future__ import annotations
class Page:
o = 0.5
def __init__(self, iid):
self.id = iid
self.references = []
self.referers = []
self.rank = 1
#!/usr/bin/env bash
export GAME="/home/sentry/Games/TF2/server"
export WINEPREFIX="${GAME}/pfx"
export WINEARCH="win64"
export WINEDEBUG="-all"
export DXVK_LOG_LEVEL="none"
export VKD3D_DEBUG="none"
export LIBGL_ALWAYS_SOFTWARE=1
export GALLIUM_DRIVER=llvmpipe
@Jan200101
Jan200101 / nvml.c
Created August 10, 2023 19:13
nvml test
#include <stdio.h>
#include <dlfcn.h>
static void *nvml_handle;
typedef struct {
unsigned long long total;
unsigned long long free;
unsigned long long used;
} nvmlMemory_t;
#!/usr/bin/env bash
# https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html
# https://cmake.org/cmake/help/latest/variable/CMAKE_POLICY_DEFAULT_CMPNNNN.html
POLICIES=(0017,0020)
export CC=cl
export CXX=cl
exec "cmake" \
#!/usr/bin/env python3
TEST_DATA = False
IGPU_PCI_PREFIX = r"pci-0000_00"
import sys
from traceback import print_exc
import re
from enum import Enum