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
| let emojis = new Set() | |
| let images = $0.querySelectorAll('img') | |
| function downloadPng({ url, name }) { | |
| return new Promise(resolve => { | |
| const xhr = new XMLHttpRequest(); | |
| xhr.onload = () => { | |
| const file = new Blob([xhr.response], { | |
| type: "image/png", | |
| }); |
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
| // original from: http://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/ | |
| // original gist: https://gist.github.com/willpatera/ee41ae374d3c9839c2d6 | |
| function doGet(e){ | |
| return handleResponse(e); | |
| } | |
| // Enter sheet name where data is to be written below | |
| var SHEET_NAME = "Sheet1"; |
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 humanTime(ms) { | |
| let seconds = ms / 1000; | |
| let result = ""; | |
| const days = Math.floor((seconds % 31536000) / 86400); | |
| if (days > 0) result += `${days}d `; | |
| const hours = Math.floor(((seconds % 31536000) % 86400) / 3600); | |
| if (hours > 0) result += `${hours}h `; | |
| const minutes = Math.floor((((seconds % 31536000) % 86400) % 3600) / 60); | |
| if (minutes > 0) result += `${minutes}m `; | |
| seconds = ((((seconds % 31536000) % 86400) % 3600) % 60).toFixed(0); |
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
| const fs = require('fs'); | |
| function deleteNodeModules(path) { | |
| try { | |
| const contents = fs.readdirSync(path, { withFileTypes: true }); | |
| contents.forEach(val => { | |
| const name = val.name; | |
| const isDir = val.isDirectory(); | |
| const isFile = val.isFile(); |
NewerOlder