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 typing import Union | |
import hashlib | |
import os | |
def get_checksum(path_to_file: str, algorithm: Union[str, callable] = hashlib.sha256) -> str: | |
"""A function that computes checksum of a file using one of hashlib algorithms (default: SHA-256). It combines | |
a "modern" implementation with a pre-Python3.11 compatible alternative.""" | |
if not os.path.exists(path_to_file): | |
raise FileNotFoundError(f"File {path_to_file!r} doesn't seem to exist") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
// ==UserScript== | |
// @name unfoldCollapsed.user.js | |
// @description Automatically unfold collapsed sections on webpages. | |
// @version 1 | |
// @grant unsafeWindow | |
// @include https://www.apec.fr/* | |
// @include https://nofluffjobs.com/* | |
// @include https://choisirleservicepublic.gouv.fr/* | |
// @include https://www.welcometothejungle.com/* | |
// ==/UserScript== |
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
// ==UserScript== | |
// @name updateNowPlayingSongInfo.user.js | |
// @description UserScript for hotmixradio.com that forces an update of the currently played song's info. Hotmixradio.com native update mechanism actually lags a big deal. | |
// @include https://hotmixradio.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
var has_my_function_completed_at_least_once = false; | |
const api_call_interval_in_ms = 5000; |
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
// ==UserScript== | |
// @name onlyShowThese.user.js | |
// @description Declutter a webpage by telling which elements you want to leave visible — a JavaScript user script for Firefox's Greasemonkey, Chrome's Tampermonkey or Opera's Violetmonkey. The script uses a prompt to ask the user for a CSS selector for those of the DOM elements the user wants to leave visible. | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
var selector = prompt( | |
`Type in a CSS selector query (documentation: https://w3c.github.io/csswg-drafts/selectors/) for the elements you want visible. | |
For example, to show only p elements, but not p of class ad, type in "p, p *, -p.ad". |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder