Skip to content

Instantly share code, notes, and snippets.

View Benricheson101's full-sized avatar
🦦
owo

Ben Richeson Benricheson101

🦦
owo
View GitHub Profile
@Benricheson101
Benricheson101 / claim-discord-quest.js
Last active April 26, 2024 20:45
Run the script in the Discord dev tools console. Copy the ID (not index) of one of the quests in the table, and run `await completeStreamQuest("18-digit-id-here")`. Do not close the window until it has finished.
const {completeStreamQuest} = (() => {
let wpRequire;
webpackChunkdiscord_app.push([[Date.now()], {}, e => (wpRequire = e)]);
const mods = Object.values(wpRequire.c);
const {Store} = mods.find(m => m?.exports?.Store).exports;
const {ApplicationStreamingStore, QuestsStore, UserStore} =
Store.getAll().reduce((a, c) => ((a[c.getName()] = c), a), {});
const {encodeStreamKey} = mods.find(m => m?.exports?.encodeStreamKey).exports;
const {sendHeartbeat, enrollInQuest} = mods.find(
@Benricheson101
Benricheson101 / Dockerfile
Last active February 21, 2024 03:41
Bash script to automatically update qBittorrent port with a forwarded port from Gluetun
# Make sure to bind mount the docker socket so docker commands work inside the container:
# -v /var/run/docker.sock:/var/run/docker.sock
FROM docker
RUN apk add bash curl perl
COPY update_port.sh .
ENTRYPOINT ["/update_port.sh"]
import {setTimeout} from 'node:timers';
const defer = <Resolve = unknown, Reject = unknown>() => {
let _resolve!: (arg0: Resolve | PromiseLike<Resolve>) => void;
let _reject!: (arg0?: Reject) => void;
const promise = new Promise<Resolve>((resolve, reject) => {
_resolve = resolve;
_reject = reject;
});
# (c) Ben Richeson 2022
# github.com/benricheson101
# USAGE:
# python3 spotify_stats.py [year]
#
# SETUP:
# 1. place this file in the same directory as `endsong_N.json` files in your spotify data package
# 2. run the file, optionally appending a year to the end of the command
@Benricheson101
Benricheson101 / discordOAuth2ScopeToggle.user.js
Last active November 7, 2023 13:54
Toggle Discord OAuth2 scopes on the authorization page or the in-app auth screen
// ==UserScript==
// @name Toggle Discord OAuth Scopes
// @version 0.2
// @description Toggle Discord OAuth scopes by clicking them on the auth screen
// @author Ben Richeson (github.com/benricheson101)
// @match https://discord.com/oauth2/authorize?*
// @match https://*.discord.com/oauth2/authorize?*
// @match https://discord.com/channels/*
// @match https://*.discord.com/channels/*
// ==/UserScript==
@Benricheson101
Benricheson101 / discord-bottom.js
Last active September 5, 2023 16:19
i need help
{
const mods = webpackChunkdiscord_app.push([
[Date.now()],
{},
e => Object.values(e.c),
]);
const provider = mods.find(
m => m?.exports?.Z?.getLanguages && Object.keys(m.exports.Z.Messages).length
).exports.Z._provider;
const strs = mods.find(m => m?.exports?.COMMAND_NICK_SUCCESS);
@Benricheson101
Benricheson101 / main.go
Created February 25, 2022 02:23
discordgo zero downtime restart
package main
import (
"flag"
"fmt"
"os"
"os/signal"
"reflect"
"sync/atomic"
"syscall"
@Benricheson101
Benricheson101 / main.go
Last active February 26, 2022 09:32
Get statistics about your Discord bot. The go file supports large bot sharding
// Copyright (c) 2022 Benjamin Richeson
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
@Benricheson101
Benricheson101 / hello_world.a
Created September 9, 2020 21:31
brainfuck but its all `a`s
ââââââââÄÁââââÄÁââÁâââÁâââÁâÀÀÀÀãäÁâÁâÁãÁÁâÄÀäÀãäÁÁàÁãããàâââââââààâââàÁÁàÀãàÀàâââàããããããàããããããããàÁÁâàÁââà
@Benricheson101
Benricheson101 / eval.js
Last active February 14, 2021 23:55
Overcomplicated Discord.js eval command
const { runInNewContext } = require("vm");
const Discord = require("discord.js");
const chalk = require("chalk");
const { inspect } = require("util");
const fetch = require("node-fetch");
const { colors: { default: defaultColor } } = require("../../config.json");
const options = {
callback: false,
stdout: true,