Skip to content

Instantly share code, notes, and snippets.

View EntityPlantt's full-sized avatar

Nikola Stojkovski EntityPlantt

View GitHub Profile
@EntityPlantt
EntityPlantt / node-sea.js
Last active February 21, 2024 20:09
Creates a single executable application from a single JS file; see https://nodejs.org/api/single-executable-applications.html
console.log(`Hello! Running Node!!`);
for (var i of [1, 2, 3, 4, 5, 6]) {
console.log("this is an experimental feature");
}
@EntityPlantt
EntityPlantt / rbpfp.js
Last active February 21, 2024 19:56
Hue rotate PFP for your Discord bot
const {execSync: cmd} = require("child_process"), fs = require("fs");
for (var i = 0; i < 200; i += 10) cmd(`magick og.png -modulate 100,100,${(i + 100) % 200} -quality 85% hue${i}.jpg`);
cmd(`convert -delay 5 -loop 0 ${Array(20).fill(0).map((x, i) => `hue${i * 10}.jpg`).join(" ")} final.gif`);
let data = `{"avatar":"data:image/gif;base64,${fs.readFileSync("final.gif").toString("base64")}"}`;
fs.writeFileSync("final.txt", data);
cmd(`cat final.txt | curl -H "Authorization: Bot $(cat auth.txt)" -H "Content-Type: application/json" -X PATCH --data-binary @- https://discord.com/api/users/@me`);