Skip to content

Instantly share code, notes, and snippets.

View megamit's full-sized avatar

Mitchell megamit

View GitHub Profile
@megamit
megamit / check-pattern
Last active March 21, 2026 09:22
Script to check if a torrent contains a file that matches a pattern
#!/bin/bash
# Usage: check-pattern <torrent-file> <pattern>
# The belolw benparse and bp_parse functions are taken exactly from the TorrentParser
# script at https://mywiki.wooledge.org/TorrentParser, which is unlicensed.
# Full credit to the original author, who is not me. I have only copied the code and
# added a small wrapper around it to check for a pattern in the torrent file.
# TORRENT PARSER START
@megamit
megamit / fpfix.user.js
Created June 23, 2019 14:14
Load imgur images without referrer for FactorioPrints
// ==UserScript==
// @name Load imgur images without referrer for FactorioPrints
// @namespace http://mreb.uk
// @version 1
// @description It looks like the actual images are not actually deleted but just blocked by referrer. Loading the images via tampermonkey fixes the site
// @author megamit
// @match https://factorioprints.com/blueprints
// @connect i.imgur.com
// @grant GM_xmlhttpRequest
// @grant unsafeWindow
@megamit
megamit / tempfix.plugin.js
Last active January 8, 2017 14:54 — forked from noodlebox/tempfix.plugin.js
Temporary BD Fix
//META{"name":"tempFix"}*//
/*@cc_on
@if (@_jscript)
// Offer to self-install for clueless users that try to run this directly.
var shell = WScript.CreateObject("WScript.Shell");
var fs = new ActiveXObject("Scripting.FileSystemObject");
var pathPlugins = shell.ExpandEnvironmentStrings("%APPDATA%\\BetterDiscord\\plugins");
var pathSelf = WScript.ScriptFullName;
// Put the user at ease by addressing them in the first person
@megamit
megamit / search.plugin.js
Created December 6, 2016 09:46 — forked from samogot/search.plugin.js
Last Update: 1. correct loading messages up and down without extra scrolling. 2. handle end of messages list - stop if nothing was found and cycle retry from begining (end) if something was. 3. search in full message (links, bold, cursive, any other tags except code and mentions if it isn't selected). 4. cool scrolling handle. if message visible…
//META{"name":"searchPlugin"}*//
class searchPlugin{
constructor(){
this.cancelFlag = false;
this.css = "<style class='searchBarPlugin'>"+
"#searchBarInner{"+
"float:right; position:relative; height: 40px; bottom:40px;color:#FFF; padding: 0 4px; border-radius: 4px;"+
'}'+
'.buttonClose{'+
'background: transparent url(https://discordapp.com/assets/14f734d6803726c94b970c3ed80c0864.svg); background-size: cover; transition: opacity .1s easeout; opacity: .5; width:12px; height: 12px; padding: 0'+