Skip to content

Instantly share code, notes, and snippets.

View GenesisFR's full-sized avatar

David GenesisFR

View GitHub Profile
@GenesisFR
GenesisFR / FindWindow.cs
Last active June 26, 2023 21:50
C# method returning handles matching a given process name and class name
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace FindWindow
{
class FindWindow
@GenesisFR
GenesisFR / StringSplit.cpp
Last active February 24, 2019 03:32
C++ function to split strings
#include <sstream>
#include <vector>
using namespace std;
vector<string> split(const string &s, char delimiter = ',', bool includeEmpties = true)
{
vector<string> tokens;
string token;
istringstream tokenStream(s);
@GenesisFR
GenesisFR / ToBinary.c
Created November 23, 2018 13:20
C function to convert an integer to a binary string
#include <stdio.h>
#include <stdlib.h>
char * toBinary(int n)
{
const int size = sizeof(n) * 8;
char * str = (char*)malloc(sizeof(char) * (size + 1));
if (str)
{
@GenesisFR
GenesisFR / StringReplace.cpp
Created December 4, 2018 03:47
C++ function to replace all occurrences of a substring in a string
using namespace std;
string replaceAll(string str, const string &from, const string &to)
{
size_t start_pos = 0;
while ((start_pos = str.find(from, start_pos)) != string::npos)
{
str.replace(start_pos, from.length(), to);
start_pos += to.length(); // Handles case where 'to' is a substring of 'from'
}
#define _IN_FILE "in.txt"
#define _OUT_FILE "out.txt"
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
#include <windows.h>
using namespace std;
@GenesisFR
GenesisFR / ConditionalBreakpoint.cpp
Created March 7, 2019 00:07
VS2017 conditional breakpoint (strings)
strcmp(myString._Mypair._Myval2._Bx._Buf, "test") == 0
Note: mods are specified using a '-' character.
Braid mods backlog:
- Braid - Modyssee
- Braid - More now than ever
- Braid - Nyx
- Braid - Silverbraid
Half-Life 1 mods backlog:
Note: mods are specified using a '-' character. 100% means all achievements unlocked.
Games finished (most of them on stream), hardest difficulty:
- 35MM
- 8Bit Killer
- A Date in the Park (100%)
- A Way Out
- Aerinde
- Afterfall InSanity
@GenesisFR
GenesisFR / Movies.txt
Last active June 28, 2024 20:29
These are all the movies I've watched in my life, along with the ones I'd like to watch.
Note: movies watched are specified using a 'x' character, series in progress/unfinished have a '*' character.
Movies:
x 100 Girls
x 101 Dalmatians (https://www.imdb.com/title/tt0115433)
x 127 Hours
x 1408
x 17 Again
x 1917
@GenesisFR
GenesisFR / Music.txt
Last active March 16, 2024 10:13
These are all the bands I've listened to in my life, along with the ones I'd like to listen to.
Note: bands I completely listened to are specified using a 'x' character.
x +44
x 10cc
- 2Pac
x 3 Doors Down
x 888
- A.R. Rahman
x A Beacon School
x A Broken Silence