Skip to content

Instantly share code, notes, and snippets.

Avatar

MMWorks manciuszz

View GitHub Profile
View trigram-similarity.js
const nGram = function(n) {
if (
typeof n !== 'number' ||
Number.isNaN(n) ||
n < 1 ||
n === Number.POSITIVE_INFINITY
) {
throw new Error('`' + n + '` is not a valid argument for `n-gram`')
}
@manciuszz
manciuszz / Install-Hyper-V.bat
Last active Dec 20, 2020
Windows 10 Home | Hyper-V Management scripts
View Install-Hyper-V.bat
@echo off
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V -All /LimitAccess /ALL
@manciuszz
manciuszz / Huawei_B525s-23a_name_filler.js
Created Oct 17, 2020
Huawei B525s-23a router's 'Domain Name Filter' filler script that allows users to automatically fill Domain Name Filter table with values from a normal hostname list...
View Huawei_B525s-23a_name_filler.js
// Huawei B525s-23a router's 'Domain Name Filter' filler script that allows users to automatically fill Domain Name Filter table with values from a normal hostname list
/*
# Blacklist example:
abtest.mistat.intl.xiaomi.com
abtest.mistat.xiaomi.com
account.preview.n.xiaomi.net
account.xiaomi.com
ad1.xiaomi.com
ad.mi.com
@manciuszz
manciuszz / kissMangaAntiAdBlockCF.user.js
Last active Mar 9, 2020
KissManga Cloudflare Challenge Anti-AdBlock Counter-Tamper.
View kissMangaAntiAdBlockCF.user.js
// ==UserScript==
// @name KissManga - AdBlock Tampered Cloudflare Challenge Bypass
// @version 0.11
// @author Manciuszz
// @match *://kissmanga.com/*
// @grant unsafeWindow
// ==/UserScript==
(function() {
'use strict';
@manciuszz
manciuszz / MSI GS70 Stealth Keyboard Temp Fix.ahk
Last active Feb 18, 2020
MSI GS70 Stealth Keyboard Temp Fix.ahk - These notebooks seem to have a really stupid design fault that damages the keyboard flex cable (Source: https://forum-en.msi.com/index.php?topic=180340.0). So, because I couldn't be arsed to fix the hardware - I went the software route. This AutoHotKey script will allow users to use those broken keys by c…
View MSI GS70 Stealth Keyboard Temp Fix.ahk
#NoEnv
#UseHook
#Persistent
#KeyHistory 0
#SingleInstance Force
SetBatchLines, -1
SetKeyDelay, -1, -1
SendMode Input
class AppConfig {
@manciuszz
manciuszz / cf_post_challenge.js
Created Feb 17, 2020
The new CloudFlare JS Challenge via POST request minimal solution.
View cf_post_challenge.js
// Before executing, make a break point on "#jschl_answer" element so when it gets a value, debugger kicks in...
(function() {
let form = document.querySelector("#challenge-form");
if (!form)
return console.log("No JS Challenge detected!");
let request = function(params, callbackFn) {
fetch(params.requestURL, {
"method": "POST",
"headers": {
@manciuszz
manciuszz / module_pattern.js
Last active Feb 10, 2020
Javascript Module Pattern that returns a function (instead of an object) which contains other functions...
View module_pattern.js
{
let Module = (function() {
let privateMethod1 = function() {
console.log("FOO");
};
let privateMethod2 = function() {
console.log("BAR");
};
@manciuszz
manciuszz / webnovelFullSearch.js
Last active Jan 17, 2020
Webnovel.com - Preload and Sort search results without scrolling.
View webnovelFullSearch.js
// ==UserScript==
// @name WebNovel.com | Full Search
// @description Sort your search results by chapter descending order of chapter number.
// @author Manciuszz
// @version 0.906
// @match https://www.webnovel.com/category*
// @match https://www.webnovel.com/search*
// @match https://www.webnovel.com/tag*
// @match https://www.webnovel.com/ranking*
// @match https://www.webnovel.com/profile*
@manciuszz
manciuszz / WindowHelper.ahk
Created Dec 12, 2019
An AutoHotKey script that allows fast window moving/resizing/minimizing/maximizing via mouse keys Mouse5/Mouse4/Wheeldown/WheelUp
View WindowHelper.ahk
#NoEnv
#SingleInstance force
#InstallKeybdHook
#KeyHistory 500
ListLines Off
SetKeyDelay,-1, 1
SetControlDelay, -1
SetMouseDelay, -1
SetWinDelay,-1
@manciuszz
manciuszz / Auto-Vote for Hong-Kong @ TIME
Last active Nov 16, 2019
A quick script that will automatically vote for Hong-Kong in Time’s Person of the Year election.
View Auto-Vote for Hong-Kong @ TIME
{
let enableVoting = !function() {
let voteNow = document.evaluate("//a[contains(., 'Vote Now')]", document, null, XPathResult.ANY_TYPE, null ).iterateNext();
if (voteNow)
voteNow.click();
}();
let removeLoginBox = !function() {
let loginBox = document.getElementById("login");
if (loginBox) {