Skip to content

Instantly share code, notes, and snippets.

View jay-tux's full-sized avatar
👀
Digital twins are surprisingly fun

Jay/Jonas jay-tux

👀
Digital twins are surprisingly fun
View GitHub Profile
@jay-tux
jay-tux / event.hpp
Created May 19, 2021 15:53
A simple, customizable, easy-to-use and subscribable event type in C++
#ifndef EVENT_H
#define EVENT_H
#include <vector>
#include <functional>
namespace jay {
//event class. Supports adding handlers and invoking them
template<class ... types>
class Event {
@jay-tux
jay-tux / esp_ebp_stack.cpp
Created April 25, 2022 15:07
Stack information using %esp and %ebp in C++
#include <iostream>
unsigned int stack_zero;
unsigned int stack_last;
#define GETREG(reg, out) \
asm("movl %%" #reg ", %0"\
: "=r" (out)\
: \
)