This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# - 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 |