Skip to content

Instantly share code, notes, and snippets.

View easierbycode's full-sized avatar

▓▒░ ♔ Daniel ♔ ░▒▓ easierbycode

View GitHub Profile
@easierbycode
easierbycode / gamepad-logger.js
Created June 2, 2025 22:24
gamepad-logger.js
let prevButtonStates = [];
let fullscreenToggled = false; // Flag to ensure fullscreen is toggled only once
window.addEventListener("gamepadconnected", (e) => {
console.log(`Gamepad ${e.gamepad.index} connected`);
prevButtonStates[e.gamepad.index] = [];
requestAnimationFrame(pollGamepads);
});
function pollGamepads() {
@easierbycode
easierbycode / hero.js
Last active May 31, 2025 19:05
hero.js
import { isset } from './utils.js';
const HERO_DEPTH = 50;
const IS_DEV = new URL(window.location.href).searchParams.get("debug") == "1";
// Running
const RUNNING_RIGHT = 'RUNNING_RIGHT';
const RUNNING_LEFT = 'RUNNING_LEFT';
@easierbycode
easierbycode / mactutorial.md
Created May 3, 2025 00:16 — forked from MarioMastr/mactutorial.md
A handy tutorial for building RSDKv5(U) and running Sonic Mania Plus or Sonic Origins on Mac (not featuring pictures).

WARNING: OUTDATED TUTORIAL. I will get around to updating this at some point, but for now I don't recommend following this tutorial to build the apps.

Seen all the tutorials for building RSDKv5(U) on Mac that you can muster but still haven't gotten it up and running yet? Well, I hope you can handle one more, because this will finally be the one to fix it! I can guarantee it because I was in your shoes and had to figure all this stuff out myself. This is a text tutorial for learning how to decompile RSDKv5(U) and run Sonic Mania Plus or Sonic Origins on your Mac.

How to build RSDKv5:

Step 1: Install Xcode and the command tools (the command tools can be installed by running this command: xcode-select --install but only after installing Xcode). If you already have them, move on to step 2.

@easierbycode
easierbycode / NOTES.txt
Created April 15, 2025 12:44
trump_pixel_art_animation
---
### How to create the zip
1. Create a folder named `trump_pixel_art_animation`.
2. Inside it, create the three files above with the exact content.
3. Run the Python scripts in order.
4. Zip the folder using your OS tools or command line:

Overview

How to document a new codebase Use this template to document a new codebase.

Business Logic

A place to record any important logic that you come across that is worth documenting.

Landmarks

Refers to the different landmarks of a codebase to help you navigate around. Where are the API methods defined? Where are interactions with the database?

const TILESET_HEIGHT = 8;
const TILESET_WIDTH = 8;
export const isObjectEmpty = (obj) =>
obj !== null
&& typeof obj === 'object'
// https://stackoverflow.com/a/32108184/4307769
&& Object.keys(obj).length === 0