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__) |
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
SITE_NAME = 'https://youtube.com' | |
@app.route('/', defaults={'path': ''}) | |
@app.route('/<path:path>') | |
def proxy(path): | |
# ... |
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
# ... | |
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
if __name__ == '__main__': | |
app.run(host='0.0.0.0', port=8080) |
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 |
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 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
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 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
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') |