This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--MQTT params | |
local mqtt_settings = { | |
module = "ESP8266_"..node.chipid(), | |
ip = "<brokerip>", | |
port = 1883, | |
token = "tokendevice" | |
} | |
-- local pins data | |
local gpio_pins = { | |
{pin = 0, value = "false"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local conf = nil | |
if file.open("config.txt") then | |
conf = file.read() | |
conf = sjson.decode(conf) | |
file.close() | |
end | |
local cfg = { | |
ip = conf.ip, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import re | |
from decimal import Decimal | |
import math | |
import time | |
import serial | |
class FormatNMEA(object): | |
@staticmethod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import RPi.GPIO as GPIO | |
import time | |
import sys | |
import signal | |
GPIO.setmode(GPIO.BCM) | |
DOOR_SENSOR_PIN = 18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- send temperature telemetry (Thingsboard.io) | |
-- require module DS18B20 for temp | |
local DS18B20 = require "ds18b20" | |
-- ESP8266 pin | |
local TEMP_PIN = 2 | |
-- setup DS18B20 | |
DS18B20.setup(TEMP_PIN) | |
-- flag connected | |
local connected = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* let c = new MyClass(); | |
* c.foo(); | |
* let d = new MyClass(); | |
* d.foo(); | |
*/ | |
(() => { | |
let instance; | |
// global | |
window.MyClass = function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HelloForm extends React.Component { | |
state = { | |
credentials: { | |
email: '', | |
pwd: '' | |
} | |
} | |
// input change value (login form) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Private router | |
* @author: Aderbal Nunes <[email protected]> | |
*/ | |
import React from "react"; | |
import {Route, Redirect} from 'react-router-dom'; | |
// my session manager component | |
import session from './session'; | |
function PrivateRouter({component: Component, ...rest}){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Checklist selector with Material-UI | |
* @author: Aderbal Nunes <[email protected]> | |
* @since: 02/11/2019 | |
* | |
* usage: | |
* <MyChecklist | |
* list={[ | |
* {label: 'Foo', isChecked: false, id: 23}, | |
* {label: 'Bar', isChecked: false, id: 44}, |
OlderNewer