Skip to content

Instantly share code, notes, and snippets.

View trigger-segfault's full-sized avatar
💭
ALANDSLIDEHASOCCURRED

Robert Jordan trigger-segfault

💭
ALANDSLIDEHASOCCURRED
View GitHub Profile
@trigger-segfault
trigger-segfault / soupstore-cst.cpp
Last active August 30, 2022 05:20
CatSystem 2 Grisaia Soupstore script: https://youtu.be/vZxEwnjLC8g
///////////////////////////////////////////////////////////////////////////////
//// SOUPSTORE.CST
//// a recreation of Code MENT's iconic "I'm at soup" scene in CatSystem 2,
//// using the Grisaia cast.
//
// Author: Robert Jordan
// Date: 2021-02-12
//
// Supports:
// - The Fruit of Grisaia Unrated Version
@trigger-segfault
trigger-segfault / LSR_RfCompressMethod1.cs
Last active January 30, 2022 18:45
Decompression method 1 for LEGO Stunt Ralley (observed only in JP .rf* archives)
using System;
using System.Collections.Generic;
using System.IO;
internal class HuffmanTreeNode
{
public HuffmanTreeNode Parent;
public ushort Code;
public uint Frequency;
public ushort TreeCode;
@trigger-segfault
trigger-segfault / ListSet.hpp
Created November 11, 2021 02:24
C++ Templated ListSet management for LEGO Rock Raiders.
#pragma once
#include "../../common.h"
#include "Errors.h"
#include "Memory.h"
/// TEMPLATE REQUIREMENTS:
// Note that the order of these fields is not important.
@trigger-segfault
trigger-segfault / RcImageEncoder.cs
Created May 17, 2021 22:16
Rokucho Encoder for both RC8|RCT formats (untested)
// Refer to here for more information and listing of Constants by Image Type
// <https://github.com/AtomCrafty/MajiroTools/wiki/Format:-Rct-image>
// Encoder implantation based off GARbro's:
// <https://github.com/morkt/GARbro/blob/master/ArcFormats/Majiro/ImageRCT.cs#L470>
// Encoding type: LZ77
// <https://en.wikipedia.org/wiki/LZ77_and_LZ78#LZ77>
// Metadata:
public int Width { get; }
public int Height { get; }
@trigger-segfault
trigger-segfault / Fix-AniList-Videos.js
Last active December 11, 2020 22:19
JavaScript to run in an iOS shortcut to fix inaccessible webm() syntax videos on AniList.
/* When in the Safari browser, open the share menu and run the shortcut.
* Any video elements on the page will have an OPEN IN VLC button and
* Video URL inserted above the video.
*
* CREATE SHORTCUT INSTRUCTIONS:
* 1. Enable: Show in Share Sheet
* 2. In Share Sheet Types, check: Safari web pages
* 3. Add command: Run JavaScript on Web Page
* 4. Set command input to: Shortcut Input
* 5. Paste: JavaScript shown below
@trigger-segfault
trigger-segfault / HgxImage.cs
Created September 8, 2020 07:49
Two-way implementation for processing CatSystem HG-2/3 image encodings
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Runtime.InteropServices;
// THIS IS A WORK IN PROGRESS
// Class for creating and extracting HG-2/3 specific image encodings
// This does not handle reading the container file format, nor Zlib compression.
@trigger-segfault
trigger-segfault / MersenneTwister SeedGenRand.cs
Last active February 23, 2020 18:39
A single-use, fire-and-forget MersenneTwister number generator. Because CatSystem2 only uses the first generated value.
partial class MersenneTwister {
#region SeedGenRand
/// <summary>
/// MersenneTwister Seed + GenRand wombo-combo.<para/>
/// Who needs PRNG-generated values seeded AFTER the first output??
/// </summary>
///
/// <remarks>
/// This is an abomination of inlining the <see cref="Seed(uint)"/> and <see cref="GenRand()"/>
@trigger-segfault
trigger-segfault / plex-season-title-bookmarklet.js
Last active January 7, 2021 13:13
Plex Season Title Bookmarklet: On-demand JavaScript to add a title setting to PleX TV Seasons and make it look FANCY~
javascript:(function(){class e extends Error{constructor(e){super(e),this.name="KnownError"}}const t="\nTry using the simple bookmarklet instead.";var n={IN_USE:"The title setting is already in the edit season dialog.",NOT_OPEN:"You do not have an edit metadata dialog open.",NOT_GENERAL:"You are not in the season's General metadata tab.",NOT_SEASON:"You are not currently editing a season's metadata.",UNK_STRUCT:"Failed to identify the HTML tree structure needed to insert the new setting."+t,UNK_VIEW:"Failed to find or identify the view instance data used to identify the season."+t};try{if(0==document.getElementsByClassName("edit-metadata-modal").length)throw new e(n.NOT_OPEN);var a=document.getElementsByClassName("modal-body-pane"),i=(a=1==a.length&&a[0].firstElementChild)&&a._viewInstance;if(!i)throw new e(n.UNK_VIEW);var l=i.model&&i.model.attributes;if(!l||"season"!=l.type)throw new e(n.NOT_SEASON);if("general"!=i.options.type)throw new e(n.NOT_GENERAL);var o=a.firstElementChild;if(!o)throw new e(n.NOT_OPE
@trigger-segfault
trigger-segfault / arccheat2.rpy
Last active April 16, 2019 22:11
Sunrider Academy Mod Interface v2.0.0.0 - Arc Cheat Overhaul modifications
init 10 python:
if hasattr(store,'ac_mod'):
ac_mod.register_main_button(text="ARC CHEAT",action=Start("arc_cheat2"))
elif hasattr(store,'ac_mod_button_list'):
ac_mod_button_list.append(["mods/arccheat/mod_arccheat_base.png","mods/arccheat/mod_arccheat_hover.png","arc_cheat2",False,False])
else:
# Mod Interface is not installed, this mod isn't available without it.
pass
@trigger-segfault
trigger-segfault / APIDownTimeRender.cs
Created October 8, 2018 01:18
MyAnimeList DownTime Render (May eventually add full runtime measuring)
// Uses .NET Framework's System.Drawing or .Net Standard's System.Drawing.Common.
public static class APIDownTimeRenderer {
#region Constants
// Strings
public const string Title = "MyAnimeList API Downtime";
public const string Days = "DAYS";
public const string Hours = "HOURS";