Skip to content

Instantly share code, notes, and snippets.

View david-wm-sanders's full-sized avatar
🖋️
up late

David Sanders david-wm-sanders

🖋️
up late
View GitHub Profile
@ItsDoot
ItsDoot / _description.md
Last active January 7, 2024 00:17
Bevy + egui in a text-based, turn-based adventure game.

Bevy + egui in a text-based, turn-based adventure game.

I won't go too far into the nitty details (lol), but this is generally how I've structured my WIP mostly-text-based, turn-based adventure game. I emphasize that because I suspect this approach doesn't work all that well for other styles of games. Specifically, because practically everything in my game happens on-click; there's very little running in the background.

TL;DR?

Nah, I strained my eyes for this.

@leddoo
leddoo / reg_vm.rs
Created December 29, 2022 11:03
a very simple register vm
// a very minimal instruction set.
// it has just enough operations to implement a recursive
// fibonacci function - what a coincidence :D
// NOTE: in my VM, i don't use an `enum`.
// this is just for simplicity.
#[derive(Clone, Copy, Debug)]
enum Instruction {
LoadInt { dst: u8, value: i16 },
Copy { dst: u8, src: u8 },
Add { dst: u8, src1: u8, src2: u8 },
@h3r2tic
h3r2tic / restir-meets-surfel-lighting-breakdown.md
Created November 23, 2021 02:15
A quick breakdown of lighting in the `restir-meets-surfel` branch of my renderer

A quick breakdown of lighting in the restir-meets-surfel branch of my renderer, where I revive some olde surfel experiments, and generously sprinkle ReSTIR on top.

General remarks

Please note that this is all based on work-in-progress experimental software, and represents a single snapshot in development history. Things will certainly change 😛

Due to how I'm capturing this, there's frame-to-frame variability, e.g. different rays being shot, TAA shimmering slightly. Some of the images come from a dedicated visualization pass, and are anti-aliased, and some show internal buffers which are not anti-aliased.

Final images

@david-wm-sanders
david-wm-sanders / rwr_settings_snippet.xml
Last active June 16, 2022 17:38
RWR settings.xml controls explained
<keyboard_controls>
<!-- UP: W (0x11) -->
<control0 value="17" />
<!-- DOWN: S (0x1F) -->
<control1 value="31" />
<!-- LEFT: A (0x1E) -->
<control2 value="30" />
<!-- RIGHT: D (0x20) -->
<control3 value="32" />
<!-- RELOAD: R (0x13) -->
@haram
haram / be_fn.hpp
Last active May 14, 2024 15:37
Replicate BattlEye initialization to dump data out of it
#pragma once
#include <stdint.h>
#include <stdio.h>
namespace be
{
void print_message( const char* msg )
{
printf( "[BATTLEYE] %s\n", msg );
}
@haram
haram / decrypt.cpp
Created June 20, 2020 02:51
Escape From Tarkov encryption defeated
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
// yousif, namazso, can1357, defcon42
namespace packet
{
constexpr size_t be_xor_key = 0xd774f59d;
@MaxXor
MaxXor / btrfs-guide.md
Last active July 7, 2024 22:54
Btrfs guide to set up an LUKS-encrypted btrfs raid volume with included maintenance & recovery guide

Encrypted Btrfs storage setup and maintenance guide

Initial setup with LUKS/dm-crypt

This exemplary initial setup uses two devices /dev/sdb and /dev/sdc but can be applied to any amount of devices by following the steps with additional devices.

Create keyfile:

dd bs=64 count=1 if=/dev/urandom of=/etc/cryptkey iflag=fullblock
chmod 600 /etc/cryptkey
@M0r13n
M0r13n / README.md
Last active June 22, 2024 00:14
Logging with Loguru in Flask

This is a simple example of how to use loguru in your flask application

Just create a new InterceptHandler and add it to your app. Different settings should be configured in your config file, so that it is easy to change settings.

Logging is then as easy as:

from loguru import logger

logger.info("I am logging from loguru!")

@dusekdan
dusekdan / window_helper.py
Created March 15, 2019 16:59
Snippet of python code to help working with Windows under win32gui.
import win32gui
import re
class WindowMgr:
"""Encapsulates some calls to the winapi for window management"""
def __init__ (self):
"""Constructor"""
self._handle = None
@oleavr
oleavr / jit-example.js
Created January 27, 2019 20:18
Frida JIT example
'use strict';
const slowCallback = new NativeCallback(value => {
console.log('slowCallback hit');
return 43;
}, 'int', ['int']);
const fastCallback = Memory.alloc(Process.pageSize);
Memory.patchCode(fastCallback, 128, code => {
const cw = new X86Writer(code, { pc: fastCallback });