Skip to content

Instantly share code, notes, and snippets.

View robertcedwards's full-sized avatar
🖼️
Framing

Robert C Edwards robertcedwards

🖼️
Framing
View GitHub Profile
@benmarwick
benmarwick / object-outline-and-dimensions-opencv.py
Last active April 23, 2024 01:28
Python 3 script to take live video, detect the largest object, trace an outline (contour) and measure linear dimensions, using OpenCV
# in a terminal
# python -m pip install --user opencv-contrib-python numpy scipy matplotlib ipython jupyter pandas sympy nose
import cv2
import pandas as pd
import numpy as np
import imutils
from scipy.spatial import distance as dist
from imutils import perspective
anonymous
anonymous / gist:0e2e50e58855a352d936b2faa1d864c5
Created December 1, 2017 18:09
Rotate pi touch screen 7" after modding boot/config.txt
in case of inverting rotate (clockwise 180 degree),
⎡-1 0 1 ⎤
⎜ 0 -1 1 ⎥
⎣ 0 0 1 ⎦
@lg
lg / cloudy-gamer-launcher.sh
Last active April 28, 2021 14:25
Easily start/stop Paperspace and Parsec instances
#!/bin/bash
#
# CloudyGamerLauncher by Larry Gadea
# Easily start/stop Paperspace and Parsec instances
#
# Make sure to fill out the variables below. For the machine id, use the
# 8-letter identifier for the machine on Paperspace (ex. PS8RGDUY)
#
# Note: Requires Paperspace API key (generate one in account settings)
@sticilface
sticilface / PROGMEM.md
Last active July 23, 2023 11:38
PROGMEM

Guide to PROGMEM on ESP8266 and Arduino IDE

Intro

On low memory devices like the arduino and esp8266 you do not want strings to be stored in RAM. This occurs by default on these systems. Declare a string const char * xyz = "this is a string" and it will use up RAM.

The solution on these devices is to allow strings to be stored in read only memory, in Arduino this is the PROGMEM macro. Most of my experience is with the ESP8266 which is a 32bit micros controller. This device stores PROGMEM data in flash. The macro PROGMEM on ESP8266 is simply

#define PROGMEM   ICACHE_RODATA_ATTR
@oandrienko
oandrienko / measure.py
Last active July 26, 2019 18:21
An image processing script for measurments
#!/usr/bin/env python
#title :measure.py
#description :An image processing script for measurments
#author :Oles Andrienko, Adrian Rosebrock
#date :20161110
#version :0.1
#usage :python measure.py [-l] <reference_length>
#python_version :2.7.12
#==============================================================================
@hongkongkiwi
hongkongkiwi / generate-dropbear-key
Last active September 28, 2024 17:58
Generate SSH Key in Dropbear with some options (by default it uses default id_dropbear as the name and ed25519 as the type)
#!/bin/sh +ux
# We set the sh +ux flags so that we error on undefined variables and error on bad commands
help() {
echo >&2 "$0 [-f] [-p] [-q] [<priv_key_file>] [<key_type>] [<key_comment>]"
echo >&2
echo >&2 "-q / --quiet to silent all output (except -p if passed)"
echo >&2 "-p / --pubkey to output public key after generation"
echo >&2 "-f / --force to force replacing existing key"
echo >&2
@visnup
visnup / README.md
Last active September 18, 2017 02:25
RICOH THETA S live 360º video stream rendering in Chrome via WebGL and a <video> texture

To get this working, you'll need the [live-streaming software from RICOH][1]. Install that and follow the [live video instructions][2] to connect your camera to your computer and have it show up as a video source.

If you're on a Mac, you can open up the FaceTime app and test it by picking "THETA UVC Blender" from the Video menu.

Once all of that is working, open up index.html and you should see the video rendered on the inside of a sphere that you can rotate around. Use the mouse to click and drag to move the camera around and the mouse wheel to zoom in and

@suhajdab
suhajdab / rfid-node.ino
Last active March 27, 2022 16:21
Particle Photon + RC522 RFID implant reader
#include "MFRC522/MFRC522.h"
/*
Function Core Pin MRFC522 Pin
Reset D2 RST
SPI SS D1 SDA
SPI MOSI A5 MOSI
SPI MISO A4 MISO
SPI SCK A3 SCK
*/
@JadenGeller
JadenGeller / SwiftPackages.md
Last active February 20, 2016 19:32
Swift Packages by Jaden Geller

Matrices with friendly semantics and a familiar interface

var x: Matrix = [[1, 2, 3], [5, 6, 7]]
x.columns.append([4, 8])
let y = -x * x.transpose
assert(y.determinant == 320)
import socket
import struct
import binascii
from time import sleep
from phue import Bridge
b = Bridge('192.168.1.247') # Enter bridge IP here.
turnOn = {'transitiontime' : 1, 'hue' : 34112, 'sat' :254, 'on' : True, 'bri' : 254}
turnOff = {'on' : False}