Skip to content

Instantly share code, notes, and snippets.

@gareve
gareve / README.md
Created June 8, 2023 16:05
[USB Foot Pedal] Trigger a terminal command with your foot

Problem

While working on scripts, I execute it hundreds of times while iterating on it (big fan of baby steps approach).

To run my script, I usually have to switch focus to my terminal & run the last command, which makes me lose a bit of focus after the 10th+ time.

One solution is to use a file monitor that runs a command everytime a file gets modified, but in my experience, for most scripts I want to decide when to rerun the script.

After buying a USB foot pedal, I was wondering how can I use it to automate this small inconvenience.

Solution

@gareve
gareve / contra_enemy_hp_stats_and_force_loop.lua
Created June 5, 2023 23:51
[Contra NES][Memory Inspection] Enemy HP Stats research for Difficulty/Loop Challenge
--[[
This script renders the enemy HP in screen + forces a difficulty/loop level
Made with the help of the followin apps & resources
bizhawk@Linux = monocomplete + libopenal1
Game Genius Addresses: https://gamehacking.org/game/29281
Contra Lua Sample Code: https://www.romhacking.net/games/137/
HP of enemies in final level
#include <bits/stdc++.h>
#define foreach(IT,C) for(typeof(C.begin())IT=C.begin();IT!=C.end();IT++)
using namespace std;
typedef long long L;
string alphabet = "abcdefghjkmnpqrstuvwxyz";// alphabet for unmodified problem
//string alphabet = "abcdefghijklmnopqrstuvw"; // Question 3. equivalent to remove i,j, and o
set<string> passwords;