Skip to content

Instantly share code, notes, and snippets.

View Xetera's full-sized avatar

Xetera

View GitHub Profile
@Xetera
Xetera / DontLeakYourTokens.ts
Created March 23, 2018 16:43
Small script to give people who leak their discord tokens a heads-up
import {Client, RichEmbed} from 'discord.js'
const client = new Client();
client.login(process.env['BOT_TOKEN']);
function sendEmbed(ownerURL: string, appId: string){
return new RichEmbed()
.setAuthor(`⛔ Yikes, you leaked your token! ⛔`)
.setThumbnail(ownerURL)
.setColor('#ff0000')
@Xetera
Xetera / Building.py
Last active December 22, 2017 22:15
Python Teaching Template
import random
class Building:
def __init__(self, world, name, owner, color, _type):
self.name = name
self.owner = owner # Person obj
self.color = color
self.type = _type
self.assign_person(owner)
@Xetera
Xetera / You Enjoy Shitty Pizzas.md
Last active December 12, 2017 07:10
Here's a quick way of telling if the pizza you enjoy has actual toppings in it. Chances are it doesn't and you're too scared to try anything that tastes anything even slightly different to what you normally eat.
class Pizza {
    constructor(ingredients) {
        this.ingredients = ingredients;
    }
    // is this thing in the pizza a topping?
    isTopping(topping){
        let newPizza = new Pizza(this.ingredients);
        let index = newPizza.ingredients.indexOf(topping);
        if (index === -1)
@Xetera
Xetera / First Discord Command
Created November 4, 2017 10:57
One of the first "working" pieces of code I wrote in python for discord ft. global variables
async def cmd_weather(self, channel, author):
import json
from array import array
import requests
from collections import OrderedDict
from pprint import pprint
api_key = "&APPID=507e30d896f751513350c41899382d89"
city_name_url = "http://api.openweathermap.org/data/2.5/weather?q="
units = "&units=metric"
global general_info