Skip to content

Instantly share code, notes, and snippets.

View matyus's full-sized avatar
🐢
coding slowly

Michael Matyus matyus

🐢
coding slowly
View GitHub Profile
@dillansimmons
dillansimmons / cost.mjs
Last active September 21, 2021 19:12
Calculate cost to upload folder in ETH
/* eslint-disable no-console */
import getFolderSize from 'get-folder-size';
async function checkCost() {
const myFolder = 'dist'; // your prod assets folder: can be folder or zip file
const size = await getFolderSize.loose(myFolder);
console.log(`The project is ${size} bytes large`);
console.log(`Cost: ${675 * size * 10 * (1 / 1000000000)}Eth at 10Gwei`);
console.log(`Cost: ${675 * size * 50 * (1 / 1000000000)}Eth at 50Gwei`);
@dillansimmons
dillansimmons / package.json
Last active September 21, 2021 19:12
Use puppeteer to take multiple screenshots of project
{
"name": "mock package.json project",
...
"scripts": {
"screenshots": "node screenshots.mjs"
},
...
"devDependencies": {
"puppeteer": "^10.1.0"
}