Skip to content

Instantly share code, notes, and snippets.

@boyum
boyum / places.json
Created October 16, 2023 14:26
Norske stedsnavn på `*stein`
[
"Alstein",
"Håstein",
"Store Såstein",
"Havsteinen",
"Feistein",
"Tvistein",
"Leistein",
"Hakkstein",
"Tristein",
@boyum
boyum / script.js
Last active May 30, 2023 12:51
Example JS file
(function() {
const formatNumber = num => num.toString().padStart(2, '0');
const now = new Date();
const hours = formatNumber(now.getHours());
const minutes = formatNumber(now.getMinutes());
const seconds = formatNumber(now.getSeconds());
const time = `${hours}:${minutes}:${seconds}`;
@boyum
boyum / sleepFor.js
Last active January 23, 2019 14:23
Async sleep function in JavaScript
function sleepFor(duration) {
return new Promise(resolve => setTimeout(() => resolve(), duration));
}