Skip to content

Instantly share code, notes, and snippets.

@trickeydan
trickeydan / manifest.py
Created November 12, 2021 21:15
Kit Manifest to Library Processor
from pathlib import Path
import requests
with Path("manifest").open() as fh:
lines = fh.read().splitlines()
buffer = []
data = {}
@trickeydan
trickeydan / mail.py
Created January 6, 2021 18:51
Dovecot Wildcard Email Sorter
#! /home/dgt/venv/bin/python3
"""
Dovecot Wildcard Email Sorter
Used to sort inbound email to a wildcard address into category subfolders.
Used by me on Mythic Beasts hosted webmail.
Copyright 2021 Dan Trickey
@trickeydan
trickeydan / sr-robot-threaded-start.py
Created August 1, 2020 18:34
Poll start button on power board directly from robot code.
#!/usr/bin/env python3
"""
Example code of using daemon threads to poll start.
(C) Dan Trickey 2020
Released under MIT Licence
"""
import threading
@trickeydan
trickeydan / j5_vision.py
Created January 20, 2020 19:43
Print markers using j5
from pathlib import Path
from typing import Set
from j5 import BaseRobot, BoardGroup
from j5.boards import Board
from j5.boards.zoloto import ZolotoCameraBoard
from j5.backends.hardware.zoloto.camera_board import ZolotoCameraBoardHardwareBackend
from zoloto.cameras import Camera
@trickeydan
trickeydan / plot_axes.py
Created January 14, 2020 22:45
Plot Zoloto Axes.
from pathlib import Path
from zoloto.cameras.camera import Camera
from zoloto.marker_dict import MarkerDict
import matplotlib.pyplot as plt
class DefaultCamera(Camera):
@trickeydan
trickeydan / box-unpacker
Last active October 15, 2019 10:02
Script to empty a container using the Student Robotics Inventory
#!/usr/bin/env bash
#
# Copyright (c) 2019 Dan Trickey.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
@trickeydan
trickeydan / Makefile
Created August 7, 2019 12:33
Python Poetry Makefile
.PHONY: all clean lint type test test-cov
CMD:=poetry run
PYMODULE:=j5
TESTS:=tests
EXTRACODE:=tests_hw
all: type test lint
lint:
@trickeydan
trickeydan / keybase.md
Last active January 14, 2021 15:53
Keybase

Keybase proof

I hereby claim:

  • I am trickeydan on github.
  • I am trickeydan (https://keybase.io/trickeydan) on keybase.
  • I have a public key whose fingerprint is 6C58 CF1C DBC0 EE8F 6F70 E622 D523 6EF5 84F7 08EE

To claim this, I am signing this object: