Skip to content

Instantly share code, notes, and snippets.

View zrecore's full-sized avatar
🌯
Señor Full-stack Engineer

Alex Albino zrecore

🌯
Señor Full-stack Engineer
View GitHub Profile
@zrecore
zrecore / libftdi.rb
Created May 21, 2020 07:22
MacOS: configure brew install of libftdi to also include ftdi_eeprom utility
# Configure brew install libftdi to also include ftdi_eeprom
class Libftdi < Formula
desc "Library to talk to FTDI chips"
homepage "https://www.intra2net.com/en/developer/libftdi"
url "https://www.intra2net.com/en/developer/libftdi/download/libftdi1-1.4.tar.bz2"
sha256 "ec36fb49080f834690c24008328a5ef42d3cf584ef4060f3a35aa4681cb31b74"
revision 2
bottle do
cellar :any
@zrecore
zrecore / BLE_uart_packet_test.ino
Created August 16, 2019 00:36
Sampe arduino sketch for "FemtoBeacon ESP32" coin (Arduino ESP32)
/*
Video: https://www.youtube.com/watch?v=oCMOYS71NIU
Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleNotify.cpp
Ported to Arduino ESP32 by Evandro Copercini
Create a BLE server that, once we receive a connection, will send periodic notifications.
The service advertises itself as: 6E400001-B5A3-F393-E0A9-E50E24DCCA9E
Has a characteristic of: 6E400002-B5A3-F393-E0A9-E50E24DCCA9E - used for receiving data with "WRITE"
Has a characteristic of: 6E400003-B5A3-F393-E0A9-E50E24DCCA9E - used to send data with "NOTIFY"
@zrecore
zrecore / example-array-flatten.js
Created August 8, 2017 06:45
Flatten an array.
/*
Application Description:
Write some code, that will flatten an array of arbitrarily nested arrays of integers into a flat array of integers.
e.g. [[1,2,[3]],4] -> [1,2,3,4].
Your solution should be a link to a gist on gist.github.com with your implementation.
When writing this code, you can use any language you're comfortable with. The code must be well tested and documented if necessary, and in general please treat the quality of the code as if it was ready to ship to production.
Try to avoid using language defined methods like Ruby's Array#flatten
@zrecore
zrecore / jquery.tableSort.js
Created October 13, 2010 17:29
Converts tables into sortable tables that connects to JSON data.
/**
* @copyright Copyrights 2010 ZRECommerce.
* @licence GPL v3 or higher. See http://www.gnu.org/licenses/gpl.html
*/
(function($){
$.fn.tableSort = function(settings) {
var config = {
'pageIndex' : 1, // What page to request
'rowCount' : 30, // How may results per page
'sort' : null, // Sort by this column