Skip to content

Instantly share code, notes, and snippets.

Owen Trueblood jmptable

Block or report user

Report or block jmptable

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jmptable
jmptable / python-dev-tools.md
Last active May 21, 2019
Tools for writing robust Python.
View python-dev-tools.md
@jmptable
jmptable / bulbs.csv
Last active May 9, 2019
For STEAMplant LED bulb display.
View bulbs.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
esp-pratt26a4b9.local
esp-pratt26a4c0.local
esp-pratt4eaa88.local
esp-pratt269fac.local
esp-pratt4eaa82.local
esp-pratt26a4b7.local
esp-pratt4eacd1.local
esp-pratt26a4ed.local
esp-pratt4ea9fc.local
esp-pratt4eaaad.local
@jmptable
jmptable / capture_tracker.py
Created Apr 10, 2019
Capture Vive Tracker pose with OpenVR in Python.
View capture_tracker.py
import sys
import time
import openvr
openvr.init(openvr.VRApplication_Scene)
poses_t = openvr.TrackedDevicePose_t * openvr.k_unMaxTrackedDeviceCount
poses = poses_t()
def get_tracker_index():
@jmptable
jmptable / Clicker.java
Created Mar 20, 2019
Can't type the date on this calendar widget. Have to click through the months. So I made this to automate the clicking.
View Clicker.java
import java.awt.*;
import java.awt.event.InputEvent;
class Clicker {
public static void click() throws AWTException {
Robot bot = new Robot();
bot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
bot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
}
View capture_photos.py
#!/usr/bin/env python3
import sys
import os
import math
import re
import socket
import pystache
import serial
from time import sleep
@jmptable
jmptable / active_low_io.ino
Created Mar 2, 2019
Illustrating how to handle active-low inputs with pull-up resistors from an Arduino.
View active_low_io.ino
void activate(int pin) {
// Sink current on the pin, activating it
digitalWrite(pin, LOW);
pinMode(pin, OUTPUT);
}
void deactivate(int pin) {
// Set the pin high impedance (~disconnected)
pinMode(pin, INPUT);
@jmptable
jmptable / renderEmbroideryDST.pde
Created Feb 14, 2019
Loads and renders a DST file for embroidery machine designs
View renderEmbroideryDST.pde
// Loads and renders a DST file for embroidery machine designs
// Format specification derived from https://github.com/Embroidermodder/libembroidery
import java.util.*;
import java.io.*;
byte[] designData;
PImage designImage;
void setup() {
@jmptable
jmptable / renderNeuralMorphology.pde
Created Feb 14, 2019
Load and render neural morphology in 3D from brain-map.org
View renderNeuralMorphology.pde
// This code renders neural morphology from an SWC file
// For example: http://celltypes.brain-map.org/experiment/morphology/474626527
// Download others from http://celltypes.brain-map.org using "Download morphology"
import java.util.*;
import peasy.*;
PeasyCam cam;
Vector<Neuron> neurons;
@jmptable
jmptable / deep_equals.lua
Created Jan 21, 2019
Deeply compare Lua values.
View deep_equals.lua
function table_keys(...)
local keys = {}
for i, t in ipairs(arg) do
for k, v in pairs(t) do
keys[k] = true
end
end
return keys
@jmptable
jmptable / i386-chroot.sh
Last active Jan 21, 2019
Run programs from another architecture by chrooting into a fresh Debian root filesystem and running a shell with Qemu.
View i386-chroot.sh
#!/bin/bash
# Q: Why would you want to do this?
# A: You have something compiled for i386 that you want to run on an ARM embedded system (say, a Raspberry Pi)
# and you want to avoid the overhead of running a full system emulation.
apt-get install binfmt-support qemu qemu-user-static debootstrap
# Create a directory to serve as our alt root
mkdir i386-root
You can’t perform that action at this time.