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 / gist:945ced9d0c3f10dc895e8ee3788fb77f
Created September 1, 2018 10:28
Banned windows chars regexp
/[\\/:*?"<>|]/g
@NuarkNoir
NuarkNoir / notwitch.user.js
Created November 28, 2018 02:33
notwitch.user.js
// ==UserScript==
// @name NoTwitch
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author ЕБЛАН
// @include http://*.twitch.tv/*
// @include https://*.twitch.tv/*
// @include http://*.youtube.com/*
// @include https://*.youtube.com/*
@NuarkNoir
NuarkNoir / vk_stickers_cost_counter.js
Last active December 7, 2018 05:49
Считает стоимость всех подарков вконтакте
/*
## Как?
1. Переходим на страницу человека, у которого нет стикеров (https://vk.com/{whatever})
2. Открываем меню подарков, переходим в раздел стикеров
3. F12, Ctrl+V, Enter
*/
let sum = 0;
document.querySelectorAll("#gifts_box_stickers .gift_cell").forEach(x => {
let price = (+x.outerHTML.split(/'/)[1].split(/ /)[0]);
@NuarkNoir
NuarkNoir / __main__.py
Created January 22, 2019 03:44
Count zeros and ones in decimals binary representation
def dec2bin(dec):
return str(bin(dec))[2:]
def cnt_ones(num, zeros=False):
binform = dec2bin(num)
vtc = "1"
if zeros:
vtc = "0"
return sum([1 for i in binform if i == vtc])
@NuarkNoir
NuarkNoir / anilandorg.py
Created January 24, 2019 07:29
anilandorg anime downloader
import requests
import lxml.html
from collections import OrderedDict
import os
from tqdm import tqdm
cls = lambda: os.system('cls' if os.name=='nt' else 'clear')
safe_string = lambda s: ("".join(x for x in s if (x.isalnum() or x in "._-[] "))).strip()
@NuarkNoir
NuarkNoir / __main__.py
Created February 4, 2019 12:04
Var. 1; Tasks 6, 7
# -*- coding: utf-8 -*-
def dec_to_base(N, base):
if not hasattr(dec_to_base, 'table'):
dec_to_base.table = '0123456789ABCDEF'
x, y = divmod(N, base)
return dec_to_base(x, base) + dec_to_base.table[y] if x else dec_to_base.table[y]
num = 16**20+2**30-32
base = 4
@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
@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 / 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 / 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==