Skip to content

Instantly share code, notes, and snippets.

View hclivess's full-sized avatar
🏠
Working from home

Jan Kučera hclivess

🏠
Working from home
View GitHub Profile
@hclivess
hclivess / console_scroll_down.js
Created September 10, 2019 18:10
console_scroll_down.js
(function() {
var intervalObj = null;
var retry = 0;
var clickHandler = function() {
console.log("Clicked; stopping autoscroll");
clearInterval(intervalObj);
document.body.removeEventListener("click", clickHandler);
}
function scrollDown() {
var scrollHeight = document.body.scrollHeight,
"""
Generic helpers Bismuth
"""
import re
import hashlib
import base64
from decimal import Decimal
__version__ = '0.0.5'
import random
more0s = 0
more1s = 0
more0s_list = []
more1s_list = []
preset = []
for x in range(10000):
@hclivess
hclivess / login.html
Last active November 7, 2019 12:26
Full tornado web authentication example that is actually working
<html>
<body>
<form action="/login" method="post">
Name: <input type="text" name="name">
<input type="submit" value="Sign in">
</form>
</body>
</html>
import re
import requests
from datetime import date
import matplotlib.pyplot as plt
web = requests.get("https://nyzo.co/queue/all").text
reds = re.findall("#f88", web)
yellows = re.findall("#ff0", web)
whites = re.findall('style=""', web)
@hclivess
hclivess / youtube-dl.py
Last active March 21, 2020 04:52
download all videos linked in links.txt, interface for youtube-dl
"""
import subprocess
with open("links.txt") as infile:
lines = infile.readlines()
for line in lines:
filename = line.split("/")[-2]
command_line = f"youtube-dl {line} --verbose {filename}.mp4"
pipe = subprocess.Popen(command_line, shell=True, stdout=subprocess.PIPE).stdout
@hclivess
hclivess / hn_node_update.py
Created May 25, 2020 12:53
hn_node_update.py
"""
Hypernode / Bismuth node update script. The script can be run in any directory.
"""
import os
import sys
import time
import glob
import tarfile
import requests
import os
import time
import tweepy
import logging
import glob
import json
import random
logging.basicConfig(
level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
from threading import Thread
import threading
lock = threading.Lock()
import glob
import os.path
#import cookielib
import http.cookiejar
import re
import time
class Drak:
def __init__(self):
self.hp = 100
class RybiKosik:
def __init__(self):
self.pocet = 0
drak = Drak()
kosik = RybiKosik()