Skip to content

Instantly share code, notes, and snippets.

View rwaldron's full-sized avatar

Rick Waldron rwaldron

  • Boston, MA
View GitHub Profile
var five = require("../");
var temporal = require('temporal');
var board = new five.Board({
debug: false
});
// Outputs:
// ---
// node testCase.js
import EventEmitter from "events";
let priv = new WeakMap();
let simulatorCoords = [
[40.678178, -73.944158],
[40.678181, -73.943267],
[40.678083, -73.941593],
[40.678034, -73.940649],
];
let index = 0;
var tags = require("common-tags"); // npm install common-tags
var Proximity = {
read: function(which) {
var distance = [Math.round(Math.random() * 20)];
return Promise.resolve(
Object.assign({}, which, { distance })
);
}
};
var blob = new Blob(["onmessage = function(event) { postMessage( event.data ) };"], {
type: "text\/plain"
});
worker = new Worker(
URL.createObjectURL(blob)
);
worker.postMessage("The Blob!");
worker.onmessage = function(event) {

0:
  ■ ■ ■   
■ ■   ■ ■ 
■ ■   ■ ■ 
■ ■   ■ ■ 
■ ■   ■ ■ 
■ ■   ■ ■ 
  ■ ■ ■   

0:

  ■ ■ ■   
■ ■   ■ ■ 
■ ■   ■ ■ 
■ ■   ■ ■ 
■ ■   ■ ■ 
■ ■   ■ ■ 
  ■ ■ ■   
******************************
PSH KERNEL VERSION: b0182727
WR: 20104000
******************************
SCU IPC: 0x800000d0 0xfffce92c
PSH miaHOB version: TNG.B0.VVBD.0000000c
function tag(strings) {
var values = Array.from(arguments).slice(1);
if (Array.isArray(values[0])) {
return tag(strings, values[0].join(""));
}
return strings.reduce((accum, part, index) => {
return accum + part + (values[index] || "");
}, "");
@rwaldron
rwaldron / binding.gyp
Created February 10, 2016 17:04 — forked from bellbind/binding.gyp
[nodejs]Native module with libuv and v8::Promise on node-4
# -*- mode: python -*-
{
"targets": [
{
"include_dirs": ["<!(node -e \"require('nan')\")"],
"target_name": "TimerAndPromise",
"sources": [
"timer-and-promise.cc"
],
"conditions": [
const five = require('johnny-five');
const board = new five.Board();
board.on('ready', () => {
const sensor = new five.Sensor('A4');
const led = new five.Led(5);
sensor.on('change', function() {
// `this` is the sensor instance
led.brightness(this.value >> 2);