This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((cdn) => { | |
const script = document.createElement('script'); | |
script.src = cdn; | |
document.body.appendChild(script); | |
})('https://cdnjs.cloudflare.com/ajax/libs/dayjs/1.8.16/dayjs.min.js') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
docker run --name mongodb --rm -it -p 27017:27017 -v $PWD/data/db:/data/db -e MONGO_INITDB_ROOT_USERNAME=mongoadmin -e MONGO_INITDB_ROOT_PASSWORD=adm12345 -d mongo:4.0.1-xenial |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toMB(sum) { | |
return Math.round((sum*100/1024)*100)/100; | |
} | |
sum = 0; | |
console.log(['Дата', 'Время', 'Сумма по столбцу, ед', 'КБ, где 1 ед = 100 КБ (ед*100)', 'МБ, где 1 МБ = 1024КБ (КБ/1024)', 'Изменение'].join(' ')); | |
document.querySelectorAll('tr').forEach(function(val, i, arr) { | |
if (val.cells[0].innerText.match(/\d{2}\.\d{2}\.\d{2}/i) | |
&& (val.cells[4].innerText === 'Мегабайт' || val.cells[4].innerText === 'Килобайт')) { | |
var lastSum = sum; | |
sum += parseFloat(val.cells[3].innerText); |