Skip to content

Instantly share code, notes, and snippets.

@EliteMasterEric
EliteMasterEric / Null Safety Examples.hx
Created June 23, 2025 19:39
Examples of the different types of null safety.
class MyClass {
public var foo:Null<String>;
public function cleanup() {
foo = null;
}
}
class Test {
@EliteMasterEric
EliteMasterEric / git-filter-repo.sh
Created May 25, 2025 08:44
git-filter-repo script used to remap assets module commits
// Commands for rewriting commit history to remove certain files.
// Requires installing git-filter-repo: https://github.com/newren/git-filter-repo
// Any one of these commands creates a new, incompatible Git history starting with any commits that have changed,
// so only do it when absolutely necessary,and be prepared to run several of these commands before you have a stable history again.
// Remove files from the given list from a repo.
git filter-repo --invert-paths --paths-from-file ../to-sanitize-assets.txt --force
// Utilize the commit map to fix commit links.
-- Handles functionality for managing the fight against Mom in Depths 2.
-- Determine whether the hooks in this module are relevant for the current challenge.
---@return boolean Whether the hooks are valid.
local function isHookValid()
if not ChallengeAPI:AreHooksActive() then
return false
end
local goal = ChallengeAPI:GetCurrentChallengeGoal()
@EliteMasterEric
EliteMasterEric / sort_dependencies.py
Created April 15, 2025 04:27
Sort dependencies generated by Haxe compiler (-D dump-dependencies)
import os
from collections import defaultdict
def is_core_file(file):
"""Determine if a file is a core file that should be prioritized in dependency resolution."""
core_indicators = ['StdTypes.hx', 'String.hx', 'Array.hx']
return any(indicator in file for indicator in core_indicators)
def find_strongly_connected_components(graph):
"""Find all strongly connected components in the graph using Tarjan's algorithm."""

Creative Commons Assets Used:

Graphics:

Sound Effects:

Why License?

With no license, code is "All Rights Reserved" and any other application using your code is committing copyright infringement! So you should choose a license for any code you distribute publically.

Licenses will additionally protect the copyright holder from damages, and absolve any liability or unstated warranties related to the copyrighted code.

Copyleft Licenses

  • Generally require any changes to the provided source files to be redistributed.
  • Pros:
    • Encourages contributions to the original project and benefits the open-source community.
  • Prevents massive companies from selling open-source software.
package;
import flixel.system.FlxAssets.FlxShader;
import openfl.display.BitmapData;
/**
* Implements the overlay blend mode as a Flixel shader.
*
* @see https://en.wikipedia.org/wiki/Blend_modes#Overlay
* @author EliteMasterEric
@EliteMasterEric
EliteMasterEric / tweepy_unfollow.py
Created November 3, 2022 04:59
Get a list of all the users who are not your mutuals, and unfollow them. Updated for Twitter API v2.
import time
import tweepy
import sys
# Debug
#import logging
#logging.basicConfig(level=logging.DEBUG)
# Go here and create a Project: https://developer.twitter.com/en/portal/projects-and-apps
# Then go to the Keys and Tokens tab and copy the values below.
@EliteMasterEric
EliteMasterEric / CollapsibleDialog.hx
Created October 21, 2022 06:03
A dialog which can collapse with a button, in HaxeUI.
// package;
import haxe.ui.containers.dialogs.Dialog;
class CollapsibleDialog extends Dialog
{
public var dialogMinMaxButton:haxe.ui.components.Image;
var _minimized:Bool = false;
@EliteMasterEric
EliteMasterEric / CarCrashMenu.hxc
Created July 31, 2022 23:34
Throw this into a mod folder when the next FNF update comes out.
import flixel.FlxG;
import flixel.system.FlxSound;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import funkin.modding.module.Module;
import funkin.Paths;
import funkin.TitleState;
class CarCrashMenu extends Module
{