Skip to content

Instantly share code, notes, and snippets.

View alexdmejias's full-sized avatar

Alex Mejias alexdmejias

  • Disney Streaming Services
  • New York
View GitHub Profile
@alexdmejias
alexdmejias / README.md
Last active January 30, 2019 20:41
SCRIPT-8
@alexdmejias
alexdmejias / multilple_oled_counter.ino
Created January 7, 2019 04:16
multiple i2c SSD1306 screens using u8x8. Display an increasing number on all of the screens
/*
HelloWorld.ino
"Hello World" version for U8x8 API
Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
Copyright (c) 2016, olikraus@gmail.com
All rights reserved.
#include <Arduino.h>
#include <U8g2lib.h>
#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif
@alexdmejias
alexdmejias / multiple-screens.ino
Created April 30, 2018 03:41
works with three screens. Just have to change line 52
#include <Arduino.h>
#include <U8g2lib.h>
#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif
var Enhance = InnerComponent => class extends React.Component {
render() {
return <InnerComponent {...this.props} data={"wasdwasd"} />;
}
};
// HOC Usage
// import { Enhance } from "./Enhance";
class MyComponent extends React.Component {
render() {
CREATE TABLE IF NOT EXISTS "calendar_dates" (
"service_id" varchar(100),
"date" decimal(10,2),
"exception_type" decimal(10,2)
);
CREATE TABLE IF NOT EXISTS "routes" (
"route_id" int PRIMARY KEY,
"route_short_name" varchar(15),
"route_long_name" varchar(15),
@alexdmejias
alexdmejias / index.js
Created November 7, 2016 21:51
thing to understand the winston logging levels and formatter
const w = require('winston')
const chalk = require('chalk');
w.level = 'silly';
w.error('error log')
w.warn('warn log')
w.info('info log')
w.verbose('verbose log')
w.debug('debug log')
w.silly('silly log')
@alexdmejias
alexdmejias / cli-clock.js
Created July 18, 2016 03:41
Cli-Clock is a clock for your terminal. Once you run the program, it will display the current time on your terminal windo and ti will update every thirty seconds. The clock is formed by two characters, which are choosen from a preselected set of characters or passed as arguments by the user. Once the program starts, the application will measure …
/**
* CLI-CLOCK
*
* Cli-Clock is a clock for your terminal. Once you run the program, it will display the current time on your
* terminal windo and ti will update every thirty seconds. The clock is formed by two characters, which are choosen
* from a preselected set of characters or passed as arguments by the user. Once the program starts, the application will
* measure the size of the current terminal window and display the time in the center of the window.
*
* Example usage:
*
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "Wire.h"
extern "C" {
#include "utility/twi.h" // from Wire library, so we can do bus scanning
}
#define TCAADDR 0x70
void tcaselect(uint8_t i) {
#include "Wire.h"
extern "C" {
#include "utility/twi.h" // from Wire library, so we can do bus scanning
}
#define TCAADDR 0x70
void tcaselect(uint8_t i) {
if (i > 7) return;