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 / 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 / bookmarks.md
Last active January 18, 2025 07:48
Some useful things i have in my bookmarks
@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 / 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 / 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();