Skip to content

Instantly share code, notes, and snippets.

@matt-desmarais
matt-desmarais / code.scad
Last active December 3, 2023 22:39
wheelchair kickstand draft
//wheelchair kickstand
base = 120;
width = 50;
height = 200;
camber = 25;
difference(){
union(){
rotate([0,45,0]){
@matt-desmarais
matt-desmarais / code.py
Last active November 27, 2023 02:24
Doom Scroll/Post Bot
import time
import board
import digitalio
import random
from adafruit_hid.mouse import Mouse
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
from adafruit_hid.keycode import Keycode
# Initialize mouse and keyboard
@matt-desmarais
matt-desmarais / code.py
Created November 24, 2023 01:36
OpenAI verbal conversation
from openai import OpenAI
import os
client = OpenAI(api_key='sk-...')
import pyfiglet
import time
from pyfiglet import Figlet
import keyboard
f = Figlet(font='basic', justify='center', width=80)
# Set your OpenAI API key here
@matt-desmarais
matt-desmarais / code.py
Last active October 2, 2023 14:43
Face Detect
#!/usr/bin/python3
import os
import cv2
import libcamera
from picamera2 import Picamera2
import PIL.Image
import time
# Directory to save the captured images
output_dir = "/home/pi/captured_images"
@matt-desmarais
matt-desmarais / turret.py
Created September 15, 2023 16:54
Turret code so far
#!/usr/bin/python3
import RPi.GPIO as GPIO
import os
import signal
import atexit
import random
from PIL import Image
import time
from picamera2 import MappedArray, Picamera2, Preview
import cv2
@matt-desmarais
matt-desmarais / doors.yaml
Last active July 5, 2023 19:56
Freezer Blueprints
blueprint:
name: ESP32 Door Alarm
description: "Control LEDs and buzzer based on door sensor states"
domain: automation
input:
door_sensor_1:
name: Door Sensor 1
description: "Select the door sensor for Door 1"
selector:
entity:
@matt-desmarais
matt-desmarais / door_alarm.yaml
Created May 2, 2023 20:43
Food Assistant Blueprints: Group Notifications Temperature and Door Alarms for fridges/freezers
blueprint:
name: Notify if door open too long
description: This automation will send a notification if a door sensor has been open for a specified duration.
domain: automation
input:
door_sensor:
name: Door sensor
description: The door sensor to monitor.
selector:
@matt-desmarais
matt-desmarais / analyzer.py
Last active June 22, 2023 09:36
Logic Meter - Detect logical fallacies with usb soundcard
import pyaudio
import wave
import os
import datetime
import speech_recognition as sr
import openai
import re
import threading
import time
import rainbowhat as rh
@matt-desmarais
matt-desmarais / languageSelect.py
Created March 22, 2023 00:37
select language for historical figure
import openai
openai.api_key = "sk-..."
from google.cloud import texttospeech
from google.oauth2 import service_account
creds = service_account.Credentials.from_service_account_file('/home/pi/key.json')
client = texttospeech.TextToSpeechClient(credentials=creds)
voices = client.list_voices().voices
standardVoices = []
@matt-desmarais
matt-desmarais / code.py
Created March 17, 2023 01:20
asking for impersonation
import openai
import time
import random
import os
import keyboard
import subprocess
from pyfiglet import Figlet
# API key for OpenAI API
openai.api_key = "sk-"