Skip to content

Instantly share code, notes, and snippets.

View greghesp's full-sized avatar
🖐️

Greg Hesp greghesp

🖐️
View GitHub Profile
#include <Adafruit_MAX31865.h>
// Use software SPI: CS, DI, DO, CLK
//Adafruit_MAX31865 thermo = Adafruit_MAX31865(3, 2, 1, 0);
// use hardware SPI, just pass in the CS pin
Adafruit_MAX31865 thermo = Adafruit_MAX31865(D1,D2,D3,D4);
// The value of the Rref resistor. Use 430.0 for PT100 and 4300.0 for PT1000
#define RREF 430.0
// The 'nominal' 0-degrees-C resistance of the sensorS
@greghesp
greghesp / functions.js
Last active August 1, 2019 08:27
Using Custom Email Templates with Firebase Authentication
exports.verifyEmail = functions.auth.user().onCreate(async(user) => {
try {
const token = crypto.randomBytes(48);
await admin.firestore().collection("users").doc(user.uid).set({
name: user.displayName,
});
await admin.firestore().collection("activationTokens").doc(user.uid).set({
token: token.toString('hex'),
expires: Date.now() + ( 3600 * 1000 * 24)
});