Skip to content

Instantly share code, notes, and snippets.

@overflowy
overflowy / immobiliare-blacklist.js
Created December 18, 2022 21:27
Immobiliare.it Blacklist
// ==UserScript==
// @name Immobiliare.it Blacklist
// @namespace Violentmonkey Scripts
// @match https://www.immobiliare.it/*
// @grant none
// @version 1.0
// @author [email protected]
// @run-at document-idle
// @description 18/12/2022, 21:13:07
// ==/UserScript==
@overflowy
overflowy / favicons-hn.user.js
Last active July 12, 2023 13:12
Favicons for HN
// ==UserScript==
// @name Favicons for HN
// @namespace Violentmonkey Scripts
// @match https://*.ycombinator.com/*
// @grant none
// @version 1.0
// @author [email protected]
// @description 12/19/2022, 9:34:53 AM
// @inject-into content
// ==/UserScript==
@overflowy
overflowy / timer.py
Created June 7, 2023 20:13
Timer decorator
import functools
import time
def timer(func):
@functools.wraps(func)
def wrapper_timer(*args, **kwargs):
tic = time.perf_counter()
value = func(*args, **kwargs)
@overflowy
overflowy / hetzner-gui.user.js
Created June 11, 2023 10:46
Automatically select GUI-Mode when opening a Hetnzer console
// ==UserScript==
// @name hetzner-gui
// @namespace Violentmonkey Scripts
// @match https://console.hetzner.cloud/console/*
// @grant none
// @version 1.0
// @author [email protected]
// @description 11/06/2023, 12:15:51
// ==/UserScript==
{
"typeCheckingMode": "basic",
"strictListInference": true,
"strictDictionaryInference": false,
"strictParameterNoneValue": true,
"reportFunctionMemberAccess": "error",
"reportMissingModuleSource": "none",
"reportMissingTypeStubs": "error",
"reportUnusedImport": "error",
"reportUnusedClass": "error",
@overflowy
overflowy / pyproject.toml
Created July 10, 2023 10:50
pyproject.toml example
[tool.poetry]
name = "nala"
version = "0.10.0"
description = "Commandline frontend for the apt package manager"
authors = [
"Blake Lee <[email protected]>",
"Sourajyoti Basak <[email protected]>",
]
license = "GPL-3.0-or-later"
readme = "README.rst"
import csv
import requests
from bs4 import BeautifulSoup
def export_to_csv(url: str):
r = requests.get(url)
soup = BeautifulSoup(r.text, "html.parser")
table = soup.find("table", {"id": "downloadTableEN"})
#!/usr/bin/env bash
# When a command fails, bash exits instead of continuing with the rest of the script.
set -o errexit
# This will make the script fail, when accessing an unset variable.
# When you want to access a variable that may or may not have been set,
# use "${VARNAME-}" instead of "$VARNAME", and you’re good.
set -o nounset