Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jnelson on github.
  • I am jnelson (https://keybase.io/jnelson) on keybase.
  • I have a public key whose fingerprint is 33EB B93B 7AFC 03CD A160 892D 5617 FB55 3A60 7B4F

To claim this, I am signing this object:

@jnelson
jnelson / ttyUSB_demystify.sh
Last active August 29, 2015 13:59
A horribly fragile script to collate identifying information for ttyUSB devices. Ad hoc testing on Ubuntu. Please don't use this unless you agree to: (1) Hold me blameless and harmless for anything that goes wrong, AND (2) Share colorful stories about what went wrong in a comment.
#!/bin/bash
# Reminder: don't use this.
candidates=`ls /dev | grep ttyUSB`
for targetDevice in $candidates
do
majMinDevNums=`cat /sys/class/tty/$targetDevice/dev`
infoLink=`ls -l /sys/dev/char/$majMinDevNums | awk '{print $NF}' | grep -oP '../../\K.*'`
infoDir=`echo /sys/$infoLink | perl -pe "s|(.*)/[\d-:.]+/$targetDevice/.*|\1|"`
@jnelson
jnelson / immersionWindow.js
Last active December 19, 2015 10:09
Adds a crude windowing control to https://immersion.media.mit.edu/viz. Just paste this into the console after the visualization is running and press enter. Adjust the STEPS count for more or less granularity.
// Adds a crude windowing control to https://immersion.media.mit.edu/viz
// Just paste into the console after the visualization is running and
// press enter.
(function ($) {
$('<div>').attr({id: 'slider-window'}).appendTo('#centercolumn');
var STEPS = 16;
var $windower = $('#slider-window');
var $ranger = $('#slider-range');