This file contains hidden or 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 "Arduino.h" | |
#define NOTE_B0 31 | |
#define NOTE_C1 33 | |
#define NOTE_CS1 35 | |
#define NOTE_D1 37 | |
#define NOTE_DS1 39 | |
#define NOTE_E1 41 | |
#define NOTE_F1 44 |
This file contains hidden or 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 "Arduino.h" | |
#include "Audio.h" | |
#include "SD.h" | |
#include "FS.h" | |
#define SD_CS 5 | |
#define SPI_MOSI 23 | |
#define SPI_MISO 19 | |
#define SPI_SCK 18 |
This file contains hidden or 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 <LoRa.h> | |
#include <SPI.h> | |
#define ss 5 | |
#define rst 14 | |
#define dio0 4 | |
int SWITCH_PIN = 15; | |
int LED_PIN = 2; |
This file contains hidden or 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 <LoRa.h> | |
#include <SPI.h> | |
#define ss 5 | |
#define rst 14 | |
#define dio0 4 | |
int SWITCH_PIN = 15; | |
int LED_PIN = 2; |
This file contains hidden or 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
#define analogIn A0 | |
#define analogLEDRawOut 6 | |
#define digitalIn 8 | |
#define digitalLEDOut 13 | |
void setup() { | |
Serial.begin(9600); | |
pinMode(analogLEDRawOut, OUTPUT); |
This file contains hidden or 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
const fs = require("fs"); | |
require("dotenv").config(); | |
const startingNumber = process.env.STARTINGNUMBER; | |
const fileName = "5000contacts.csv"; | |
const csvHeader = | |
"Name,Given Name,Additional Name,Family Name,Yomi Name,Given Name Yomi,Additional Name Yomi,Family Name Yomi,Name Prefix,Name Suffix,Initials,Nickname,Short Name,Maiden Name,Birthday,Gender,Location,Billing Information,Directory Server,Mileage,Occupation,Hobby,Sensitivity,Priority,Subject,Notes,Language,Photo,Group Membership,Phone 1 - Type,Phone 1 - Value"; | |
fs.appendFileSync(fileName, csvHeader + "\n"); |
This file contains hidden or 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
/* | |
* A lens cap. | |
* Units in mm, default values are for | |
* a PENTACON auto 2.8/135 MC lens. | |
* | |
* 2021, Joris La Cancellera | |
* License: CC-BY-SA | |
* | |
*/ | |
This file contains hidden or 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
const { InfluxDB, FluxTableMetaData } = require('@influxdata/influxdb-client') | |
let client = new InfluxDB({ url: 'http://localhost:9999', token: process.env.INFLUXDB_TOKEN }); | |
const writeApi = client.getWriteApi(process.env.INFLUXDB_ORG, process.env.INFLUXDB_BUCKET); | |
//... | |
let offlineSince = (lastSeenDate === null) ? 0 : ((new Date().getTime() - lastSeenDate.getTime()) / 1000).toFixed(0); | |
if (offlineSince < 0) | |
offlineSince = 0; |
This file contains hidden or 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
const chrono = require('chrono-node'); | |
// ... | |
let status = await statusElt.evaluate(x => x.textContent); // `last seen today at 13:15` format. | |
let lastSeenDate = chrono.parseDate(status); | |
// ... |
This file contains hidden or 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
const puppeteer = require('puppeteer'); | |
// The contact name to track (mind the case). | |
const contactTarget = "Jean-Mich"; | |
(async () => { | |
const browser = await puppeteer.launch({ | |
headless: false, // No headless to scan the QR code. | |
userDataDir: 'data/userdata' // Persist the session. | |
}); |