Skip to content

Instantly share code, notes, and snippets.

header = '''
#pragma once
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/rmt.h"
#include "driver/gpio.h"
#include "esp_system.h"
#include "esp_log.h"
//https://github.com/mswietlicki/Lirc_remotes/blob/master/benq.config
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/rmt.h"
#include "driver/gpio.h"
#include "esp_system.h"
#include "esp_log.h"
@JarrettR
JarrettR / fbmp.js
Last active February 24, 2024 22:26
// ==UserScript==
// @name FBMP Hider
// @namespace http://tampermonkey.net/
// @version 2024-01-11
// @description try to take over the world!
// @author You
// @match https://www.facebook.com/marketplace/*
// @require https://code.jquery.com/jquery-3.2.1.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
@JarrettR
JarrettR / swap_components.py
Created July 21, 2022 22:57
KiCad extension for swapping components
"""
Swaps the location of two selected components
"""
import pcbnew
class ComponentSwap(pcbnew.ActionPlugin):
"""
Select two (or more!) components and press the button
"""
def defaults(self):
import subprocess
# .\stm8flash.exe -c stlinkv2 -p stm8s105?4 -r out.bin -b 1
out = b'\x00'
while out == b'\x00':
subprocess.run(['stm8flash.exe', '-c', 'stlinkv2', '-p', 'stm8s105?4', '-r', 'out.bin', '-b', '1'])
@JarrettR
JarrettR / .config
Created March 28, 2020 07:14
Lichee Pi Nano Linux Config
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 4.15.0-rc8 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_ARM_HAS_SG_CHAIN=y
CONFIG_MIGHT_HAVE_PCI=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_HAVE_PROC_CPU=y
CONFIG_STACKTRACE_SUPPORT=y
#Modifications to /boot/* files, will not be saved when powered on.
#Please ensure you edit from the DietPi-RamDisk location /DietPi/*
#NB: This is intended for advanced users, unless you know what you are doing, do not edit this file. Please use the DietPi programs instead.
#NB: Do not remove uncommented lines, as the items are scraped by DietPi programs, on demand.
#------------------------------------------------------------------------------------------------------
# D I E T - P I
# DietPi-Automation settings, applied on the 1st boot of DietPi, ONCE
#------------------------------------------------------------------------------------------------------
#Modifcations to /boot/* files, will not be saved when powered on.
#Please ensure you edit from the DietPi-RamDisk location /DietPi/*
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# Set to 1 if your display has a black border of unused pixels visible
disable_overscan=1
# uncomment the following to adjust overscan. Use positive numbers if console
#Install all required applications
apt-get install -y sshfs autossh python3-dev build-essential libjpeg8-dev zlib1g-dev python3-pip python3-setuptools
#opencv tools
#apt-get install -y libatlas3-base libwebp6 libtiff5 libjasper1 libilmbase12 libopenexr22 libilmbase12 libgstreamer1.0-0 libavcodec57 libavformat57 libavutil55 libswscale4 libgtk-3-0 libpangocairo-1.0-0 libpango-1.0-0 libatk1.0-0 libcairo-gobject2 libcairo2 libgdk-pixbuf2.0-0
#Install required Python modules
pip3 install wheel
pip3 install pillow picamera adafruit-io
#pip3 install opencv-python-headless
@JarrettR
JarrettR / cam.py
Last active January 22, 2019 20:27
from io import BytesIO
from time import sleep, time
import picamera
from PIL import Image
import imgcompare
from Adafruit_IO import Client, Feed
ADAFRUIT_IO_KEY = ''
ADAFRUIT_IO_USERNAME = 'jrainimo'