Skip to content

Instantly share code, notes, and snippets.

View TheNullicorn's full-sized avatar
🌸
*dramatic bongos*

nullicorn TheNullicorn

🌸
*dramatic bongos*
View GitHub Profile
@TheNullicorn
TheNullicorn / openfl-preform-debug-mode.md
Created August 24, 2025 16:44
Enabling virtual printers in OpenFL PreForm 2.3.3 (Debug Mode)

It turns out OpenFL PreForm 2.3.3 does actually support virtual printers for the Form 1, Form 1+ and Form 2, which allows dumping a print’s .flp files to a local directory.

It is unfortunately disabled in the public build, but it is relatively simple to enable by editing PreForm.exe in a hex editor.

Notes:

  • This is specifically for the OpenFL 2.3.3 release of PreForm for Windows, found on the OpenFL GitHub page
  • Make a backup of PreForm.exe! exe files are extremely sensitive to edits, and if done incorrectly PreForm will crash when opened. If that happens, delete the edited PreForm.exe and replace it with your backup copy with the same name! Alternatively, reinstalling PreForm should overwrite the broken copy
@TheNullicorn
TheNullicorn / Xbl-Update-Auth.md
Created September 5, 2024 22:57
A short guide to obtaining credentials for packagespc.xboxlive.com and updatepc.xboxlive.com

1. Obtain a Microsoft Live access token

https://login.live.com/oauth20_authorize.srf?client_id=00000000402b5328&response_type=token&scope=service::user.auth.xboxlive.com::MBI_SSL&redirect_uri=https%3A%2F%2Flogin.live.com%2Foauth20_desktop.srf

Visit the above URL in a browser and log in. You'll be redirected to a blank page. The new URL in the address bar contains a Microsoft Live access token for your account, which is required for Xbox Live authentication.

I've just been pasting them into this CyberChef recipe while testing to get the access_token part out quickly.

@TheNullicorn
TheNullicorn / keybase.md
Created January 3, 2023 21:31
Keybase Proof (Keybase: nllcrn)

Keybase proof

I hereby claim:

  • I am thenullicorn on github.
  • I am nllcrn (https://keybase.io/nllcrn) on keybase.
  • I have a public key ASB7iqVzPvfDtMzsi1aIsMIcvyP04-YGqueBcrOhp35hGgo

To claim this, I am signing this object:

@TheNullicorn
TheNullicorn / bits_reverse.kts
Last active March 5, 2022 22:49
Kotlin utility for reversing the order of bits in an Int
/**
* Returns a Byte identical to the current one, but with the positions of the least-significant `n`
* bits reversed, where `n` = [width].
*
* This means that the bit at position `0` will be replaced with the value of the bit at position
* `width - 1`, and vice-versa.
*
* **Not to be confused with the [invert][Int.inv] function, which toggles all bits in place.**
*
* #### Examples:

Kotlin's implementations of the algorithms described by Ross N. Williams in his paper, "A Painless Guide to CRC Error Detection Algorithms". See below for a link.

This gist exists solely for the purpose of archive as I learn about CRC algorithms, and I wouldn't recommend these implementations in practice due to my unfamiliarity with them at the time of writing this.

Attributions 💞

  • Ross N. Williams: ["A Painless Guide to CRC Error Detection Algorithms"][ross_original]
@TheNullicorn
TheNullicorn / guide.md
Last active January 8, 2022 15:46
Setting up a 1.8.9 modding environment in 2022
  1. In your file explorer (e.g. Finder):

    1. Unzip forge's MDK. This should create a new directory with the same name as the zip.
  2. In a command line / terminal / console:

    1. cd /path/to/unzipped/directory
    2. ./gradlew setupDecompWorkspace
  3. In IntelliJ IDEA:

    1. Select the "Open" button
  4. In older versions this may be labeled "Import" or "Import Project"

@TheNullicorn
TheNullicorn / config.json
Created August 10, 2020 16:43
A simple example of a Discord bot which returns the current Hypixel player count in an embed
{
"hypixel_api_key": "Your Hypixel API key (run '/api new' on Hypixel to get this)",
"bot": {
"token": "Your Discord bot's token",
"name": "Hypixel PlayerCount Bot",
"command_indicator": ".",
"embed_color": "0xf4c75d"
}
}
@TheNullicorn
TheNullicorn / UuidUtil.java
Created August 4, 2020 01:10
Various utilities for converting to and from "trimmed" UUIDs (UUID strings without hyphens)
import java.util.UUID;
/**
* Various utilities for converting to and from "trimmed" UUIDs (UUID strings without hyphens)
*/
public final class UuidUtil {
private static final String UUID_REGEX = "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}";
private static final String TRIMMED_UUID_REGEX = "[a-f0-9]{12}4[a-f0-9]{3}[89aAbB][a-f0-9]{15}";
private static final String ADD_UUID_HYPHENS_REGEX = "([a-f0-9]{8})([a-f0-9]{4})(4[a-f0-9]{3})([89aAbB][a-f0-9]{3})([a-f0-9]{12})";
@TheNullicorn
TheNullicorn / WikiExample.java
Created June 1, 2020 23:33
Sample Java program for the Hypixel API Wiki
package <YOUR_PACKAGE_NAME>;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.util.Scanner;
import java.util.UUID;
import net.hypixel.api.HypixelAPI;
public class <YOUR_CLASS_NAME> {