Skip to content

Instantly share code, notes, and snippets.

@KodingDev
Last active May 4, 2022 19:30
Show Gist options
  • Save KodingDev/5507d452397088e3303f49869880f2f5 to your computer and use it in GitHub Desktop.
Save KodingDev/5507d452397088e3303f49869880f2f5 to your computer and use it in GitHub Desktop.
UserScripts
// ==UserScript==
// @name Genius Bagon
// @namespace http://tampermonkey.net/
// @version 0.1
// @description theyre not very genius
// @author You
// @match https://genius.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=genius.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
window.addEventListener('load', () => {
const cringePresent = document.getElementsByClassName("OptOutButton__Container-e48zu0-0");
setInterval(() => {
[].slice.call(document.getElementsByTagName("a")).forEach((e) => {
const href = e.getAttribute("href");
if (!href || href.toString().includes("?bagon=1")) return;
e.setAttribute("href", `${href}?bagon=1`);
});
}, 100);
if (!document.location.toString().includes("bagon=1") && cringePresent.length) {
document.location = `${document.location}?bagon=1`
}
});
})();
// ==UserScript==
// @name Hide NBT Tags
// @namespace http://tampermonkey.net/
// @version 0.1
// @description removes NBT tags from being displayed in Minecraft source diffs
// @author Koding
// @match https://github.com/jaacksondev/ero-minecraft-source/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
const observer = new MutationObserver((mutations) => {
[].slice.call(document.getElementsByClassName("file"))
.filter((element) => {
const path = element.getAttribute("data-tagsearch-path");
if (!path) return false;
return path.endsWith(".nbt") && path.startsWith("data/minecraft");
})
.forEach((element) => element.remove());
});
observer.observe(document.querySelector('#files'), {
subtree: true,
childList: true,
attributes: false,
characterData: false,
attributeOldValue: false,
characterDataOldValue: false
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment