This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mcp | |
import time | |
m = mcp.MCP23008(0x21, 0, 2) | |
m.output(7, True) # turn on backlight | |
def pulse_enable(): | |
enable = 2 | |
m.output(enable, False) | |
time.sleep_us(1) | |
m.output(enable, True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lcd import initialize, puts, clear, set_pos | |
initialize() | |
puts('Ready...') | |
def get_climate_json(): | |
import socket | |
url = 'http://192.168.0.111/data.json' | |
_, _, host, path = url.split('/', 3) | |
addr = socket.getaddrinfo(host, 80)[0][-1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\ from proposal http://www.forth200x.org/fvalue.html | |
variable %var | |
: to 1 %var ! ; | |
: fvalue create f, does> %var @ if f! else f@ then 0 %var ! ; | |
0e0 fvalue i3 | |
0e0 fvalue r3 | |
59 value x1 | |
21 value y1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
def send(cmd): | |
subprocess.run(['bash', '-c', "echo %s > /dev/cu.usbmodem142303" % cmd ]) | |
process = subprocess.run(['osascript', 'getZoomStatus.applescript'], stdout=subprocess.PIPE) | |
status = process.stdout.decode().split(',') | |
print(status) | |
state = {y[0]: y[1] for y in [x.split(':') for x in status]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $# -ne 1 ]]; then | |
echo "Usage: ./meeting_countdown.sh NUM_MINS" | |
exit 1 | |
fi | |
MINS=$1 | |
OUTFILE=~/src/obs/timer_out.txt | |
MESSAGE="time remaining in this meeting: " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/smitmartijn/streamdeck-zoom-plugin/blob/33892febdc188b2124b2a32c55b84ba3d2b5c949/Sources/MacOS.cpp#L66 | |
# run with `osascript` | |
set zoomStatus to "closed" | |
set muteStatus to "disabled" | |
set videoStatus to "disabled" | |
set shareStatus to "disabled" | |
set recordStatus to "disabled" | |
tell application "System Events" | |
if exists (window 1 of process "zoom.us") then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// headphone mount that clips on my mic arm | |
//difference() { | |
//square(20, center=true); | |
//square(10, center=true); | |
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 x1=59 | |
11 y1=21 | |
20 i1=-1.0 | |
21 i2=1.0 | |
22 r1=-2.0 | |
23 r2=1.0 | |
30 s1=(r2-r1)/x1 | |
31 s2=(i2-i1)/y1 | |
40 for y=0 to y1 | |
50 i3=i1+s2*y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is executed on every boot (including wake-boot from deepsleep) | |
#import esp | |
#esp.osdebug(None) | |
import gc | |
import webrepl | |
webrepl.start() | |
gc.collect() |
NewerOlder