Skip to content

Instantly share code, notes, and snippets.

View clavisound's full-sized avatar
🏠
Working from home

clavisound

🏠
Working from home
View GitHub Profile
@clavisound
clavisound / formatDuration_seconds.js
Last active July 28, 2025 17:30 — forked from zourdyzou/formatDuration.js
formatting a duration (in millisecond) to human readable format using javascript
const formatDuration = s => {
if (s < 0) s = -s;
const time = {
day: Math.floor(s / 86400),
hour: Math.floor(s / 3600) % 24,
minute: Math.floor(s / 60) % 60,
second: Math.floor(s) % 60
};
return Object.entries(time)
.filter(val => val[1] !== 0)
@clavisound
clavisound / dfrobot-l76k-i2c-hdop.ino
Last active July 24, 2024 19:16
Reading HDOP from NMEA GGA sentence via callback
/*!
* based on getAllGNSS.ino
* Added some code to read HDOP value.
* Clavisound jul 24
* @brief read all gnss data
* @copyright Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
* @license The MIT License (MIT)
* @author ZhixinLiu([email protected])
* @version V1.0
* @date 2023-03-07