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
| -- Users | |
| DROP TABLE users; | |
| -- ID strings -- x () | |
| -- ADMIN - 1 | |
| -- SOFT delete | |
| CREATE TABLE users( | |
| id INT AUTO_INCREMENT PRIMARY KEY, -- Indexados -- COUNT(id) -- COUNT(username) | |
| username VARCHAR(50) NOT NULL, |
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
| name: Echo Messages on Push to Main | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| jobs: | |
| echo-job: | |
| runs-on: ubuntu-latest | |
| steps: |
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
| CREATE TABLE users ( | |
| id INT PRIMARY KEY, | |
| name VARCHAR(100) | |
| ); | |
| CREATE TABLE posts ( | |
| id INT PRIMARY KEY, | |
| user_id INT, | |
| content TEXT, | |
| created_at DATETIME |
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
| CREATE TABLE students ( | |
| id INT PRIMARY KEY, | |
| name VARCHAR(100), | |
| age INT, | |
| enrollment_year INT | |
| ); | |
| CREATE TABLE enrollments ( | |
| id INT PRIMARY KEY, | |
| student_id INT, |
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 logging | |
| from typing import Optional | |
| from django.db import connection | |
| from concurrent.futures import TimeoutError, Future | |
| logger = logging.getLogger(__name__) | |
| logger.setLevel(logging.INFO) | |
| class QueryTimeoutException(BaseException): | |
| def __init__(self, message: str, pid: Optional[int] = None): |
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 time | |
| from threading import Thread | |
| from multiprocessing import Process | |
| def is_prime(number): | |
| if number < 2: | |
| return False | |
| for x in range(2, number): | |
| if number % x == 0: |
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 multiprocessing import Process | |
| import time | |
| import os | |
| from concurrent.futures import ProcessPoolExecutor | |
| def fib(number): | |
| if number <= 1: | |
| return number | |
| return fib(number - 1) + fib(number - 2) |
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 threading import Thread | |
| import time | |
| def fib(number): | |
| if number <= 1: | |
| return number | |
| return fib(number - 1) + fib(number - 2) | |
| if __name__ == '__main__': |
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 threading | |
| import requests | |
| import time | |
| def fetch_data(post_id): | |
| url = f"https://jsonplaceholder.typicode.com/posts/{post_id}" | |
| response = requests.get(url) | |
| if response.status_code == 200: | |
| print(f"Successfully fetched data for post {post_id}") |
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 time | |
| from threading import Thread | |
| def prepare_dough(): | |
| print("Preparing the dough...") | |
| time.sleep(3) | |
| print("Dough is ready.") | |
| def add_ingredients(): | |
| print("Adding ingredients...") |
NewerOlder