This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import sqlite3 | |
import zipfile | |
from pathlib import Path | |
from collections import defaultdict | |
def is_image(content_bytes: bytes) -> tuple[bool, str | None]: | |
"""Check if content is an image and return format""" | |
if content_bytes.startswith(b'\x89PNG'): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
from playwright import sync_api | |
dirs = { | |
'1': 'book1', | |
'2': 'book2', | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from pathlib import Path | |
search_patterns = [ | |
re.compile(r"logger\s*\.(?P<method>.*)\(\s*f", flags=re.IGNORECASE), | |
re.compile(r"logging.getLogger\s*(?P<method>.*)\(\s*f", flags=re.IGNORECASE), | |
] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import subprocess | |
from pathlib import Path | |
aantal = 9 | |
vertical_time = 4000 | |
horizontal_time = 550 | |
run_every_x_sec = 300 | |
target_file_local = Path.home() / "Downloads/Pocketland" | |
target_file_adb = "/sdcard/com.rise.automatic.autoclicker.clicker/config/" + target_file_local.name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <dde.h> | |
HDDEDATA CALLBACK DdeCallback( | |
UINT uType, | |
UINT uFmt, | |
HCONV hconv, | |
HSZ hsz1, | |
HSZ hsz2, | |
HDDEDATA hdata, | |
ULONG_PTR dwData1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
txt = """This text is a small demonstration about the fact that the human brain can read texts, even though a computer is not able to make sense of it.""" | |
# Outputs like: Tihs txet is a slmal dntaoistroemn abuot the fcat that the hmuan bairn can raed tetxs, eevn tuhogh a comupter is not able to make ssene of it. | |
from random import shuffle | |
import re | |
x = re.split(r'([^a-z]+)', txt, flags=re.IGNORECASE) | |
# print(x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Basically this is just reading the pdf & writing it out again... | |
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=unencrypted.pdf -c .setpdfwrite -f encrypted.pdf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- shows the percentiles after its run. | |
-- run like: | |
-- wrk --duration 10s --threads 10 --timeout 5s "http://example.com" --script script.lua | |
local fp = nil; | |
local ips = { | |
'ip1', | |
'ip2', | |
'ip3' | |
} |