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
#include <OneWire.h> | |
int Temp_Pin = 2; | |
int outputPins[] = {10, 11, 12}; | |
OneWire ds(Temp_Pin); | |
void setup() { | |
Serial.begin(9600); | |
for (int i = 0; i < 3; i++) { |
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
#include <OneWire.h> | |
/** | |
* Get temperature | |
* And communicate through zbee S1 | |
* On Arduino Leonardo | |
*/ | |
int Temp_Pin = 2; | |
int outputPins[] = {10, 11, 12}; |
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
var SerialPort = require('serialport'); | |
const Readline = SerialPort.parsers.Readline; | |
try { | |
var port = new SerialPort('/dev/ttyUSB0'); // default port for Zbee Explorer | |
// As I sent line separation message | |
const parser = new Readline(); | |
port.pipe(parser); |
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
var awsIot = require('aws-iot-device-sdk'); | |
var device = awsIot.device({ | |
keyPath: "./private.key", | |
certPath: "./cert.pem", | |
caPath: "./root-CA.crt", | |
clientId: "name-of-thing", | |
host: "https-endpoint", | |
}); |
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
'use strict'; | |
const v4 = require('aws-signature-v4'); | |
const crypto = require('crypto'); | |
exports.handler = (event, context, callback) => { | |
const url = v4.createPresignedURL( | |
'GET', | |
process.env.IOT_ENDPOINT_HOST.toLowerCase(), | |
'/mqtt', |
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
import mqtt from 'mqtt'; | |
export function mqclient(options) { | |
return new Promise((resolve, reject) => { | |
fetch('https://your-lambda-endpoint', { | |
method: 'get' | |
}).then((response) => { | |
const client = mqtt.connect(response.body.url, options); | |
resolve(client); | |
}).catch(err => reject(err)); |
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
function (user, context, callback) { | |
var namespace = 'your_domain'; | |
context.idToken[namespace + 'app_metadata'] = user.app_metadata; | |
context.idToken[namespace + 'user_metadata'] = user.user_metadata; | |
callback(null, user, context); | |
} |
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
import React, { Component } from 'react'; | |
import HighCharts from 'highcharts'; | |
export default class Chart extends Component { | |
componentDidMount() { | |
if (this.props.modules) { | |
this.props.modules.forEach(module => { | |
module(HighCharts); | |
}); | |
} |
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
package model | |
import ( | |
"net/http" | |
"time" | |
"github.com/mholt/binding" | |
"gopkg.in/mgo.v2/bson" | |
) |
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
package db | |
import ( | |
"errors" | |
"gopkg.in/mgo.v2" | |
) | |
/* | |
Mongo construction |
OlderNewer