Skip to content

Instantly share code, notes, and snippets.

@comp500
comp500 / donttrythis.java
Created January 27, 2020 16:28
Cursed classloader magic (why load fabric from java when you can load fabric from fabric???)
package link.infra.borderlessmining;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.loader.api.entrypoint.PreLaunchEntrypoint;
import net.fabricmc.loader.discovery.ModResolver;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.Scanner;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@comp500
comp500 / EyeCareModeFix.reg
Created August 25, 2019 01:07
Fix Lenovo EyeCareMode context menu option
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\EyeCareMode]
"LegacyDisable"=""
// ==UserScript==
// @name No More MCreator Mods
// @version 0.6
// @description you weren't gonna use them anyway
// @author comp500
// @namespace https://infra.link/
// @match https://www.curseforge.com/minecraft/*
// @connect addons-ecs.forgesvc.net
// @connect edge.forgecdn.net
// @connect media.forgecdn.net
@comp500
comp500 / cfqol.user.js
Last active August 26, 2019 14:06
Curseforge Quality of Life Fixes, NOW MOVED TO: https://github.com/comp500/Curseforge-Userscripts
// ==UserScript==
// @name Curseforge QOL Fixes
// @version 0.5
// @description Fix Minecraft default tab to search mods, fix browse button to go to /minecraft/mc-mods, add search box in the navbar, add All Files tab
// @author comp500
// @namespace https://infra.link/
// @match https://www.curseforge.com/*
// @updateURL https://github.com/comp500/Curseforge-Userscripts/raw/master/cfqol.user.js
// @downloadURL https://github.com/comp500/Curseforge-Userscripts/raw/master/cfqol.user.js
// @grant none
@comp500
comp500 / finder.zs
Last active April 12, 2019 13:41
ZenScroll loop finder
import crafttweaker.recipes.ICraftingRecipe;
import crafttweaker.item.IIngredient;
import crafttweaker.item.IItemStack;
// ZenScroll loop finder, by comp500.
// Finds crafting loops added by mods and creates ZenScroll scroll groups for them.
// Requires: https://minecraft.curseforge.com/projects/zenscroll
// Revision 4: improved comments
// To use:
/* ==UserStyle==
@name thonk
@namespace comp500
@version 1.0.0
@description Replaces GitHub's Confused emoji with thonk
@author comp500
==/UserStyle== */
/*
Doesn't work for some reason
@comp500
comp500 / regex.md
Last active September 8, 2018 21:02
Caddy documentation for regular expression replacement (https://github.com/mholt/caddy/pull/2144) (licensed public domain/CC0)

Syntax

header_upstream name value
header_downstream name value
header_upstream name regex replacement
header_downstream name regex replacement
  • (existing header_upstream doc)
  • header_upstream can also be used with an extra argument, where the field name is name, the regular expression to match in it is regex, and the value to replace the match with is value. This option allows values within headers to be modified based on those values, can be specified multiple times for multiple headers and for multiple modifications of the same header. Capture groups are supported and substituted into the replacement (as $1, $2, etc.) and request placeholders can be used in the replacement. The regular expressions use Go's syntax described here.
@comp500
comp500 / .config
Last active June 4, 2018 16:40
Buildroot x86_64 notes
BR2_HAVE_DOT_CONFIG=y
BR2_HOST_GCC_AT_LEAST_4_5=y
BR2_HOST_GCC_AT_LEAST_4_6=y
BR2_HOST_GCC_AT_LEAST_4_7=y
BR2_HOST_GCC_AT_LEAST_4_8=y
BR2_HOST_GCC_AT_LEAST_4_9=y
BR2_HOST_GCC_AT_LEAST_5=y
BR2_HOST_GCC_AT_LEAST_6=y
BR2_HOST_GCC_AT_LEAST_7=y
BR2_ARCH_IS_64=y
@comp500
comp500 / vscode.json
Created May 4, 2018 15:24
Visual Studio Code concfg theme
{
"black": "#1E1E1E",
"dark_blue": "#2472C8",
"dark_green": "#0DBC79",
"dark_cyan": "#11A8CD",
"dark_red": "#CD3131",
"dark_magenta": "#BC3FBC",
"dark_yellow": "#E5E510",
"gray": "#CCCCCC",
"dark_gray": "#666666",