Skip to content

Instantly share code, notes, and snippets.

View peterwallhead's full-sized avatar
👨‍💻
coding all the things

Peter Wallhead peterwallhead

👨‍💻
coding all the things
View GitHub Profile
javascript:(() => {
const requestURL = "http://127.0.0.1:8080/api/readingList";
const token = "dfgkjlhsdfgkljghklhj";
const pageTitle = document.title;
const pageURL = window.location.href;
let metaImage = "";
let metaDescription = "";
function getMetaValue(propName) {
@rowena-s
rowena-s / code.py
Last active September 6, 2020 00:45
Code for Wearing Your Python and Making It Sing Too! 2020 #pyconlineau talk
#instrument samples can be obtained from https://philharmonia.co.uk/resources/sound-samples/
#file conversion instructions: https://learn.adafruit.com/microcontroller-compatible-audio-file-conversion
from adafruit_circuitplayground.express import cpx
from time import sleep
cpx.pixels.brightness = 0.1
ctr = 0
while True:
@nickjevershed
nickjevershed / corona.py
Created March 12, 2020 04:57
Gets the latest data from the Johns Hopkins COVID-19 tracker, via GitHub
# This script will get the latest data from the Jons Hopkins GitHub repo https://github.com/CSSEGISandData
def getData():
import requests
files = [
"time_series_19-covid-Confirmed.csv",
"time_series_19-covid-Deaths.csv",
"time_series_19-covid-Recovered.csv"
import time
print "..."
time.sleep(1)
print "..."
print "..."
print "..."
print "..."
time.sleep(1)
print "..."
@willprice
willprice / README.md
Last active February 8, 2023 21:27
Install OpenCV 4.1.2 for Raspberry Pi 3 or 4 (Raspbian Buster)

Install OpenCV 4.1.2 on Raspbian Buster

$ chmod +x *.sh
$ ./download-opencv.sh
$ ./install-deps.sh
$ ./build-opencv.sh
$ cd ~/opencv/opencv-4.1.2/build
$ sudo make install
@peterwallhead
peterwallhead / compre.py
Created July 12, 2018 20:29 — forked from soruly/compre.py
Compare two images using OpenCV and SIFT in python
import cv2
import sys
import os.path
import numpy as np
def drawMatches(img1, kp1, img2, kp2, matches):
rows1 = img1.shape[0]
cols1 = img1.shape[1]
rows2 = img2.shape[0]
import cv2
import time
hog = cv2.HOGDescriptor()
hog.setSVMDetector(cv2.HOGDescriptor_getDefaultPeopleDetector())
cap = cv2.VideoCapture("/path/to/test/video")
while True:
r, frame = cap.read()
if r:
start_time = time.time()
import cv2
import time
person_cascade = cv2.CascadeClassifier(
os.path.join('/path/to/haarcascade_fullbody.xml'))
cap = cv2.VideoCapture("/path/to/test/video")
while True:
r, frame = cap.read()
if r:
start_time = time.time()
@NeoCat
NeoCat / esp8266-amg8833.ino
Last active December 12, 2024 04:09
ESP8266 + AMG8833 WebSocket-based Viewer
// ESP8266 Pins
// 4(SDA) --- AMG8833 SDA
// 5(SCL) --- AMG8833 SCL
// 13 --- LED (Anode) via 100ohm
#include <pgmspace.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <WebSocketsServer.h>
int led = 13; // We are going to make Pin 13 LED blink
int threshold = 28; // Change this to the level you want the light to come on
int volume;
void setup() {
Serial.begin(9600);
pinMode(led, OUTPUT);
}
void loop() {