Skip to content

Instantly share code, notes, and snippets.

View wiedymi's full-sized avatar
:electron:
Working so hard...

Uladzislau Yakauleu wiedymi

:electron:
Working so hard...
View GitHub Profile
@wiedymi
wiedymi / toHours.js
Last active October 3, 2019 13:37
miliseconds to hours with minutes
const toHours = time => {
const hours = new Date(time).getUTCHours()
const minutes = time / 60 / 1000
let showMinutes
if (minutes.toFixed(0) === '60') {
showMinutes = '00'
} else {
if (minutes.toFixed(0).length === 1) {
showMinutes = '0' + minutes.toFixed(0)
@wiedymi
wiedymi / translit.js
Last active January 3, 2020 07:16
Japanese Transliteration For Belarusian Language
/* eslint-disable no-fallthrough */
const JapaneseLatin = {
ba: "ба",
cha: "ця",
da: "да",
ga: "га",
ha: "ха",
ja: "дзя",
ka: "ка",
ma: "ма",
@wiedymi
wiedymi / drive.js
Last active November 15, 2019 13:18
getGoogleDriveEmbedLink From Array Of Shared Links
'use strict'
const fs = require('fs');
function getGoogleDriveEmbedLink(links = ``, nameFile = 'output.txt'){
links = links
.split('\n')
.map(link => link.toString().replace('https://drive.google.com/open?id=',''))
.map(hash => `https://drive.google.com/file/d/${hash}/preview`)
.reduce((output, input, index) => {
return output += `\n${index + 1} | ${input}`;