Skip to content

Instantly share code, notes, and snippets.

View Sv443's full-sized avatar
🏳️‍🌈

Sven Fehler Sv443

🏳️‍🌈
View GitHub Profile
@Sv443
Sv443 / convert_mono.sh
Last active April 21, 2024 22:30
bash script for ffmpeg - convert all .ogg files in current dir to mono .ogg for use in Minecraft resource packs
# - Requires the directory "o" to be created in the same directory as this script, this is where the new files will be created.
# You can then move them to the parent directory and overwrite the old files after you verified the files are good.
# - On Windows, run this with git bash or wsl
# Converts all ogg files in the current directory to mono 64kbps ogg files:
for i in *.ogg; do ffmpeg -i "$i" -c:a libvorbis -b:a 64k -ac 1 -y "o/${i%.*}.ogg"; done
@Sv443
Sv443 / toggle-window-events.user.js
Created June 2, 2023 17:08
Simple userscript that can allow you to toggle any event on the window object on or off
// ==UserScript==
// @name window event toggler
// @namespace https://gist.github.com/Sv443/b2768fdebc8a037fbde4f4df9f7443a2
// @match https://*
// @grant none
// @version 1.0
// @author Sv443
// @license WTFPL
// @run-at document-start
// @connect self
@Sv443
Sv443 / README.md
Last active October 15, 2022 20:06
Updated version of @mlewand's DOMRect visualisation
@Sv443
Sv443 / getDiscordServerLocations.js
Last active June 15, 2021 06:51
[Node.js] Get all currently available location IDs and names of the Discord servers
// By Sv443 ( https://github.com/Sv443 ) - licensed under the WTFPL license
//
// !>> To use this, you need to install the package "xmlhttprequest" <<!
// !>> Also, set the environment variable "BOT_TOKEN" to your Discord API token <<!
//
// API reference: https://discordapp.com/developers/docs/resources/voice#list-voice-regions
const { XMLHttpRequest } = require("xmlhttprequest");
@Sv443
Sv443 / gh-actions-publish-npm-and-github.yml
Last active June 15, 2021 07:03
GitHub Actions: Publish to NPM and GitHub Package Registry on created release
# In order for this to work, since GitHub Package Registry likes to be a thorn in your ass, you'll have to follow this guide, otherwise this script will not work:
# https://pastebin.com/f24qc4Wk
#
# >>>> There are two lines that end in four exclamation marks. You will have to enter your usernames there for this script to work.
#
# Author: Sv443
# License: WTFPL (http://www.wtfpl.net/txt/copying/)
name: Publish to NPM and GPR
@Sv443
Sv443 / discord-js-get-all-guild-invites.js
Last active November 13, 2022 12:49
Discord.js - Get all invites from all your bot's guilds - only works with Discord.js v11 or lower!
// only works with Discord.js v11 or lower!
const Discord = require("discord.js");
const dev_ids = ["YOUR_ID(s)_HERE"]; // an array of IDs of the bot's developers - only these people will be able to execute this command
// Note: this snippet requires the variables "client" and "message" to work, these need to be provided by your script
@Sv443
Sv443 / nodejs_soft_shutdown.js
Created November 21, 2018 10:11
NodeJS soft shutdown
// not compatible with ES5, only ES6 and up
process.on('SIGINT', ()=>{
try {
// end your processes here, for example
// http_connection.close();
// or
// mysql_connection.end();