Skip to content

Instantly share code, notes, and snippets.

@jbinkleyj
jbinkleyj / centroidtracker.py
Created April 25, 2020 14:07 — forked from adioshun/centroidtracker.py
Simple object tracking with OpenCV
# https://www.pyimagesearch.com/2018/07/23/simple-object-tracking-with-opencv/
# import the necessary packages
from scipy.spatial import distance as dist
from collections import OrderedDict
import numpy as np
class CentroidTracker():
def __init__(self, maxDisappeared=50):
# initialize the next unique object ID along with two ordered
@jbinkleyj
jbinkleyj / auto_git_query
Created April 2, 2020 23:50 — forked from nullenc0de/auto_git_query
Automated Github Queries (Can open 29 tabs at a time)
https://github.com/search?q=BROWSER_STACK_ACCESS_KEY= OR BROWSER_STACK_USERNAME= OR browserConnectionEnabled= OR BROWSERSTACK_ACCESS_KEY=&s=indexed&type=Code
https://github.com/search?q=CHROME_CLIENT_SECRET= OR CHROME_EXTENSION_ID= OR CHROME_REFRESH_TOKEN= OR CI_DEPLOY_PASSWORD= OR CI_DEPLOY_USER=&s=indexed&type=Code
https://github.com/search?q=CLOUDAMQP_URL= OR CLOUDANT_APPLIANCE_DATABASE= OR CLOUDANT_ARCHIVED_DATABASE= OR CLOUDANT_AUDITED_DATABASE=&s=indexed&type=Code
https://github.com/search?q=CLOUDANT_ORDER_DATABASE= OR CLOUDANT_PARSED_DATABASE= OR CLOUDANT_PASSWORD= OR CLOUDANT_PROCESSED_DATABASE=&s=indexed&type=Code
https://github.com/search?q=CONTENTFUL_PHP_MANAGEMENT_TEST_TOKEN= OR CONTENTFUL_TEST_ORG_CMA_TOKEN= OR CONTENTFUL_V2_ACCESS_TOKEN=&s=indexed&type=Code
https://github.com/search?q=-DSELION_BROWSER_RUN_HEADLESS= OR -DSELION_DOWNLOAD_DEPENDENCIES= OR -DSELION_SELENIUM_RUN_LOCALLY=&s=indexed&type=Code
https://github.com/search?q=ELASTICSEARCH_PASSWORD= OR ELASTICSEARCH_USERNAME= OR EMAIL_NOTIFI
#!usr/bin/python3
"""
Created on Mon Sep 4 15:06:35 2017
@author: Michy
"""
import os
import praw
@jbinkleyj
jbinkleyj / dwg_to_pdf_printing_bot.py
Created January 13, 2020 00:36 — forked from mick001/dwg_to_pdf_printing_bot.py
Dwg to pdf printing bot.
# Imports
import os
import sys
import time
import psutil
import logging
import pyautogui as pgui
from datetime import datetime
@jbinkleyj
jbinkleyj / DC_motor.m
Created January 13, 2020 00:36 — forked from mick001/DC_motor.m
Matlab state space model simulation of a DC motor
% Motor params
R = 5.5; % [Ohm]
L = 0.0028; % [H]
phi = 0.5; % [Wb]
k = 1; % []
J = 0.5; % [kg m^2]
Cr = 0.1; % [Nm] Assumed Cr constant.
V = 24; % [V] Nominal voltage
% Building the system
@jbinkleyj
jbinkleyj / balancing_ball_beam.m
Created January 13, 2020 00:36 — forked from mick001/balancing_ball_beam.m
Balancing a ball on a beam article code.
k = -7.0071;
s = tf('s');
G = k/s^2;
% PD controller
R = -(0.38 + 0.5*50/(1+50/s));
% Design a PD controller for the unit feedback loop
L = series(R,G);
sys = feedback(L, 1);
import math
import numpy as np
import matplotlib.pyplot as plt
import pylab
import os
# this is optional, if you want to save pictures of the trajectory
# later, then choose a folder where to save images
os.chdir("path")
@jbinkleyj
jbinkleyj / index.html
Created August 23, 2018 14:46 — forked from nolanlawson/index.html
Test polymorphism
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Test polymorphism</title>
</head>
<body>
<h1>Test polymorphism</h1>
@jbinkleyj
jbinkleyj / protips.js
Created February 16, 2018 15:11 — forked from nolanlawson/protips.js
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.