This file contains 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(); |
This file contains 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 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 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", | |
}); |
- Generate your key
gpg --full-generate-key
- Export the key, copy the output and add it to github's gpg keys section
gpg --armor --export <key-id>
- Turn on commit signature and set default signing key
Counter: https://100dayscss.com/?dayIndex=31
Gallery v1: https://100dayscss.com/?dayIndex=39
Gallery v2: https://100dayscss.com/?dayIndex=12
Notification: https://100dayscss.com/?dayIndex=25
These are not just side projects but can also be used to get started or level up in web dev. Mostly for beginners to intermediate.
Learn to make something that's useful and secy rather than learn a language for the sake of learning a language.
Side project shouldn't always have to have the goal of being something big or perfect or going into your resume.
- Make a file
~/.oh-my-zsh/custom/themes/geek.zsh-theme
- Copy contents of this file into it.
- Then in
.zshrc
setZSH_THEME="geek"
OlderNewer