Skip to content

Instantly share code, notes, and snippets.

View donatoaz's full-sized avatar

Donato Azevedo donatoaz

  • Belo Horizonte, Brazil
View GitHub Profile
# frozen_string_literal: true
# Use this template to report PaperTrail bugs.
# Please include only the minimum code necessary to reproduce your issue.
require "bundler/inline"
# STEP ONE: What versions are you using?
gemfile(true) do
ruby "2.5.1"
source "https://rubygems.org"
@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
# Simple gist to get Erlang+Elixr+Phoenix up and running quick on cloud9
# kudos do @oxyrus, for the medium post
# https://medium.com/@Oxyrus/how-to-install-the-phoenix-framework-on-cloud9-ef0ac265229c
# apparently this is required so as not to fail in some part of the install
sudo touch /etc/init.d/couchdb
# add the erlang solutions repo
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get -y update
# install elixir from the previously added repo
@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