Skip to content

Instantly share code, notes, and snippets.

View honno's full-sized avatar
🛰️

Matthew Barber honno

🛰️
View GitHub Profile
@honno
honno / README.md
Last active October 31, 2026 16:00
Vibe coded Violentmonkey script to book c2c tickets easily

c2c Quick Booking

A personal userscript that speeds up booking tickets on the c2c website. Tested only in Firefox with Violentmonkey. Other browsers and userscript managers are untested.

Setup

Install Violentmonkey, create a new script, paste in c2c-helper.user.js and save. Reload the c2c website, then open Settings in the helper panel to enter your login and billing details. A saved payment card is needed for automatic payment.

To update, replace the contents of the existing script and save. Your settings will remain.

from microbit import *
import audio
import math
import neopixel
nps = [neopixel.NeoPixel(pin0, i, bpp=3) for i in range(1,10)]
current_np = 0
while True:
if button_a.is_pressed() or button_b.is_pressed():
from typing import Dict, Iterator, Tuple, TypeVar, Union
K = TypeVar("K")
V = TypeVar("V")
NestedDict = Union[V, Dict[K, Union["NestededDict", V]]]
def flatten_nested(
nested: NestedDict, parent_keys: Tuple[K, ...] = ()
) -> Iterator[Tuple[Tuple[K, ...], V]]:
diff --git a/torch_np/tests/numpy_tests/core/test_indexing.py b/torch_np/tests/numpy_tests/core/test_indexing.py
index b2918fd..a1b6c6d 100644
--- a/torch_np/tests/numpy_tests/core/test_indexing.py
+++ b/torch_np/tests/numpy_tests/core/test_indexing.py
@@ -2,6 +2,7 @@ import sys
import warnings
import functools
import operator
+import re
@honno
honno / out.txt
Created February 14, 2023 14:20
pip debug -v
pip version: pip 23.0 from /home/honno/workspaces/foo/.venv/lib/python3.8/site-packages/pip (python 3.8)
sys.version: 3.8.12 (default, Nov 12 2022, 14:27:20)
[GCC 11.3.0]
sys.executable: /home/honno/workspaces/foo/.venv/bin/python
sys.getdefaultencoding: utf-8
sys.getfilesystemencoding: utf-8
locale.getpreferredencoding: UTF-8
sys.platform: linux
sys.implementation:
name: cpython
import math
import sys
from itertools import product
from operator import index
import numpy as np
import pytest
from hypothesis import assume, given, note
from hypothesis import strategies as st
from hypothesis.extra import numpy as nps
def make_strategies_namespace(
xp: Any, *, api_version: Optional[NominalVersion] = None
) -> SimpleNamespace:
...
if api_version is None:
# When api_version=None, we infer the most recent API version for which
# the passed xp is valid. We go through the released versions in
# descending order, passing them to x.__array_namespace__() until no
# errors are raised, thus inferring that specific api_version is
# supported. If errors are raised for all released versions, we raise

A table which lists every function/method.

data-apis.org/array-api/latest/compliance-table

Pick a library and version:   numpy ▼   1.27.0 ▼

    abs                      🟢
    acos                     🟢
    add                      🟡  ▶
 ...
@honno
honno / details_summary.md
Created June 14, 2022 11:21
Using `<details>` for code blocks
Summary text
your code
@honno
honno / get_mod.py
Created February 8, 2022 11:14
Get module via path
from importlib.util import spec_from_file_location, module_from_spec
from pathlib import Path
from types import ModuleType
def get_mod(path: Path) -> ModuleType:
mod_name = path.name.replace(".py", "")
spec = spec_from_file_location(mod_name, path)
assert spec is not None
mod = module_from_spec(spec)
assert spec.loader is not None