Skip to content

Instantly share code, notes, and snippets.


Rick Waldron rwaldron

View GitHub Profile
View gist:9866671
function* asyncIterator() {
let value, done;
while ({value, done} = (yield null), !done) {
console.log("got", value);
it = asyncIterator();;
probonopd / Arduino Yun (Linino) on OpenWrt
Last active Apr 29, 2019
Install Arduino Yun (Linino) software on OpenWrt on 3rd-party devices. TODO: Fully automate install and/or use Linino rootfs image and/or build own firmware using OpenWrt Image Generator. CAVEATS: I have not yet found out how to make the Bridge use Serial (USB) instead of Serial1 (HardwareSerial) for the Leonardo. I have asked a question about t…
View Arduino Yun (Linino) on OpenWrt
opkg install luci-lib-json luci rng-tools usbutils avrdude avahi-daemon
# If rng-tools is not installable, then install it by hand from e.g.,
# Edit your /etc/opkg.conf, add
src/gz barrier_breaker
# Comment out your earlier src/gz
opkg update
opkg list|grep bridge
ajfisher / firmatatest.js
Last active Dec 22, 2019
Serial comms over hardware UART for Johnny-Five between Arduino and a Raspberry Pi
View firmatatest.js
var firmata = require('firmata');
var repl = require('repl');
var board = new firmata.Board('/dev/ttyAMA0',function(err){
//arduino is ready to communicate
if (err) {
console.log("err:" + err);
console.log("Firmata Firing LEDs");
lelandbatey /
Last active Jul 30, 2020
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!


This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"


parshap /
Last active Dec 28, 2015
Orbotix Sphero with Node.js

Sphero with Node

This document will help you get started with controlling an Orbotix Sphero using Node.js.

Client Libraries

There are several different libraries for controlling the Sphero. Currently, the best one seems to be spheron. This module provides a simple interface to the Sphero API.

There is also CylonJS, but this just uses the spheron module and exposes the same API, so unless you are already using Cylon to control different hardware it probably makes sense to just use spheron directly.

genericallyloud /
Created Oct 21, 2013
A potential solution for doing scoped binding of methods to types using a technique similar to Clojure protocols instead of Ruby refinements.

The following example uses the '::' operator which has a proposal already and a champion on the committee. Other than the bind operator, the example I give uses no new syntax (other than what is new to ES6), and could fairly easily be polyfilled - though I expect it could be optimized if implemented natively. If you haven't seen Clojure protocols, they allow for single dispatch polymorpism based on type, without the methods being defined as part of that type. In clojure, they use the first parameter, but for my proposal, it uses the receiver (this), and uses the bind operator to make the call look similar to a normal method call. While I haven't actually written an implementation of the Protocol class I demonstrate here, I've thought enough about it that I feel it could be done in a few different ways without too much complexity.

 * The following module is a sampling of underscore methods conver
bmeck / Reading a
Created Sep 30, 2013
A romp through time, on how we got our problems written down / ready to be read by a computer.
View Reading a
  • 1940s : "In my day we wrote down our problems"
  • 1950s : "In my day we plugged wires in manually"
  • 1970s : "In my day we read punch cards not "key" boards"
  • 1980s : "In my day we deserialized the baud connections manually"
  • 1990s : "In my day we read a shared key state mask"
  • 2000s : "In my day we listened for when buttons are pressed on the BIOS itself"
  • 2010s : "In my day we read our chars from a buffer"
  • 2020s : "In my day we waited for keys to be pressed"
  • 2030s : "In my day we used to have movies about terminators"
sgk / patch.ino
Last active Apr 9, 2017
Patch Arduino Yun to disable WiFi
View patch.ino
#include <Process.h>
void setup() {
while (!Serial)
Serial.println("Invoking patch script on Yun.");
View i2c.js
var five = require('../lib/johnny-five.js'),
board, button;
board = new five.Board();
board.on("ready", function() {
var LSM303_CTRL_REG1_A = 0x20
, LSM303_CTRL_REG2_A = 0x21
dherman / node.c
Created Jul 18, 2013
A lightweight implementation of node.js
View node.c
#include <stdio.h>
int main() {
int *p = 0;
char line[1024];
printf("> ");
fgets(line, 1024, stdin);
*p = 12;
You can’t perform that action at this time.