Skip to content

Instantly share code, notes, and snippets.

addWarning(node, regex, message) {
// create regex with a gontext group and insede a date regex group
const pattern = new RegExp('([^.,;\\n]*(' + regex + ')[^.,;\\n]*)', 'ig');
const promises = [];
const warningClass = this.warningClass;
const promisifiedMatchCallback = (match, range) => {
// parse teh date - use just the default parses
const date = new Date(Date.parse(match[2]))
@aljosamrak
aljosamrak / PPD42NS_interrup.ino
Last active May 27, 2020 11:00
Dust Sensor (PPD42NS) pulse width measuring using interrupts
/**
* Dust Sensor (PPD42NS)
* VCC 5V
* GND GND
* SIG D7
*/
// Pin (D7) connected to the dust sensor signal pin
int pin = 13;
volatile unsigned long pulseStartTime; // time of front raising