>>> from functools import reduce, partial
>>> from operator import getitem
>>>
>>> # First, let's get an understanding of how reduce and partial actually work:
>>> # reduce() comes in two variants: the first variant takes a single iterable
>>> # featuring the initial value followed by the arguments to be applied on the previous value
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
| # SPDX-FileCopyrightText: 2026 geisserml <geisserml@gmail.com> | |
| # SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause | |
| # This is essentially a copy of https://github.com/pypdfium2-team/pypdfium2/blob/11c67012f256abd3c402c47e9abe26bfbc3d182e/utils/dev/git_net_additions.py | |
| # Please check pypdfium2's main branch for possible updates. | |
| # Augment `git diff --numstat` with a delta column (net additions, i.e. additions-deletions), and sort the output by that column. | |
| # This helps maintainers analyze net growth (or degrowth) between refs on a per file basis, ordered by relevance, with the highest net additions shown first. (Author's note: AOTW, neither git itself, nor GitHub, nor any other tool I'm aware of seemed to offer that functionality.) | |
| # For completeness, this script also adds a churn column (absolute additions+deletions) as in `git diff --stat`. Validates the final result against `git diff --shortstat`. |
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
| import re, sys | |
| pattern = sys.argv[1] | |
| out_pattern = sys.argv[2] | |
| string = sys.argv[3] | |
| match = re.search(pattern, string) | |
| result = out_pattern % match.groups() | |
| print(result, end="") |
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
| class layereddict (dict): | |
| def __init__(self, layer, **kwargs): | |
| super().__init__(**kwargs) | |
| self._layer = layer | |
| def __missing__(self, key): | |
| return self._layer[key] |
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
| # SPDX-FileCopyrightText: 2026 geisserml <geisserml@gmail.com> | |
| # SPDX-License-Identifier: MPL-2.0 | |
| import stl # local | |
| from typing import TYPE_CHECKING | |
| if TYPE_CHECKING: | |
| from functools import cached_property as cached_prop_typehint | |
| else: | |
| def cached_prop_typehint(func): |
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
| # SPDX-FileCopyrightText: 2026 geisserml <geisserml@gmail.com> | |
| # SPDX-License-Identifier: MPL-2.0 | |
| from typing import TYPE_CHECKING | |
| from stl import cached_property | |
| if TYPE_CHECKING: | |
| from functools import cached_property | |
| def _func_visitor(cp_map): |
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
| # SPDX-FileCopyrightText: 2026 geisserml <geisserml@gmail.com> | |
| # SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause | |
| # See also | |
| # https://github.com/pypdfium2-team/pypdfium2/blob/950aeb49b8aa1b5e9bc248b1ff293d4e586bf41b/src/pypdfium2_stl/shared/stl.py | |
| # https://stackoverflow.com/a/78825819/15547292 | |
| # https://gist.github.com/mara004/076e3110aba8e8a3f8a6f2c84af350ee | |
| class cached_property: | |
| """ |
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
| # Dump your /usr/share/X11/locale/en_US.UTF-8/Compose below and save as ~/.XCompose | |
| <Multi_key> <minus> <numbersign> : "β" U2011 # NONBREAKING HYPHEN |
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
| # SPDX-FileCopyrightText: 2025 geisserml <geisserml@gmail.com> | |
| # SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause | |
| import functools | |
| class finally_decorator: | |
| def __init__(self, callback): | |
| self._callback = callback | |
In the course of this process, you will download several apps from external sources. To be on the safe side, you'll want to check each APK with https://www.virustotal.com/ before installation. You are also encouraged to use Firefox with uBlockOrigin and the Badware Risks filter list enabled, as a precaution against scamming sites.
- Install ReVanced Manager from https://github.com/ReVanced/revanced-manager/releases/latest or https://revanced.app/download
- Open ReVanced Manager (grant permission to install apps when asked for). Tap
Patches -> Select an app. Look for YouTube and theSuggested:version. It should be in the 3rd line. (Do not use the 1st line, that's your installed version of YouTube.) - Go to https://www.apkmirror.com/ and search for
YouTube $VERSION, where$VERSIONis the suggested version you have determined in (2). (Alternatively, tap on theSuggested: ...field to do a browser search that may lead you to the apkmirror site in question.) Once you've found the right APK, downlo
NewerOlder