Skip to content

Instantly share code, notes, and snippets.

View johnbarratt's full-sized avatar

John Barratt johnbarratt

View GitHub Profile
@justinschuldt
justinschuldt / raspberry-pi-zero_as_webcam.md
Last active November 26, 2024 19:18
Directions for setting up a RaspberryPi to act as a generic USB webcam

hardware/software

Webcam parts:

  • Raspberry Pi Zero W Rev 1.1
  • Raspberry Pi Camera v2 (8-megapixel)
  • Raspberry Pi High Quality Camera (12.3-megapixel)
  • Raspbian Buster Lite 2020-02-13

Webcam works with:

  • Windows 10
  • Windows 10 "Camera" app
@norwegianblueparrot
norwegianblueparrot / bourtange.R
Last active November 25, 2023 03:40
A script to produce a 3D render of Fort Bourtange from LiDAR data
## ----setup,include=FALSE,message=FALSE,warning=FALSE-----------------------------------------------------------------------------------------------------------------------------------------------------
library("here") # 1.0.1
library("sf") # 1.0-14
library("rgl") # 1.2.1
library("geoviz") # 0.2.2
library("raster") # 3.6-26
library("rayshader") # 0.35.7
library("osmdata") # 0.2.5
library("tidyverse") # 2.0.0
// ==UserScript==
// @name @chaoticvibing Twitter Blue Nerd - twitter.com
// @namespace Violentmonkey Scripts
// @match *://*.twitter.com/*
// @match *://*.x.com/*
// @grant none
// @version 1.9.2
// @author @chaoticvibing - GH @busybox11
// @description 11/9/2022, 11:45:28 PM
// @updateURL https://gist.githubusercontent.com/busybox11/53c76f57a577a47a19fab649a76f18e3/raw
@travisbrown
travisbrown / withheld-accounts.csv
Last active May 16, 2023 18:52
Twitter accounts withheld in specific countries, sorted by date of last observed change (most recent first)
Twitter ID Screen name Follower count Countries Observed Reversed
779611043819511809 kebs2theWorld 25 ID 2023-05-14
489399217 cevheriguven 584378 TR 2023-05-13
859035306 pascocle 767 ID 2023-05-13
2889606220 Tipobet_GirisTR 20991 TR 2023-05-13
3389937886 who98408150 715510 TR 2023-05-13
1250630172329402368 qazwsx168888 425623 ID 2023-05-13
1304490800844345355 MyVintageFox 28841 ID 2023-05-13
1357673140797796352 _YFKOfficial 404 IN 2023-05-13
1366132337919016960 JabamiOnly 10690 ID 2023-05-13
@Elwell
Elwell / README.md
Created July 16, 2023 11:44
ESPHome modbus configuration to read a Hiking DDS238-2 ZN/S Energy meter

ESPHome modbus polling of a single phase energy meter

This is my working configuration to poll a http://www.chinaenergymeter.com/1-1-15-dds238-2-zn-s-single-phase-din-rail-type-watt-hour-meter.html (I have the 65A hard wired variant - I've seen postings that the CT clamp version may not be as responsive

I'm using a wemos D1 mini (ESP8266) with a RS485 toTTL module (that's OK at 3.3v). This seems fine using software serial on D1/D2 at a polling rate of every 5s

GOTCHAS

  • If the wemos stays connected to home assistant but CAN'T talk to the meter, HA will re-use the last value rather than marking it offline/NaN/unavailable
@benfry
benfry / usb_detect.py
Last active November 21, 2024 11:58
Detect USB speeds and report via browser
#!/usr/bin/env python3
import json
import sys
''' Quick hack to detect the speed of plugged-in USB devices on macOS,
then write a simple HTML page with the info and open it in a browser.
Calls out to the command line system_profiler tool to retrieve the information.