Skip to content

Instantly share code, notes, and snippets.

@jadc
jadc / wsl_nvim_context.reg
Created February 18, 2023 03:51
Adds a button to the context menu to open a file in WSL (using nvim, or any editor)
Windows Registry Editor Version 5.00
; Delete old entries
[-HKEY_CLASSES_ROOT\*\shell\Vim]
[-HKEY_CLASSES_ROOT\*\shell\Vim\command]
; Add sub-menu
[HKEY_CLASSES_ROOT\*\shell\Vim]
"MUIVerb"="Edit with Vim"
"Icon"="write.exe"
@jadc
jadc / dalle-discord.py
Created June 15, 2022 18:42
Discord bot as an interface for DALL-E Playground (https://github.com/saharmor/dalle-playground)
import discord # pip install discord.py
import aiohttp, io, base64
### EDIT HERE ###
token = ''
backend_url = ''
#################
bot = discord.Client()
bot.queue = set()
@jadc
jadc / synctalk.sh
Last active March 21, 2021 01:17
Discord Sync Talk (send same message on multiple accounts at once)
declare -a TOKENS=(
# insert tokens here, one per line
)
read -p "Channel ID: " CHANNEL
say () {
curl -X POST -H "Authorization: $2" -H "User-Agent: thiscanbeanything" -H "Content-Type: application/json" -d "{\"content\": \"$1\"}" https://discordapp.com/api/v6/channels/$CHANNEL/messages --no-progress-meter > /dev/null
}
sayEach () {
@jadc
jadc / pred.sh
Created March 21, 2021 01:12
Discord Pre-defined Message Sender
# have a file named 'lines' (no extension) with a pre-defined message per line
TOKEN=""
CHANNEL=""
say () {
/usr/bin/curl -X POST -H "Authorization: $TOKEN" -H "User-Agent: thiscanbeanything" -H "Content-Type: application/json" -d "{\"content\": \"$1\"}" "https://discordapp.com/api/v6/channels/$CHANNEL/messages"
}
say "$(sort --random-sort lines | head -n 1)"