Skip to content

Instantly share code, notes, and snippets.

View pldubouilh's full-sized avatar

Pierre Dubouilh pldubouilh

View GitHub Profile
@pldubouilh
pldubouilh / papers_please_fix.cpp
Created January 2, 2022 14:23 — forked from Henje/papers_please_fix.cpp
Simple hack to disable joystick scanning and remove stutters from Papers Please.
#include <string>
#include <dlfcn.h>
#include <stdio.h>
#include <sys/mman.h>
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
using namespace std::literals;
@pldubouilh
pldubouilh / get.c
Created February 10, 2021 15:19 — forked from garcia556/get.c
POSIX shared memory IPC example (shm_open, mmap), working on Linux and macOS
#include <stdio.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#define STORAGE_ID "/SHM_TEST"
#define STORAGE_SIZE 32
int main(int argc, char *argv[])
@pldubouilh
pldubouilh / hexDump.c
Last active September 20, 2018 13:52 — forked from leonid-ed/hexDump.c
This function prints hex dump of memory specified as a pointer
/*
* This function prints hex dump of memory specified as a pointer.
* Reference: http://stackoverflow.com/questions/7775991/how-to-get-hexdump-of-a-structure-data
*/
#include <stdio.h>
void hexdump(void *addr, int len)
{
int i;
unsigned char buff[17];
@pldubouilh
pldubouilh / emoji.js
Last active January 19, 2016 16:29 — forked from windytan/emoji.pl
Visualize SSH public key fingerprints using Unicode emoji
// Taken from Oona Räisänen 2013 / http://windytan.com
// Adapted to work well with b64 encoded keys
// ssh-keygen -lf ~/.ssh/id.pub | node emoji.js
var glyphs = [ '🌀','🌂','🌅','🌈','🌙','🌞','🌟','🌠','🌰','🌱','🌲','🌳','🌴','🌵','🌷','🌸',
'🌹','🌺','🌻','🌼','🌽','🌾','🌿','🍀','🍁','🍂','🍃','🍄','🍅','🍆','🍇','🍈',
'🍉','🍊','🍋','🍌','🍍','🍎','🍏','🍐','🍑','🍒','🍓','🍔','🍕','🍖','🍗','🍘',
'🍜','🍝','🍞','🍟','🍠','🍡','🍢','🍣','🍤','🍥','🍦','🍧','🍨','🍩','🍪','🍫',
'🍬','🍭','🍮','🍯','🍰','🍱','🍲','🍳','🍴','🍵','🍶','🍷','🍸','🍹','🍺','🍻',