Skip to content

Instantly share code, notes, and snippets.

View Keyacom's full-sized avatar

Keyacom

View GitHub Profile
@Keyacom
Keyacom / none_awareness.py
Last active September 17, 2022 14:40
None-aware functions (for PEP 505 being deferred)
"""
A way the proposed ``??``, ``?.`` and ``?[`` operators could be implemented.
For now, this lacks an implementation for ``??=``.
"""
from __future__ import annotations
from types import NoneType
from typing import Hashable, NamedTuple
@Keyacom
Keyacom / download.py
Last active May 29, 2023 15:46
Downloader for new-style Pokémon HOME icons
from sys import argv, exit
from ast import literal_eval
from pathlib import Path
from time import time
import requests
USAGE = 'USAGE: `python download.py [dirname="."]`'
class HTTP403Forbidden(Exception): pass
@Keyacom
Keyacom / staffhl.scss
Last active March 7, 2024 21:27
Staff highlighter (for Bulbapedia, can be modified for other MediaWiki wikis)
/* New staff highlighting system, utilizing the ::before pseudoelement.
* NOW WORKS FOR JS-UPDATED RECENT CHANGES!
* Made into SCSS for easier updating: https://gist.github.com/Keyacom/f79e429dfee8e014ef9123fd8357f91c
*/
@use 'sass:list';
@use 'sass:meta';
/* Fix Minerva redlink selectors */
a.new > *,