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 / find_usb_mass_storage.py
Created Jul 25, 2019
Find USB mass storage devices with Python.
View find_usb_mass_storage.py
import usb.core
import usb.util
from usb.legacy import CLASS_MASS_STORAGE
class find_class(object):
def __init__(self, class_):
self._class = class_
def __call__(self, device):
if device.bDeviceClass == self._class:
@jmptable
jmptable / digikey-copy-part-number.js
Last active Jun 19, 2019
Bookmarklets for more efficient use of Digikey.
View digikey-copy-part-number.js
// Copy part number from page to clipboard
javascript: const copyTextarea=document.createElement('textarea');document.body.appendChild(copyTextarea),copyTextarea.value=document.getElementById('reportPartNumber').innerHTML.trim().split(/\s/).reverse()[0];copyTextarea.select(),setTimeout(function(){document.body.removeChild(copyTextarea)});try{var successful=document.execCommand('copy');console.log(successful)}catch(a){console.log('Oops, unable to copy Digikey part number to clipboard')}
@jmptable
jmptable / processInbox.js
Created Jun 14, 2019
Google App Script to apply an "Events" label to emails in GMail sent via Google Calendar.
View processInbox.js
// Based on https://webapps.stackexchange.com/a/73544
function threadHasLabel(thread, labelName) {
var existingLabels = thread.getLabels();
for (var i = 0; i < existingLabels.length; i++) {
if (existingLabels[i].getName() === labelName) {
return true;
}
}
@jmptable
jmptable / plasma_palette.cpp
Created Jun 9, 2019
Simple continuous palette for classic plasma effect.
View plasma_palette.cpp
// Technique from https://lodev.org/cgtutor/plasma.html
typedef struct {
float r;
float g;
float b;
} RGBColor;
typedef struct {
float h;
@jmptable
jmptable / millable-pcbs.md
Created Jun 4, 2019
Millable PCB settings
View millable-pcbs.md

Targeting 1/32in flat end mill:

Pads:

  • 1.7mm size X
  • 1 mm hole diameter
@jmptable
jmptable / python-dev-tools.md
Last active Jun 27, 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
You can’t perform that action at this time.