Skip to content

Instantly share code, notes, and snippets.

View patheticGeek's full-sized avatar
🌚
Being haunted by bugs

Geek patheticGeek

🌚
Being haunted by bugs
View GitHub Profile
@patheticGeek
patheticGeek / deleteAllNodeModules.js
Last active January 10, 2023 20:05
Deletes all node_modules folder in the current dir tree
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();
@patheticGeek
patheticGeek / humanTime.js
Created August 4, 2020 06:19
Converts time from milliseconds to human readable format
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);
@patheticGeek
patheticGeek / contactform.gs
Last active February 27, 2022 18:16
Use google sheet as a contact form
// 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";
@patheticGeek
patheticGeek / bookmarks.md
Last active November 4, 2023 15:23
Some useful things i have in my bookmarks
@patheticGeek
patheticGeek / discordEmojiStealerLite.js
Created April 28, 2021 13:49
Discord Emoji Stealer Lite
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",
});
@patheticGeek
patheticGeek / Setup Github GPG keys.md
Created May 21, 2021 04:44
How to setup git with GPG keys for that green verified mark
  1. Generate your key
gpg --full-generate-key
  1. Export the key, copy the output and add it to github's gpg keys section
gpg --armor --export <key-id>
  1. Turn on commit signature and set default signing key
@patheticGeek
patheticGeek / Css Goodies.md
Last active September 3, 2023 18:16
Some things to work on to get good at styling stuff
@patheticGeek
patheticGeek / webdresources.md
Last active March 10, 2024 20:09
Basically to send to anyone asking for what to do :)

Web dev guide

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.

My rant

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.

Installation

  1. Make a file ~/.oh-my-zsh/custom/themes/geek.zsh-theme
  2. Copy contents of this file into it.
  3. Then in .zshrc set ZSH_THEME="geek"

Preview

Basic