Skip to content

Instantly share code, notes, and snippets.

View donatoaz's full-sized avatar

Donato Azevedo donatoaz

  • Belo Horizonte, Brazil
View GitHub Profile
@donatoaz
donatoaz / extract-closure.js
Created May 14, 2018 18:28 — forked from creationix/extract-closure.js
Key extractor that supports nested objects, nested arrays, duplicate keys, and cycles, returning an array of the unique keys.
// All of these should return the keys "a", "b", "c"
var inputs = [
{a:1,b:2,c:3}, // Simple object
{a:{b:2,c:3}}, // Simple object with nesting
{a:{a:{b:2,c:3}}}, // Repeated key hiding nesting
{a:[{b:2,c:3}]}, // keys behind array
];
inputs.push(inputs); // reference cycle and array at top
@donatoaz
donatoaz / Arduino_PN532_NTAG203_dumper.ino
Last active August 28, 2015 15:15 — forked from stonehippo/Arduino_PN532_NTAG203_dumper.ino
Reading out the contents of an NTAG203 NFC tag using an Adafruit PN532 shield for Arduino. This sketch reads and prints to the serial console all 42 pages of memory on the tag.
/*
Dump the memory on a NTAG203 NFC tag using the Adafruit PN532 RFID/NFC Shield
http://www.adafruit.com/products/789
This sketch requires the installation of the Adafruit I2C library for the shield,
which can be found at https://github.com/adafruit/Adafruit_NFCShield_I2C
The datasheet and other info for the NTAG203 can be found at
http://www.nxp.com/products/identification_and_security/smart_label_and_tag_ics/ntag/series/NTAG203.html