Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name ISCC upload helper
// @namespace sebastian.berlin@wikimedia.se
// @version 2026-02-27
// @description Add link to CommonsDB registry
// @author You
// @match https://commons.wikimedia.org/wiki/Special:UploadWizard*
// @icon https://www.google.com/s2/favicons?sz=64&domain=wikimedia.org
// @grant GM.xmlHttpRequest
// ==/UserScript==
@sebastian-berlin-wmse
sebastian-berlin-wmse / time-diff.py
Created April 11, 2025 08:31
Calculate difference between two timestamps
#! /usr/bin/env python
"""Calculate time difference between two timestamps
First argument is the "from" time and second is the "to" time. Format should
be anything that works with `datetime.fromisoformat`
(https://docs.python.org/3/library/datetime.html#datetime.datetime.fromisoformat).
"""
from datetime import datetime
@sebastian-berlin-wmse
sebastian-berlin-wmse / venv
Last active May 30, 2024 15:18
Setup and run venv
#! /usr/bin/env bash
# Add the following to .bashrc to make this work:
# alias venv=". venv"
source .venv/bin/activate && return 0
read -p "Create venv in .venv/? [y/N] " -r
if [[ $REPLY =~ ^[Yy]$ ]]
then