Skip to content

Instantly share code, notes, and snippets.

View john-peterson's full-sized avatar

John Sebastian Peterson john-peterson

View GitHub Profile
#include <windows.h>
#include <iostream>
using namespace std;
typedef unsigned int(__stdcall *f_cb)(const char*,int,int,const char*);
typedef unsigned int(__stdcall *f_wcb)(f_cb,int,char**);
typedef int(__cdecl *f_unarc)(f_cb,const char*,const char*,const char*,const char*,const char*,const char*,const char*,const char*,const char*,const char*);
@john-peterson
john-peterson / flatten.sh
Last active August 17, 2023 08:29
wget picks up where gallery-dl left off
find . -mindepth 2 -type f -name '*.jpg' -exec cp -t . -i '{}' +
@john-peterson
john-peterson / r2.md
Last active August 3, 2023 16:02
radare2

Default

e scr.highlight.grep=1
e scr.color.grep=1
e asm.highlight=1
e asm.pseudo=1
e asm.marks=0
e asm.cmt.col=0
e asm.indentspace=0
@john-peterson
john-peterson / sdl2-config.ini
Last active July 5, 2023 11:56
DON'T USE QUOTES !!!!!
[ControlsP0]
button_a=engine:sdl,port:0,guid:030000005e0400008e02000010010000,button:0
button_b=engine:sdl,port:0,guid:030000005e0400008e02000010010000,button:1
button_x=engine:sdl,port:0,guid:030000005e0400008e02000010010000,button:2
button_y=engine:sdl,port:0,guid:030000005e0400008e02000010010000,button:3
button_lstick=
button_rstick=
button_l=
@john-peterson
john-peterson / merge-nsp.sh
Last active July 2, 2023 20:34
Merge base and update NSP into a single file. We used to call it slipstream when we used windows
mkdir .switch base update exefs romfs nca nsp
basensp=diablo3.nsp
updatensp=diablo3u.nsp
cp .local/share/yuzu/keys/prod.keys .switch/
sed 's/|[^|]*$//' .local/share/yuzu/keys/title.keys | sed 's/|/=/' > .switch/title.keys
hactool -t pfs0 $basensp --outdir base
hactool -t pfs0 $updatensp --outdir update
extra-keys = [[ESC, '$', &, +, *, HOME, 'UP','END','PGUP'], \
[CTRL, ALT,_, ~, -, LEFT,'DOWN','RIGHT','PGDN'], \
[TAB, ':','\"', '/', '|', '\\\\', DEL, ENTER, PASTE]]
@john-peterson
john-peterson / color.properties
Last active June 27, 2023 08:51
Daytime colors that work everywhere
# https://raw.githubusercontent.com/Gogh-Co/Gogh/master/themes/Google%20Light.yml
color0=#202124
color1=#EA4335
color2=#34A853
color3=#FBBC04
color4=#4285F4
color5=#A142F4
color6=#24C1E0
color7=#E8EAED
@john-peterson
john-peterson / disable_journal.c
Last active December 18, 2015 11:29
Disable HFS+ journaling
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <byteswap.h>
int main(int argc, char *argv[])
{
@john-peterson
john-peterson / VertexLoaderManager.cpp
Last active December 17, 2015 15:19
AddList: unknown count of vertices found
void RunVertices(int vtx_attr_group, int primitive, int count)
{
if (!count)
return;
RefreshLoader(vtx_attr_group);
g_VertexLoaders[vtx_attr_group]->RunVertices(vtx_attr_group, primitive, count);
if (primitive == 2 && count % 3 != 0) {
NOTICE_LOG(VIDEO, "RunVertices: unknown count of vertices found %u, %u, %u", vtx_attr_group, primitive, count);
for (int i = 1; i <= count; i++) {
@john-peterson
john-peterson / gist:5481542
Last active December 16, 2015 18:59
git diff --stat -p _diff..state
Source/Core/Core/Src/ConfigManager.cpp | 4 -
Source/Core/Core/Src/State.cpp | 44 +++++--
Source/Core/Core/Src/State.h | 4 +-
Source/Core/DolphinWX/Src/Frame.cpp | 204 ++++++++----------------------
Source/Core/DolphinWX/Src/FrameTools.cpp | 4 +-
5 files changed, 85 insertions(+), 175 deletions(-)
diff --git a/Source/Core/Core/Src/ConfigManager.cpp b/Source/Core/Core/Src/ConfigManager.cpp
index 1c686ae..ded0cd1 100644
--- a/Source/Core/Core/Src/ConfigManager.cpp