Skip to content

Instantly share code, notes, and snippets.

View A-D-E-A's full-sized avatar
🗿

Adam Dimitry Enzo Ambrosino A-D-E-A

🗿
  • Aberia
  • France
  • 12:34 (UTC +02:00)
View GitHub Profile
@A-D-E-A
A-D-E-A / msToDuration.js
Created January 12, 2022 13:26
Convert milliseconds to a formatted duration string [Javascript].
/**
* Creates a duration string from a number of milliseconds.
*
* Example:
* ```js
* const dateA = new Date("2022-01-01T12:55:02");
* const dateB = new Date("2022-01-08T15:00:00");
* const msDuration = nowDate - someOlderDate;
* const str = msToDuration(msDuration);
* console.log(str); // "7 d 02 h 04 m 58 s"
@A-D-E-A
A-D-E-A / gource_multirepo.sh
Created April 16, 2021 07:54
Gource over multiple projects
#!/bin/bash
# Gource over all repos.
declare -A paths # Associative array
paths[project1]="/your/path/to/p1"
paths[project2]="/your/path/to/p2"
#...
files=''