Skip to content

Instantly share code, notes, and snippets.

View juangl's full-sized avatar
🐝
Undefined

Juan Je García juangl

🐝
Undefined
View GitHub Profile
@juangl
juangl / aa
Last active June 14, 2025 02:45
/**
* pulse-sniffer.js
* — Detects any pulse on any GPIO pin with pigpio —
*
* • Requires: sudo apt-get install pigpio
* npm i pigpio
* • Start daemon once per boot: sudo pigpiod
*
* Run: sudo node pulse-sniffer.js
*/
import React, { useCallback } from 'react';
type FetchReducerActions<DataT> =
| { type: 'REQUEST_START' }
| { type: 'REQUEST_SUCCESS'; payload: DataT }
| { type: 'REQUEST_ERROR'; error: Error }
| { type: 'FETCH_NEXT_PAGE' }
// use to fetch again after an error
| { type: 'RETRY' };