This file contains hidden or 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 os | |
import random | |
import unittest | |
import tempfile | |
from pychievements import Achievement, icons | |
from pychievements import cli | |
from pychievements.trackers import AchievementTracker, NotRegistered, AlreadyRegistered | |
from pychievements.backends import SQLiteAchievementBackend | |
from pychievements.signals import receiver, goal_achieved, level_increased, highest_level_achieved |
This file contains hidden or 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
from utils.common import LOG_CHANNEL | |
from gevent import sleep | |
def relayer(client, log_stream): | |
curr_place = log_stream.tell() | |
while True: | |
log_stream.seek(curr_place) |
This file contains hidden or 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 importlib | |
import inspect | |
import logging | |
import os | |
from site.base_route import BaseRoute | |
from flask import Blueprint, Flask | |
from gevent.pywsgi import WSGIServer |
This file contains hidden or 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
from discord.ext import commands | |
from trackerbot.constants import ADMIN_ROLE | |
from trackerbot.utils.decorators import require_roles | |
class Debug: | |
def __init__(self, bot: commands.Bot): | |
self.bot = bot |
This file contains hidden or 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
from os import environ | |
import logging | |
from trackerbot.app import TrackerBot | |
bot = TrackerBot() | |
if __name__ == '__main__': | |
log = logging.getLogger('TrackerBotLogger') | |
handler = logging.StrFormatStyle('%(asctime)s:%(levelname)s:%(name)s: %(message)s') |
This file contains hidden or 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
from sqlite3 import connect | |
db = connect("item.sqlite") | |
cursor = db.cursor() | |
cursor.execute("CREATE TABLE IF NOT EXISTS Weapon(NAME text, DAMAGE integer DEFAULT 10)") | |
cursor.execute("DELETE FROM Weapon") # Clear everything | |
cursor.execute("INSERT INTO Weapon (NAME) VALUES (\"Sword\")") |
This file contains hidden or 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 socket | |
import threading | |
def sendMsg(): | |
while running: | |
try: | |
message = input("Send: ") | |
sock.send(message.encode()) | |
except: |
This file contains hidden or 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
from gcode import GCode, Printer | |
g = GCode() | |
# get stuff setup | |
g.set_unit() | |
g.start_heating_extruder(230) | |
g.start_heating_bed(60) | |
g.go_home() | |
g.wait_heat_bed(55) | |
g.wait_heat_extruder(200) |
This file contains hidden or 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
from flask import Flask | |
from requests import get | |
app = Flask('__main__') | |
SITE_NAME = 'https://google.com/' | |
@app.route('/', defaults={'path': ''}) | |
@app.route('/<path:path>') | |
def proxy(path): | |
return get(f'{SITE_NAME}{path}').content |
This file contains hidden or 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
from flask import Flask | |
from requests import get | |
app = Flask(__name__) | |
SITE_NAME = 'https://google.com/' | |
@app.route('/', defaults={'path': ''}) | |
@app.route('/<path:path>') | |
def proxy(path): | |
return get(f'{SITE_NAME}{path}').content |