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 / sitemap_inject.js
Created March 18, 2025 13:08
Mass inject individual sitesmaps into Google console (sitemap is bugged and Google doesn't care)
/**
* Google Search Console Sitemap Submission Browser Script
*
* Instructions:
* 1. Log in to Google Search Console in your browser
* 2. Navigate to your property (https://zjistil.cz/)
* 3. Go to the Sitemaps section
* 4. Open browser console (F12 or Right-click > Inspect > Console)
* 5. Paste and run this script
*/
@hclivess
hclivess / gmail_unsubscribe.js
Created March 18, 2025 12:36
Unsubscribe all GMAIL emails for free, open source
// Gmail Mass Unsubscribe - Uses pagination to process ALL emails
// Run this in your browser console while in Gmail
(async function() {
console.log('🚀 Starting Gmail unsubscribe for ALL emails using pagination...');
// Constants
const EMAIL_OPEN_DELAY = 1000;
const MAX_PAGES = 200; // Safety limit on pages to process
import xml.etree.ElementTree as ET
from requests import get, exceptions
from colorama import Fore
import os, io, zipfile
import aiohttp
import aiofiles
import asyncio
from time import sleep
OUT_DIR = "./dlc"
@hclivess
hclivess / dotmaze.py
Last active August 29, 2023 18:01
dotted maze with dict representation
from PIL import Image, ImageDraw
import random
def generate_maze(width, height):
maze = [['wall' for _ in range(width)] for _ in range(height)]
# Generate maze using binary tree algorithm
for y in range(1, height, 2):
for x in range(1, width, 2):
maze[y][x] = 'path'
from PIL import Image, ImageDraw
import random
class Cell:
wall_pairs = {'N': 'S', 'S': 'N', 'E': 'W', 'W': 'E'}
def __init__(self, x, y):
self.x, self.y = x, y
self.walls = {'N': True, 'S': True, 'E': True, 'W': True}
@hclivess
hclivess / input.txt
Created February 4, 2023 12:46
babicka
Babička měla syna a dvě dcery. Nejstarší žila mnoho let ve Vídni u přátel, od nichž se vdala. Druhá dcera šla pak na její místo. Syn řemeslník též byl již samostatným a přiženil se do městského domku. Babička bydlela v pohorské vesničce na slezských hranicích, žila spokojeně v malé chaloupce se starou Bětkou, která byla její vrstevnice a již u rodičů sloužila.
Nežila osamotnělá ve své chaloupce; všickni obyvatelé vesničtí byli bratřími jí a sestrami, ona jim byla matkou, rádkyní, bez ní se neskončil ani křest, ani svatba, ani pohřeb.
Tu najednou přišel babičce list z Vídně od nejstarší dcery, v němž jí vědomost dávala, že manžel její službu přijal u jedné kněžny, která má velké panství v Čechách, a sice jen několik mil vzdálenosti od pohorské vesničky, kde babička bydlí. Tam že se nyní s rodinou odstěhuje, manžel pak vždy jen přes léto že tam bude, když i paní kněžna se tam zdržuje. Ke konci listu stála vroucí prosba, aby babička k nim se odebrala navždy a živobytí svoje u dcery a vnoučat strávila, kteří se
@hclivess
hclivess / arw_to_tiff
Created January 29, 2023 12:58
Convert ARW to TIFF
import sys
import rawpy, imageio
files = sys.argv[1:]
for file in files:
with rawpy.imread(file) as raw:
rgb = raw.postprocess()
imageio.imsave(f'{file}.tiff', rgb)
@hclivess
hclivess / whydevslovedyna.json
Last active January 28, 2023 13:46
Why Devs Love Dynatrace Dashboard
{
"metadata": {
"configurationVersions": [
6
],
"clusterVersion": "1.258.87.20230120-140924"
},
"id": "a630b218-1648-4efb-82d4-71e41b859695",
"dashboardMetadata": {
"name": "Best Practices Overview",
@hclivess
hclivess / raise_inheritance.py
Created January 5, 2023 04:15
Python raise inheritance to never forget
try:
try:
try:
print(1/0)
except Exception as e:
raise(e)
except:
print("I will not raise")
except:
print("I never trigger")
@hclivess
hclivess / async_gather.py
Created December 11, 2022 20:35
Simple asynchronous gather function
import asyncio
pets = ["aliens", "cats", "dogs", "ostriches"]
def print_pet(pet):
print(pet)
async def main():
await asyncio.gather(print_pet(pet) for pet in pets)