Skip to content

Instantly share code, notes, and snippets.

View StevenMaude's full-sized avatar
🏠
Working from home

Steven Maude StevenMaude

🏠
Working from home
View GitHub Profile
@StevenMaude
StevenMaude / 10-mx-revolution.hwdb
Last active May 19, 2026 23:29
Remapping Logitech MX Revolution second mouse wheel under Wayland
# Function:
# This HWDB entry maps the second mouse wheel to volume controls.
#
# Usage:
# 1. cp 10-mx-revolution.hwdb /etc/udev/hwdb.d/10-mx-revolution.hwdb
# 2. sudo systemd-hwdb update
# 3. sudo udevadm trigger
#
# References:
# https://wiki.archlinux.org/title/Map_scancodes_to_keycodes
@StevenMaude
StevenMaude / how-to-speak.md
Created December 28, 2020 18:40
Notes on "How To Speak" by Prof. Patrick Winston

How To Speak by Prof. Patrick Winston

MIT 2018 talk

How to start

  • Suggests not starting with a joke.
    • Audience isn't necessarily attuned to your mode of speaking.
  • Start with an empowerment promise; what will the audience get from the talk.

Notes from reading Practical Go

Notes of the key points copied/summarised from Dave Cheney's Practical Go for more concise reading/reference.

It's worth reading the original document as there is more exposition there of the ideas presented.

These are terse notes only; I'm not providing my own commentary, opinion

@StevenMaude
StevenMaude / das_notes.md
Last active May 19, 2026 23:30
Destroy All Software screencast notes

Destroy All Software screencast notes

Earlier this year, the Destroy All Software screencasts were free to download. I grabbed a few that sounded interesting to watch.

These are notes of new things I learned.

0004: Source Code History Integrity

@StevenMaude
StevenMaude / mailin8.sh
Last active May 19, 2026 23:25
DEPRECATED: see https://github.com/StevenMaude/go-mailin8 — Retrieve most recent email from a mailinator.com temporary email box using curl and jq at the command line; useful if you just want some account activation link, but too lazy to visit the site directly. (It's actually mailinfewerthan8usefullines, rather than mailin8usefullines, but, hey…
#!/bin/bash -e
# mailin8.sh: Collect From, Subject, Body from most recent mail
# in a mailinator.com account.
# Usage: mailin8.sh <local_mailbox_name>
# <local_mailbox_name> is the bit before @mailinator.com
# Create temporary file for cookiejar
TEMP=$(mktemp)
@StevenMaude
StevenMaude / extract_gpx_data.py
Last active May 19, 2026 23:23
Quick hacky script to extract date and 2D length data from GPX files to CSV using gpxpy; at least compatible with Py2.7/3.4
#!/usr/bin/env python
""" Extract date and 2D length data from GPX files in current directory. """
from __future__ import division, print_function
import decimal
import glob
import gpxpy
def main():
@StevenMaude
StevenMaude / convert_gpx.sh
Last active May 19, 2026 23:23
Use gpsbabel to convert Garmin .FIT to .gpx — requires a fairly recent version of gpsbabel (minimum 1.4.3); see https://www.stevenmaude.co.uk/posts/using-garmin-forerunner-watches-with-linux for more details on using Garmin watches with Linux
#!/bin/sh
# Usage: convert_gpx.sh <FIT filename>
# Should works whether you include the .FIT extension or not.
filename=$(basename "$1" .FIT)
gpsbabel -i garmin_fit -f "$filename".FIT -o gpx -F "$filename".gpx
@StevenMaude
StevenMaude / tfidf_features.py
Created July 21, 2014 13:35
Do TF-IDF with scikit-learn and print top features
#!/usr/bin/env python
# encoding: utf-8
import codecs
import os
import sys
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer