This document contains snippets that I've used and tested. It's not meant to be an official guide, but rather a document for looking up small snippets of code. For an extensive reference on the API, please visit the official documentation.
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
// This is a hack, a quick and dirty console script for RT/tweets (with replies) removal w/o API | |
// To be used in: https://twitter.com/Username/with_replies | |
// Set your username (without @) below (case-sensitive) to correctly trigger the right Menu | |
const tweetUser = 'Username' | |
// BUG, With above we still trigger Menu on some replies but relatively harmless. | |
// @Hack Implement simple has() for querySelector | |
const querySelectorHas = function( parent, child ){ |
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
#!/usr/bin/env python3 | |
# Recursively generate index.html files for | |
# all subdirectories in a directory tree | |
########################################################################## | |
## ❗️❗️❗️ WARNING: This version is outdated and unmaintained! | |
## For an up-to-date version with cleaner CSS styling see: | |
## https://gist.github.com/glowinthedark/625eb4caeca12c5aa52778a3b4b0adb4 | |
########################################################################## |
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
import discord | |
from discord.ext import commands | |
from discord.ext.commands.cooldowns import BucketType | |
bot = commands.Bot(command_prefix = "your prefix here") | |
token = 'token goes here' | |
#on ready login message | |
@bot.event | |
async def on_ready(): |
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
/** | |
* !!!! This code doesn't work anymore !!!! | |
* | |
* - You can check working code on comments. I won't update this code anymore. | |
* | |
* Also, I just decided to remove this code. You can check revisions for old code. | |
* Since this code was made for discord client that almost 5 years ago, It seems like doesn't work anymore. | |
* I don't want people keep arguing in the comments, i decided to remove this code. | |
* | |
* Note: This code is now fulfilled with Javascript comments. This code won't work even if you pasted to console. doesn't do anything. |
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
""" | |
A simple proxy server, based on original by gear11: | |
https://gist.github.com/gear11/8006132 | |
Modified from original to support both GET and POST, status code passthrough, header and form data passthrough. | |
Usage: http://hostname:port/p/(URL to be proxied, minus protocol) | |
For example: http://localhost:5000/p/www.google.com | |
""" | |
import re |
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
import requests # dependency | |
url = "<your url>" # webhook url, from here: https://i.imgur.com/f9XnAew.png | |
# for all params, see https://discordapp.com/developers/docs/resources/webhook#execute-webhook | |
data = { | |
"content" : "message content", | |
"username" : "custom username" | |
} |
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
""" | |
Please understand Music bots are complex, and that even this basic example can be daunting to a beginner. | |
For this reason it's highly advised you familiarize yourself with discord.py, python and asyncio, BEFORE | |
you attempt to write a music bot. | |
This example makes use of: Python 3.6 | |
For a more basic voice example please read: | |
https://github.com/Rapptz/discord.py/blob/rewrite/examples/basic_voice.py |
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 Quizlet Match Hack | |
// @namespace Gabe B. Talafous | |
// @version 1.6 | |
// @description The time will freeze at 0.5 and the answers will be the same color | |
// @author You | |
// @match https://quizlet.com/*/* | |
// @grant none | |
// @license MIT | |
// ==/UserScript== |
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
@commands.guild_only() | |
# Command cannot be used in private messages. | |
@commands.dm_only() | |
# Command can only be used in private messages. | |
@commands.is_owner() | |
# Command can only be used by the bot owner. | |
@commands.is_nsfw() |
NewerOlder