Skip to content

Instantly share code, notes, and snippets.

View C-Ezra-M's full-sized avatar

C.Ezra.M C-Ezra-M

View GitHub Profile
@C-Ezra-M
C-Ezra-M / download.py
Created May 8, 2024 11:40
PTCGO card images from Malie.io
# https://malie.io/static
import requests as r
from pathlib import Path
import logging as log
import time
log.basicConfig(level=log.INFO)
#log.basicConfig(level=log.DEBUG)
sets = r.get("https://malie.io/static/metamon/SetDataMap.json").json().keys()
dest = Path("card_images")
@C-Ezra-M
C-Ezra-M / staffhl.scss
Last active May 26, 2024 09:59
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/C-Ezra-M/f79e429dfee8e014ef9123fd8357f91c
*/
@use 'sass:list';
@use 'sass:meta';
/* Fix Minerva redlink selectors */
a.new > *,
@C-Ezra-M
C-Ezra-M / 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
@C-Ezra-M
C-Ezra-M / 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