Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am 182exe on github.
  • I am 182exe (https://keybase.io/182exe) on keybase.
  • I have a public key ASDldZMb4Yd0-wXz4fMFuhVIvMx06SOuCvFD5M1ClwDO8Ao

To claim this, I am signing this object:

@182exe
182exe / git-email-scraping.md
Last active October 14, 2024 00:36
some commands to use to extract emails from git logs

git log email scraping

You can get all of the emails from contributors to a git log without any trouble.

  1. clone a repo into a folder
  2. open your terminal of choice to the folder
  3. run your command

unix/linux/macos

git log | grep @ | cut -d' ' -f3 | tr -d '><'
// thanks to gapple.pw for the very well made docs (https://mojang-api-docs.gapple.pw/)
// thanks to wiki.vg for teaching me microsoft auth scheme (https://wiki.vg/Microsoft_Authentication_Scheme)
const axios = require(`axios`)
async function getUsernameAndUUID(bearerToken) {
try {
const url = 'https://api.minecraftservices.com/minecraft/profile';
const config = {
headers: {
// use with @prismarinejs/mineflayer
// if you don't know what a session token/access token is, don't bother with this; it's for the silliest of devs
const mineflayer = require(`mineflayer`)
const config = {
host: `example.com`,
port: 25565,
token: `eyJraWQiOiJhYzg0YSIsImFsZyI6IkhTMjU2In0.eyJ4dWlkIjoiMjUzNTQ...`
}
@182exe
182exe / discordwebhookedit.js
Last active April 11, 2024 05:29
discord - simple webhook message edit (nodejs, axios)
const axios = require('axios');
const url = `https://discord.com/api/webhooks/<webhookid>/<webhooktoken>`
// initially post a message
// "?wait=true" url param tells discord to return a message object so we can get the id of it
axios.post(`${url}?wait=true`, {
content: "hi, test. this is the first message."
}).then((response) => {
// use PATCH method to edit webhooks
@182exe
182exe / loginator.js
Last active December 29, 2023 19:17
Loginator (a NodeJS logging function where you can have nice little tabs with customizable colors)
/*
simple colored console message prefixes
Usage:
const Loginator = require(`./loginator.js`)
const logger = new Loginator(4, false, {
"info": {fg: "brightblack", bg: "white"},
"chat": {fg: "white", bg: "brightblack"},
"warn": {fg: "brightwhite", bg: "yellow"},
"uhoh": {fg: "yellow", bg: "red"},
@182exe
182exe / jibber.js
Last active July 3, 2023 17:49
Jibber (randomized fake words/sentences generator in 1 function)
function jibber(length, punctuate, punctuationMarks, wordLengthLimit, mimicEnglishPractices) {
length = typeof length !== `undefined` ? length : 1;
punctuate = typeof punctuate !== `undefined` ? punctuate : false;
punctuationMarks = typeof punctuationMarks !== `undefined` ? punctuationMarks : [".", "!", "?", "..."];
const cv = 'aeiou';
const cc = 'bcdfghjklmnprstvw';
const ccx = 'qxzy';
const cca = 'bcdfghjklmnpqrstvwxyz'