Skip to content

Instantly share code, notes, and snippets.

View manciuszz's full-sized avatar

MMWorks manciuszz

View GitHub Profile
@manciuszz
manciuszz / primecache-content.sh
Last active December 19, 2021 22:49
PrimoCache shell script to preload data to cache.
#!/bin/sh
read_files_from_textfile() {
while IFS=$' \t\r\n' read -r directory || [ -n "$directory" ]; do
read_files_from_directory "$directory"
done < "$1"
}
read_files_from_directory() {
suffix=$([ $# -gt 1 ] && echo "ies" || echo "y");
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 September 14, 2024 06:45
Windows 10 Home | Hyper-V Management scripts
@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 October 17, 2020 15:35
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...
// 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 March 9, 2020 20:39
KissManga Cloudflare Challenge Anti-AdBlock Counter-Tamper.
// ==UserScript==
// @name KissManga - AdBlock Tampered Cloudflare Challenge Bypass
// @version 0.11
// @author Manciuszz
// @match *://kissmanga.com/*
// @grant unsafeWindow
// ==/UserScript==
(function() {
'use strict';
@manciuszz
manciuszz / cf_post_challenge.js
Created February 17, 2020 23:55
The new CloudFlare JS Challenge via POST request minimal solution.
// 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 February 10, 2020 18:42
Javascript Module Pattern that returns a function (instead of an object) which contains other functions...
{
let Module = (function() {
let privateMethod1 = function() {
console.log("FOO");
};
let privateMethod2 = function() {
console.log("BAR");
};
@manciuszz
manciuszz / WindowHelper.ahk
Created December 12, 2019 17:25
An AutoHotKey script that allows fast window moving/resizing/minimizing/maximizing via mouse keys Mouse5/Mouse4/Wheeldown/WheelUp
#NoEnv
#SingleInstance force
#InstallKeybdHook
#KeyHistory 500
ListLines Off
SetKeyDelay,-1, 1
SetControlDelay, -1
SetMouseDelay, -1
SetWinDelay,-1
@manciuszz
manciuszz / survivalMacros.ahk
Created October 20, 2019 15:47
Android mobile game "Survival Heroes" non-intrusive macros made wth AutoHotKey for Tencent's "Gameloop" emulator ran on 1280x720 resolution.
#NoEnv
; #Warn
#UseHook
#MaxThreadsPerHotkey 2
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#KeyHistory 0
#Persistent
#SingleInstance force
ListLines Off
@manciuszz
manciuszz / asm_autoClicker.js
Last active October 1, 2019 13:50
Emscripten's WebAssembly games non-intrusive auto-clicker by hijacking "JSEvents" object event handlers via browser debugger.
{ // For copy/paste purpose...
/* Usually, in most emscripten games "JSEvents" interface is private, therefore we expose it to global scope by using debugger (i.e Developer Tools)... */
if (false) {
/* Note: unityWebView.game.Module could be named differently (based on a game), for example like "gameInstance.Module" etc.. */
// Copy this to the debugger and execute to stop at the breakpoint, where we will expose "JSEvents" to global scope.
debug(unityWebView.game.Module.SetFullscreen);
unityWebView.game.Module.SetFullscreen();
undebug(unityWebView.game.Module.SetFullscreen);
//window.JSEvents = JSEvents; // expose this...
}