Skip to content

Instantly share code, notes, and snippets.

View andrewleech's full-sized avatar

Andrew Leech andrewleech

View GitHub Profile
@andrewleech
andrewleech / install.sh
Last active February 24, 2026 11:43
Fix Claude Code statusline layout (issue #27305) — single-file installer
#!/bin/bash
# Installer for claude-statusfix — fixes Claude Code statusline layout.
# https://github.com/anthropics/claude-code/issues/27305
#
# Usage: curl -fsSL https://gist.githubusercontent.com/andrewleech/43688422c58510e01818c5fc04e26b28/raw/install.sh | bash
#
# Installs claude-statusfix to ~/.local/bin/ and prints alias instructions.
set -euo pipefail
@andrewleech
andrewleech / flaky-tests-report.md
Created February 23, 2026 19:42
MicroPython CI flaky test analysis — 575 master push runs over 14 months

MicroPython CI Flaky Test Report

Analysis of intermittent test failures in the unix port GitHub Actions workflow on the master branch of micropython/micropython.

Methodology

Job-level pass/fail data was collected via the GitHub API for all ports_unix.yml workflow runs triggered by pushes to master. For the subset of runs where GitHub still retains logs (roughly the last 90 days), the specific

@andrewleech
andrewleech / check-devices.sh
Created October 21, 2025 20:49
MicroPython device version checker - queries connected devices and reports firmware versions
#!/bin/bash
# check-devices.sh - Query MicroPython device version information
#
# Usage:
# check-devices.sh [OPTIONS] [DEVICE]
#
# Options:
# -h, --help Show this help message
# -v, --verbose Enable verbose output
# -t, --timeout N Set query timeout in seconds (default: 5)
@andrewleech
andrewleech / fsbuilder.py
Created September 15, 2022 21:47
Building a canned filesystem dfu for micropython
"""
MicroPython filesystem builder.
Example usage (build micropython-dev using make VARIANT=dev in the unix port):
micropython-dev -X heapsize=10m fsbuilder.py 4096 512 lfs2 directory/
This will create an image "directory.img" which can then be deployed to a device.
To turn it into a DFU file use (dfu.py can be found in MicroPython tools/):
@andrewleech
andrewleech / util.py
Created September 2, 2019 07:07
ble advertising data example
BLE_GAP_AD_TYPE_FLAGS = 0x01 # Flags for discoverability.
BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_MORE_AVAILABLE = 0x02 # Partial list of 16 bit service UUIDs.
BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_COMPLETE = 0x03 # Complete list of 16 bit service UUIDs.
BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_MORE_AVAILABLE = 0x04 # Partial list of 32 bit service UUIDs.
BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_COMPLETE = 0x05 # Complete list of 32 bit service UUIDs.
BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE = 0x06 # Partial list of 128 bit service UUIDs.
BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE = 0x07 # Complete list of 128 bit service UUIDs.
BLE_GAP_AD_TYPE_SHORT_LOCAL_NAME = 0x08 # Short local device name.