Skip to content

Instantly share code, notes, and snippets.

View jjfalling's full-sized avatar

Jeremy Falling jjfalling

View GitHub Profile
@jjfalling
jjfalling / button_restart_services.py
Last active November 25, 2023 10:06
Restart service (or run other task) based on button hold duration
#!/usr/bin/env python3
# Restarts streaming services when button is pressed
# led functionality is:
# - on for 3 sec when this program starts
# - one blink for each second button is held
# - on for one second when there was a valid action for the button hold duration
# - three blinks when there was no valid action for the button hold duration
import logging
@jjfalling
jjfalling / button_handler.py
Last active January 18, 2022 17:13
Button handler to toggle rhasspy wake word detection. For google aiy voice v1 hat (or similar)
#!/usr/bin/env python3
# Toggles rhasspy wake word detection with a button.
# Intended to work with a v1 google aiy voice hat, but should work with any button and led.
import RPi.GPIO as GPIO
import time
import requests
import signal
import sys
import logging

Keybase proof

I hereby claim:

  • I am jjfalling on github.
  • I am jjfalling (https://keybase.io/jjfalling) on keybase.
  • I have a public key ASCawrV3p3dUi_qZEBamsAbNpA1k0CSX2QYB8j6ql4oCnQo

To claim this, I am signing this object:

tell application "System Events" to tell process "zoom.us"
if menu item "Mute Audio" of menu 1 of menu bar item "Meeting" of menu bar 1 exists then
click menu item "Mute Audio" of menu 1 of menu bar item "Meeting" of menu bar 1
else if menu item "unmute Audio" of menu 1 of menu bar item "Meeting" of menu bar 1 exists then
click menu item "Unmute Audio" of menu 1 of menu bar item "Meeting" of menu bar 1
end if
end tell
@jjfalling
jjfalling / gist:7a9a3dc384327accf2e2
Created February 20, 2015 21:58
pi-backlight.py
#!/usr/bin/env python
#****************************************************************************
#* pi-backlight.py *
#* backlight control for adafruit raspberry pi touchscreen *
#* button on touchscreen controls backlight mode and a TSL2561 *
#* detects ambiant light for auto mode. assumes you are running x11 *
#* *
#* Copyright (C) 2015 by Jeremy Falling except where noted. *
#* *
@jjfalling
jjfalling / gist:8118225
Last active January 8, 2016 10:46
backlight control for rpi tft screen
#!/usr/bin/env python
import RPi.GPIO as GPIO
import time
import os
#adjust for where your switch is connected
buttonPin = 18
sleepDelay = 1.0
GPIO.setmode(GPIO.BCM)
GPIO.setup(buttonPin,GPIO.IN, pull_up_down=GPIO.PUD_UP)