Skip to content

Instantly share code, notes, and snippets.

View rwaldron's full-sized avatar

Rick Waldron rwaldron

  • Boston, MA
View GitHub Profile

Original code:

var func = String.raw
`abc`.split('')
console.log(func); // ['a', 'b', 'c']

Modified to see what's happening:

@rwaldron
rwaldron / v8.md
Created May 31, 2017 20:25 — forked from kevincennis/v8.md
V8 Installation and d8 shell usage

Installing V8 on a Mac

Prerequisites

  • Install Xcode (Avaliable on the Mac App Store)
  • Install Xcode Command Line Tools (Preferences > Downloads)
  • Install depot_tools
    • git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    • sudo nano ~/.bash_profile
    • Add export PATH=/path/to/depot_tools:"$PATH" (it's important that depot_tools comes first here)

In the many years that Johnny-Five has been an active project, there have been myriad requests for hardware peripheral and component device support. Implementing support almost always requires the acquisition of the actual peripheral or component device, in order to adequately develop and test the driver code; most commonly, this involves visiting SparkFun, Adafruit, Amazon, or Digi-Key, and then ordering the necessary "thing". Once in hand, the author sets their own schedule for designing, developing and testing an implementation. Johnny-Five contributors and maintainers will communicate all of these "phases", as they occur, by commenting on the original support request. Eventually, either support will land or it won't (in the past, there was no support for UART devices, this is no longer the case). There are rare cases, including one which we will discuss today, where i

// From device log:
vendor: 0x8087 (32903)
product: 0x0aba (2746)
// From app:
vendorId: 0x8086 (0x8086)
productId: 0xF8A1 (63649)
1479312051787 Device(s) /dev/cu.usbmodem1411
1479312051796 Connected /dev/cu.usbmodem1411
1479312053384 Repl Initialized
>> 0, 1, 1 PASS
1, 1, 1 PASS
2, 1, 1 PASS
3, 1, 1 PASS
4, 1, 1 PASS
5, 1, 1 PASS
6, 1, 1 PASS
@rwaldron
rwaldron / ambient-light-sensor.md
Created November 4, 2016 13:20
Ambient Light Sensor landed in Chromium (this gist is a collection of useful bits I picked out of a w3c email thread)
@rwaldron
rwaldron / full-adder.js
Created October 25, 2016 19:05
Full Adder
let fullAdder = (a, b, c) => [(a ^ b) ^ c, ~(~(a & b) & ~((a ^ b) & c))];
[
{ args: [0, 0, 0], expect: {sum: 0, carry: 0}},
{ args: [0, 0, 1], expect: {sum: 1, carry: 0}},
{ args: [0, 1, 0], expect: {sum: 1, carry: 0}},
{ args: [0, 1, 1], expect: {sum: 0, carry: 1}},
{ args: [1, 0, 0], expect: {sum: 1, carry: 0}},
{ args: [1, 0, 1], expect: {sum: 0, carry: 1}},
{ args: [1, 1, 0], expect: {sum: 0, carry: 1}},
/play
/*.png
/*.bmp
/solitaire
@rwaldron
rwaldron / report.md
Last active April 4, 2017 06:46
Tessel 2: wifi measuring and power demonstration with replacement components Raw
  • Subject Tessels

    • ava: T2 as presently shipping
    • dolores: T2 testing new components
  • Tests

    • Wifi Strength
      • Wifi measuring @ 3m from router (10 measurements)

        | Board | Source | Avg dBm | Avg Quality | | ----- | ------ | ------ | ------ |

@rwaldron
rwaldron / class-mixin-basic.js
Created September 16, 2016 19:55
In a discussion with Kyle Simpson, he offered this as a representation of the basic semantics.
var o = {};
class A extends o { }
// is:
var o = {};
function A() {}
A.prototype = Object.create(o);