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
# prompt: basic flask app | |
import os | |
from threading import Thread | |
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def hello_world(): | |
return 'Hello, World!' |
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 socketio | |
sio = socketio.Client(reconnection=True) | |
@sio.event | |
def connect(): | |
print("Connected to the server") | |
sio.send("Hello world!") | |
@sio.event | |
def message(data): | |
print(f"Received message: {data}") | |
@sio.event |
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
<meta name="viewport" content="width=device-width,initial-scale=1.0"/> | |
<body id="body"> | |
<div id="con"> | |
<div id="red"></div> | |
<div id="blue"></div> | |
<div id="yellow"></div></div> | |
<style> | |
#body{ | |
position: relative; | |
background-color: #000; |
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 as req | |
from bs4 import BeautifulSoup as bs | |
def currency_convert(frm:str, to:str, amount:int): | |
frm = frm.upper() | |
to = to.upper() | |
#print(frm, to, amount) | |
url = f"https://xe.com/currencyconverter/convert/?Amount={amount}&From={frm}&To={to}" #you can use your api if you have | |
data = req.get(url).text | |
soup = bs(data, "html.parser") |
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, re, pytz, time | |
from discord.ext import commands, tasks | |
#from datetime import datetime | |
intents = discord.Intents.default() | |
intents.members = True | |
intents.presences = True | |
intents.message_content = True | |
bot = commands.AutoShardedBot(shard_count=1,command_prefix='.',intents=intents) |
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
def time_format(delta): #0:40:45.3456456 | |
delta = str(delta) | |
time = "" | |
lst = delt.split(".")[0].split(":") | |
if(len(lst)<=3): | |
h,m,s = delt.split(".")[0].split(":") | |
time = f"{h}hr, {m}min, {s}sec" | |
elif(len(lst)>3): | |
d,h,m,s = delt.split(".")[0].split(":") | |
time = f"{d}day, {h}hr, {m}min, {s}sec" |
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
def sum(a, b, c ): | |
return a + b + c | |
def printBoard(xState, zState): | |
zero = 'X' if xState[0] else ('O' if zState[0] else 0) | |
one = 'X' if xState[1] else ('O' if zState[1] else 1) | |
two = 'X' if xState[2] else ('O' if zState[2] else 2) | |
three = 'X' if xState[3] else ('O' if zState[3] else 3) | |
four = 'X' if xState[4] else ('O' if zState[4] else 4) | |
five = 'X' if xState[5] else ('O' if zState[5] else 5) |
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
<form id="esportsForm"> | |
<!-- <label for="org">Organization:</label> --> | |
<input type="text" id="org" placeholder="Org Name" name="org"> | |
<br> | |
<br> | |
<!-- <label for="tname">Tournament Name:</label> --> | |
<input type="text" id="tname" placeholder="Tournament Name" name="tname"> | |
<table> | |
<thead> |
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
<!-- templates/index.html --> | |
<html> | |
<body> | |
<h1>Real-Time Website</h1> | |
<div id="data-container"></div> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.1.3/socket.io.js"></script> | |
<script> | |
const socket = io.connect('http://' + document.domain + ':' + location.port); |
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 | |
import os | |
from discord.ext import commands | |
import bs4 | |
from bs4 import BeautifulSoup | |
#import youtube_dl | |
intents = discord.Intents.default() | |
intents.message_content = True | |
intents.reactions = True |
NewerOlder