Skip to content

Instantly share code, notes, and snippets.

@rjw57
rjw57 / pmdown.py
Last active October 23, 2023 02:00
#!/usr/bin/env python3
#
# THIS SCRIPT REQUIRES PYTHON 3
#
# Install requirements via:
# pip3 install docopt pillow reportlab
#
# Dedicated to the public domain where possible.
# See: https://creativecommons.org/publicdomain/zero/1.0/
"""
"""
Detect vehicles in a video sequence writing the result to an hdf5 file.
Usage:
detectvehicles (-h | --help)
detectvehicles [options] <videofile> <hdf5output>
Options:
-h, --help Show brief usage summary.
-q, --quiet Reduce logging verbosity.
#!/bin/bash
#
# Usage:
# gen-ssl-cert.sh [common name]
#
# If common name is specified, it is used as the common name (i.e. server name)
# for the certificate. If omitted, a placeholder is used.
# exit on error
set -e

Compiling OpenCV 3 with Python bindings and pyenv

Dependencies

Luckily Ubuntu has support for getting the build dependencies for a package directly via apt-get:

sudo apt-get build-dep opencv
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Scraping the LibDem party membership

A silly pile of scripts to plot Liberal Democrat party membership over time.

fetch.sh

Shell script to fetch data once every 150 seconds. Should be run from this directory. Needs data/ directory to exist.

parsedata.py

#define VIA1 ((volatile unsigned char*)0xDFE0)
#define VIA1_DDRB VIA1
#define VIA1_ORB (VIA1+2)
#define MC6845_AR ((volatile unsigned char*)0xDFFA)
#define MC6845_DR ((volatile unsigned char*)0xDFFB)
#define HORIZ_TOT 0x00
#define HORIZ_DISP 0x01
#define HORIZ_SYNCP 0x02
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.