Skip to content

Instantly share code, notes, and snippets.

View NuarkNoir's full-sized avatar
👀
hello there

Andrew NuarkNoir

👀
hello there
View GitHub Profile
@NuarkNoir
NuarkNoir / tool_hash_images.py
Created August 1, 2019 07:32
Renames images in current folder into their perceptionhash value - helps in sfinding similar images
import shutil
import os.path
from glob import glob
import imagehash
from PIL import Image
def rename_images(filenames):
print("Hashing...", end="\r")
nnames = dict()
errored_images = []
@NuarkNoir
NuarkNoir / file_checksum.py
Created August 1, 2019 07:29
Get file sha256 checksum
def sha256sum(filename):
h = hashlib.sha256()
b = bytearray(128*1024)
mv = memoryview(b)
with open(filename, 'rb', buffering=0) as f:
for n in iter(lambda : f.readinto(mv), 0):
h.update(mv[:n])
return h.hexdigest()
@NuarkNoir
NuarkNoir / preloader.html
Created July 21, 2019 10:53
Preloader for site
<div style="padding: 0; margin: 0; height: 100vh; width: 100vw; background: rgb(0, 0, 0); position: fixed; z-index: 10000000;">
<style>
svg#pre_svg {
position: fixed;
top: 20%;
height: 60%;
left: 20%;
width: 60%;
}
</style>
@NuarkNoir
NuarkNoir / androidarsenal_previewer.user.js
Last active June 21, 2019 14:53
AndroidArsenal image previewer - adds button to preview library-related images. Not so beautiful nowadays, but it works!
// ==UserScript==
// @name AndroidArsenal image previewer
// @namespace http://tampermonkey.net/
// @version 0.2
// @run-at document-end
// @description Adds button to preview library-related images. Not so beautiful nowadays, but it works!
// @author Nuark
// @match *://android-arsenal.com/
// @match *://android-arsenal.com/tag*
// @grant none
@NuarkNoir
NuarkNoir / reshuege_autosolver.user.js
Last active April 23, 2019 05:52
Reshuege autosolver - Automatically solves tests from reshguege
// ==UserScript==
// @name Reshuege autosolver
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Automatically solve tests from reshguege
// @author Nuark
// @match *://*.sdamgia.ru/test*
// @grant none
// @run-at document-end
// ==/UserScript==
@NuarkNoir
NuarkNoir / nozomi_data_exporter.user.js
Last active April 21, 2019 12:05
I created this script to simplify data-export from NozomiLa
// ==UserScript==
// @name Nozomi Exporter
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Exporting posts from NL
// @author Nuark
// @match https://nozomi.la/
// @match https://nozomi.la/tag/*
// @grant none
// @run-at document-end
@NuarkNoir
NuarkNoir / nozomi_tags_copier.user.js
Last active April 21, 2019 12:03
Nozomi Tags Copier - Helps copy tags from nozomi.la
// ==UserScript==
// @name Nozomi Tags Copier
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Helps copy tags from nozomi.la
// @author Nuark
// @match https://nozomi.la/post/*
// @grant none
// ==/UserScript==
@NuarkNoir
NuarkNoir / fancyTimeFormat.js
Created March 31, 2019 12:05
Fancy time formater
let fancyTimeFormat = function (time) {
// Hours, minutes and seconds
var hrs = ~~(time / 3600);
var mins = ~~((time % 3600) / 60);
var secs = ~~time % 60;
// Output like "1:01" or "4:03:59" or "123:03:59"
var ret = "";
if (hrs > 0) {
@NuarkNoir
NuarkNoir / q32redirector.user.js
Created March 7, 2019 05:55
q32 shortener autoredirector - Bypass q32 sortener
// ==UserScript==
// @name q32 shortener autoredirector
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Bypass q32
// @author Nuark
// @match https://q32.ru/*
// @grant none
// ==/UserScript==
@NuarkNoir
NuarkNoir / animemoehelper.user.js
Created March 3, 2019 14:49
AkumaMoe Helper - Helps download mangas from akuma.moe
// ==UserScript==
// @name AkumaMoe Helper
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Helps download mangas from akuma.moe
// @author Nuark
// @connect s1.akuma.moe
// @match https://*akuma.moe/*
// @require https://cdnjs.cloudflare.com/ajax/libs/jszip/3.2.0/jszip.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.8/FileSaver.min.js