Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Robert C Edwards robertcedwards

🎯
Focusing
View GitHub Profile
@benmarwick
benmarwick / object-outline-and-dimensions-opencv.py
Last active Oct 26, 2020
Python 3 script to take live video, detect the largest object, trace an outline (contour) and measure linear dimensions, using OpenCV
View object-outline-and-dimensions-opencv.py
# 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 Dec 1, 2017
Rotate pi touch screen 7" after modding boot/config.txt
View gist:0e2e50e58855a352d936b2faa1d864c5
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 Sep 23, 2020
Easily start/stop Paperspace and Parsec instances
View cloudy-gamer-launcher.sh
#!/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)
View PROGMEM.md

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 Jul 26, 2019
An image processing script for measurments
View measure.py
#!/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 Dec 19, 2020
Generate SSH Key in Dropbear
View generate-dropbear-key
#!/bin/bash
KEY_DIR="/mnt/sda1/.ssh"
# Make directories
mkdir -p "$KEY_DIR"
# Generate an RSA key using dropbear
dropbearkey -t rsa -f "${KEY_DIR}/id_rsa"
@visnup
visnup / README.md
Last active Sep 18, 2017
RICOH THETA S live 360º video stream rendering in Chrome via WebGL and a <video> texture
View README.md

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 Oct 15, 2017
Particle Photon + RC522 RFID implant reader
View rfid-node.ino
#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 Feb 20, 2016
Swift Packages by Jaden Geller
View SwiftPackages.md

Dimensional

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)

Calculua

View hue-dash.py
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}