Skip to content

Instantly share code, notes, and snippets.

View brannondorsey's full-sized avatar
📡
Makin' the net work

Brannon Dorsey brannondorsey

📡
Makin' the net work
View GitHub Profile
@brannondorsey
brannondorsey / gist:21efaefca9708549996f
Created December 5, 2015 22:53
2014-01-25-kinect Ubuntu

2014-01-25-kinect Ubuntu

  • Installation notes for Ubuntu Desktop LTS 12.04 Precise.

  • NOTE: All code is installed to ~/Developer/Work

Install Updates

@brannondorsey
brannondorsey / gist:5711072
Created June 5, 2013 01:46
Trying to figure out why this isn't noticing the differences between the current frame and the previous. It seems like the assignment on line 36 isn't doing its job properly.
void testApp::setSequences(){
int pixelThreshold = 20; //percent similarity each individual pixel needs to pass
int imgPercentNeededToPass = 80; //percent of pixels that must pass threshold test
int checkEveryIncrement = 10; //number of pixels before next pixel comparison
int maxPixDiffToPass = (pixelThreshold*255)/100; //converts percent to a max pixel change value
vector<long> cutFrames;
myVideo.setFrame(1);
ofPixelsRef prevPixelsRef = myVideo.getPixelsRef();
@brannondorsey
brannondorsey / genId.js
Created April 9, 2016 19:50
Javascript Generate random base60 ID
function genId(len) {
var chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ23456789'.split('');
var id = '';
for (var i = 0; i < len; i++) {
var index = Math.floor(Math.random() * chars.length);
id += chars[index];
}
@brannondorsey
brannondorsey / image_fit.cpp
Created May 5, 2016 02:14
Fit Image/video to app window (using OpenFrameworks)
float width = ofGetWidth();
float height = ofGetHeight();
float aspect = width / height;
// horizontal black bars
if (aspect <= player.getWidth()/player.getHeight()) {
float vHeight = (player.getHeight() * width) / player.getWidth();
player.draw(0,
(height - vHeight) * 0.5,
width,

#Making Persistent Live USBs is Harder Than it Should Be 9/14/2016

What used to be easy with Ubuntu's Starup Disk Creator (usb-creator-common + usb-creator-gtk) is now a lot harder than it should be on UEFI systems. Some version before v0.2.66 have a bug that allows you to specify live usb persistence, however it doesn't actually work. Versions > 0.3 have removed this functionality completely (wtf!).

An alternative that worked for me was using mkusb from an installed Ubuntu distro (I could not get this to work creating live USBs from live USBs).

Steps on Ubuntu 16.06 include:

@brannondorsey
brannondorsey / sch_ml_research.md
Last active November 14, 2016 23:25
Research into using machine learning to generate .sch files.

Procuring large schematic dataset

Use GitHub API to batch download .sch files.

  1. GitHub API requires you to limit searches to users, orgs, or repos. So we first have to get a list of repos that use the KiCad or EAGLE "languages".
https://api.github.com/search/repositories?q=language:kicad&per_page=100&page=1
https://api.github.com/search/repositories?q=language:eagle&per_page=100&page=1

Keybase proof

I hereby claim:

  • I am brannondorsey on github.
  • I am brannondorsey (https://keybase.io/brannondorsey) on keybase.
  • I have a public key whose fingerprint is 1A0F 6E80 D1CC 2F45 6EB9 1FD7 8E0D 2D73 A603 FE9A

To claim this, I am signing this object:

@brannondorsey
brannondorsey / getSelected.js
Last active March 8, 2017 00:33
Get the selected data in Tensorboard embedding projector to the dev console
// copy and paste the following snippet into the developer's console
function getSelected() {
query_selector = '.label.style-scope.vz-projector-inspector-panel.style'
+ '-scope.vz-projector-inspector-panel.style-scope.vz-projector'
+ '-inspector-panel.style-scope.vz-projector-inspector-panel'
items = document.querySelectorAll(query_selector)
names = []
items.forEach(item => {
if (item.childNodes[0].textContent) {
@brannondorsey
brannondorsey / ml4music-quickstart.md
Created April 23, 2017 15:22
Quick start guide for the ml4music-workshop

ml4music workshop quickstart

  1. Download and install Docker: MacOS | Windows | Linux
  2. Clone the ml4music-workshop repo
git clone https://github.com/brannondorsey/ml4music-workshop
  1. Attach to the workshop docker container
cd ml4music-workshop
@brannondorsey
brannondorsey / log.py
Last active May 10, 2017 17:15
Simply Python Logger
# Copyright (c) 2017 Brannon Dorsey
# 2017 Branger Briz, Inc
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#