Skip to content

Instantly share code, notes, and snippets.

View IAmJSD's full-sized avatar
🏠
Working from home

Astrid IAmJSD

🏠
Working from home
View GitHub Profile
@IAmJSD
IAmJSD / firestore_secrets.py
Created December 24, 2018 14:51
A Python secrets system using Google Firestore. Removes the need for configs that expose sensitive data or even environment variables.
from google.cloud import firestore
# Imports go here.
db = firestore.Client()
# Defines the Firestore client.
class SecretsManager:
"""Handles secrets from the Firestore DB."""
def __getitem__(self, key):

Keybase proof

I hereby claim:

  • I am jakemakesstuff on github.
  • I am jakemakesstuff (https://keybase.io/jakemakesstuff) on keybase.
  • I have a public key ASAUPDjp4KUH9AvRArvUcjk8tmqrdAEw9_0CCcJbe5Tpiwo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am jakemakesstuff on github.
  • I am jakemakesstuff (https://keybase.io/jakemakesstuff) on keybase.
  • I have a public key ASAUPDjp4KUH9AvRArvUcjk8tmqrdAEw9_0CCcJbe5Tpiwo

To claim this, I am signing this object:

@IAmJSD
IAmJSD / key_bakery_3.0.py
Created October 7, 2018 14:30
The source code for the Rethink version of The Key Bakery. The required environment variables are PASSWORD (If using a Rethink password), TOKEN (for the Discord token), SERVER_ID (the server ID you are using it in) and APPLICATION_CHANNEL_ID (the channel key applications go to). I will not give support for this, I am only open sourcing.
import discord
import os
import logging
import datetime as dt
import random
import asyncio
import re
import rethinkdb as r
# Imports go here.
@IAmJSD
IAmJSD / ramsaybot.py
Created September 11, 2018 17:02
A Gordon Ramsay style bot.
import discord
import random
import logging
import os
# Imports go here.
ramsay_quotes = [
"YOU FUCKING DONKEY!",
"What are you? AN IDIOT SANDWICH.",
"GET OUT!",
@IAmJSD
IAmJSD / pycharm_git_commit_push.ahk
Created July 22, 2018 12:41
Saves a file in PyCharm and commits/pushes to Git
^]::
WinGetActiveTitle, WindowName
If InStr(WindowName, "PyCharm") {
Send, ^s
RegExMatch(WindowName, "[A-Z]:\\(([a-zA-Z0-9\.]){1,}(\\){0,}){1,}", FoundRegex)
if FoundRegex {
FormatTime, PCTimeFormatted
ToRun := "git.exe commit -a -m " . """" . "Save and commit from Jake's AHK script [PC time/date " . PCTimeFormatted . "]" . """"
RunWait, %ToRun%, %FoundRegex%, Hide
Run, git push, %FoundRegex%, Hide
from discord.ext import commands
from shared import get_guild, get_wallet,\
render_emoji, save_wallet
from ext_utils import FormattedEmbed
import discord
# Imports go here.
class Balance:
def __init__(self, dclient):
@IAmJSD
IAmJSD / Cube Server Setup.md
Last active February 25, 2018 16:34
A simple setup tutorial for Cube.

Cube Server Setup

So you added Cube or a bot based on Cube to your server? Awesome! Let's set this up! Please note commands in this tutorial are based on the prefix c! and the prefix for custom instances of the bot may be different.

Roles

You will want 2 roles which contain the following (not case sensitive and they just need to contain it, not be it):

  • staff - You will give this to your staff. This contains everything someone will need to moderate a server using this bot.
  • manager or management - You will give this to the highest up people on your server. These people will have permissions to manage the bot.

Channels Setup

@IAmJSD
IAmJSD / pai.py
Last active January 2, 2018 08:16
Your very own Ajit Pai.
userbot = False
# Defines if it is a userbot or not.
token = ""
# Insert your token here.
import discord, logging, random
# Imports go here.
logging.basicConfig(level=logging.INFO)
@IAmJSD
IAmJSD / christmas_nicknames.py
Created December 5, 2017 17:21
A quick botch of a selfbot to add christmas trees to everyone's names in a server you have permission to do it in. (The commands are !addtrees and !removetrees)
token = ""
# Insert your user token here.
prefix = "!"
# Here is the prefix. Feel free to change if you want.
tree = "🎄"
# A unicode christmas tree.
import discord