Skip to content

Instantly share code, notes, and snippets.

Rick Waldron rwaldron

Block or report user

Report or block rwaldron

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
View gist:9866671
function* asyncIterator() {
let value, done;
while ({value, done} = (yield null), !done) {
console.log("got", value);
}
console.log("done");
}
it = asyncIterator();
it.next();
@probonopd
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., http://download.linino.org/linino_distro/linino_dev/latest/packages/rng-tools_3-2_ar71xx.ipk
# Edit your /etc/opkg.conf, add
src/gz barrier_breaker http://download.linino.org/dogstick/all-in-one/latest/packages/
# Comment out your earlier src/gz
opkg update
opkg list|grep bridge
@ajfisher
ajfisher / firmatatest.js
Last active Jul 18, 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);
return;
}
console.log("Firmata Firing LEDs");
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active Sep 2, 2019
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!
View whiteboardCleaner.md

Description

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:

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

Results

@parshap
parshap / sphero-with-node.md
Last active Dec 28, 2015
Orbotix Sphero with Node.js
View sphero-with-node.md

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
genericallyloud / protocols.md
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.
View protocols.md

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
bmeck / Reading a message.md
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 message.md
  • 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
sgk / patch.ino
Last active Apr 9, 2017
Patch Arduino Yun to disable WiFi
View patch.ino
#include <Process.h>
void setup() {
Bridge.begin();
Serial.begin(9600);
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() {
this.firmata.sendI2CConfig();
var LSM303_CTRL_REG1_A = 0x20
, LSM303_CTRL_REG2_A = 0x21
@dherman
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.