Skip to content

Instantly share code, notes, and snippets.

View tylercrumpton's full-sized avatar

Tyler Crumpton tylercrumpton

View GitHub Profile
@tylercrumpton
tylercrumpton / python-pyenv-setup-monterey.md
Last active February 21, 2023 22:58
Guide for setting up Python versions on macOS Monterey with `pyenv`

Setting up Python versions on macOS Monterey with pyenv

This guide was created on 2021/12/02, using a MacBook Pro running macOS Monterey v12.0.1.

This is mostly for my own information, but please feel free to use it yourself and make comments!

Install brew

(Or run brew update if already installed!)

@tylercrumpton
tylercrumpton / pedal_media_control.py
Created July 12, 2020 19:07
CircuitPython code for sending USB media controls with a foot pedal
import board # Lists the pin names for the board we're using
from time import sleep
# Set up the USB Human Interface Device (HID) libraries
import usb_hid
from adafruit_hid.consumer_control import ConsumerControl
from adafruit_hid.consumer_control_code import ConsumerControlCode
consumer_control = ConsumerControl(usb_hid.devices)
# Set up the analog input pin to read the pedal state
@tylercrumpton
tylercrumpton / sighandler.py
Created August 25, 2016 05:06
Python Signal Handler
import signal
def sighup_handler(signal_number, frame):
print "GOT A SIGHUP", signal_number, frame
if hasattr(signal, 'SIGHUP'):
signal.signal(signal.SIGHUP, sighup_handler)