Skip to content

Instantly share code, notes, and snippets.

View blackle's full-sized avatar
🦈
Blackle is a Shark

Blackle Morisanchetto blackle

🦈
Blackle is a Shark
View GitHub Profile
@blackle
blackle / recover.py
Created January 23, 2025 20:26
Mosaic Filter Recovery
#!/usr/bin/env python3
# Dual license
# CC0 1.0 Universal https://creativecommons.org/publicdomain/zero/1.0/
# Zero-Clause BSD https://opensource.org/license/0bsd
# To the extent possible under law, Blackle Mori has waived all copyright and related or neighboring rights to this work.
import csv
import numpy as np
from PIL import Image
@blackle
blackle / bluesky.css
Last active October 2, 2024 19:45
Bluesky numbers deleter
a[href$="/followers"] > span:first-child,
a[href$="/follows"] > span:first-child
{
display: none;
}
a[href$="/followers"] > span:nth-child(2)::before,
a[href$="/follows"] > span:nth-child(2)::before
{
content: '? ' !important;
@blackle
blackle / sudoku.py
Created July 17, 2024 18:28
Make sudoku with cryptominisat in python
import pycryptosat as pysat
import itertools
# this is a helper class to save the results of "solve"
# and to give an easy way to make new variables
class Solver(pysat.Solver):
def __init__(self):
pysat.Solver.__init__(self)
self.n_vars = 0
self.sat = None
@blackle
blackle / wiki.py
Created June 26, 2024 07:08
wikipedia perennial sources changes RSS feed generator
#!/usr/bin/env python3
import json
import requests
import wikitextparser as wtp
from difflib import SequenceMatcher
from datetime import datetime, timezone
import dateutil.relativedelta
import schedule
import http.server
import socketserver
@blackle
blackle / blackle_bg3.py
Created June 6, 2024 02:12
background management tool
#!/usr/bin/env python3
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GObject, GLib
from gi.repository.GdkPixbuf import Pixbuf, InterpType
import subprocess, os, time, errno
from xdg_base_dirs import xdg_cache_home, xdg_config_home
import shutil
PROGNAME = "blackle_backgrounder"
@blackle
blackle / noTabScroll.uc.js
Last active December 2, 2024 10:13
Userscript for disabling tab scroll
// ==UserScript==
// @name noTabScroll
// @author blackle
// @include main
// @startup UC.noTabScroll.exec(win);
// @shutdown
// @onlyonce
// ==/UserScript==
UC.noTabScroll = {
@blackle
blackle / userChrome.css
Last active February 16, 2025 06:39
win95 style firefox
.tabbrowser-tab:not([pinned]) {
min-width: 1px !important;
}
.tab-close-button {
display: none;
}
.tab-background {
margin-block: 0 !important;
#!/usr/bin/env python3
import http.server
import socketserver
import threading
from urllib.parse import urlparse
from math import sqrt
import time
import pyvips
import ssl
#!/usr/bin/env python3
import math
def printen(string):
print(string, end="")
items=[
{"url":"https://staging.cohostcdn.org/attachment/4e61ceb0-6840-4b80-821a-be6a01338300/art.jpg","ratio":1.42539},
{"url":"https://staging.cohostcdn.org/attachment/13d3f7b3-df6b-465f-b427-49e8a88dac03/bookshelf.png","ratio":0.711744},
{"url":"https://staging.cohostcdn.org/attachment/879ffd80-2e4c-4afd-a4cf-9dd40c9d0acd/lamp.png","ratio":0.384695},
#!/usr/bin/env python3
def printen(strr):
print(strr, end='')
internet_text='''<h1 style="font-size: 1.8em;margin-bottom: 0.25em;padding: 0;font-family: 'Linux Libertine','Georgia','Times',serif;line-height: 1.3; border-bottom: 1px solid #a2a9b1;font-weight:normal;">Basilisk collection</h1>
<div style="font-family: sans-serif;font-size: calc(1em * 0.8);margin-bottom:1.1em;">From Wikipedia, the free encyclopedia</div>
<p style="font-family: sans-serif;margin: 0.5em 0;font-size: calc(1em * 0.875);line-height: 1.6;">The <b>basilisk collection</b> (also known as the <b>basilisk file</b> or <b>basilisk.txt</b>) is a collection of over 125 million <a style="color:#0645AD;" href="https://en.wikipedia.org/wiki/Proof_of_work#Background" title="Proof of work">partial hash inversions</a> of the <a style="color:#0645AD;" href="https://en.wikipedia.org/wiki/SHA-256" class="mw-redirect" title="SHA-256">SHA-256</a> <a style="color:#0645AD;" href="https://en.wikipedia.org/wiki/Cryptographic_hash_function" title="Crypt