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 random as rn | |
| #pip install random | |
| def code_gen(): | |
| CL = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L','1', '2', '3', '4', '5', '6', '7', '8', '9', '0','M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] | |
| code = rn.choice(CL) + rn.choice(CL) + rn.choice(CL) + rn.choice(CL) + rn.choice(CL) + rn.choice(CL) + rn.choice(CL) + rn.choice(CL) + rn.choice(CL) + rn.choice(CL) | |
| return code |
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
| /** | |
| * * @param {express.Request} req | |
| * * @param {express.Response} res | |
| */ | |
| function getOrigin(origin, callback) { | |
| try { | |
| const _allowedOrigins = process.env.MODE ? [ | |
| "http://localhost:3000", //for local development | |
| "http://localhost:3001" |
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 { initializeApp } from "firebase/app"; | |
| import e from "express"; | |
| import {getDocs, getDoc, doc, setDoc, collection, getFirestore, query, where} from "firebase/firestore"; | |
| // TODO: Add SDKs for Firebase products that you want to use | |
| // https://firebase.google.com/docs/web/setup#available-libraries | |
| // Your web app's Firebase configuration | |
| // For Firebase JS SDK v7.20.0 and later, measurementId is optional | |
| const firebaseConfig = { |
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
| # 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 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 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 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 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 |
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
| <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 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 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 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
| 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 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
| 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) |
NewerOlder