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 pydantic import BaseModel | |
| # Criando a aplicação | |
| app = FastAPI() | |
| # Rota inicial | |
| @app.get("/api") | |
| def read_root(): | |
| return {"mensagem": "Bem-vindo à minha primeira API com FastAPI!"} |
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 asyncio | |
| import aiohttp | |
| async def fetch(url): | |
| async with aiohttp.ClientSession() as session: | |
| async with session.get(url) as response: | |
| print(f"Baixando {url}...") | |
| html = await response.text() | |
| print(f"Concluído: {url} ({len(html)} caracteres)") | |
| return html |
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 cv2 | |
| from cvzone.FaceDetectionModule import FaceDetector | |
| # Inicializa a captura de vídeo da webcam | |
| video = cv2.VideoCapture(0) | |
| # Verifica se a webcam foi inicializada corretamente | |
| if not video.isOpened(): | |
| print("Erro ao acessar a câmera") | |
| exit() |
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 bcrypt | |
| import mysql.connector | |
| # Função para conectar ao banco de dados MySQL | |
| def conectar_mysql(): | |
| return mysql.connector.connect( | |
| host="localhost", | |
| user="root", | |
| password="secret", # Senha configurada para o MySQL | |
| database="safe_password" # Nome do banco de dados |
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 grpc | |
| import examplo_pb2 | |
| import examplo_pb2_grpc | |
| def run_client(): | |
| channel = grpc.insecure_channel("localhost:50051") | |
| stub = examplo_pb2_grpc.GreeterStub(channel) | |
| response = stub.SayHello(examplo_pb2.HelloRequest(name="gRPC")) | |
| print("Greeter client received:", response.greeting) |
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 grpc | |
| from concurrent import futures | |
| import examplo_pb2 | |
| import examplo_pb2_grpc | |
| class GreeterServicer(examplo_pb2_grpc.GreeterServicer): | |
| def SayHello(self, request, context): | |
| return examplo_pb2.HelloResponse(greeting=f"Hello, {request.name}!") | |
| def run_server(): |
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
| fastboot oem fb_mode_set | |
| fastboot flash partition gpt.bin | |
| fastboot flash bootloader bootloader.img | |
| fastboot flash logo logo.bin | |
| fastboot flash boot boot.img | |
| fastboot flash recovery recovery.img | |
| fastboot flash dsp adspso.bin | |
| fastboot flash oem oem.img | |
| fastboot flash system system.img_sparsechunk.0 | |
| fastboot flash system system.img_sparsechunk.1 |
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
| #!/bin/bash | |
| fastboot oem fb_mode_set | |
| fastboot flash partition gpt.bin | |
| fastboot flash bootloader bootloader.img | |
| fastboot flash logo logo.bin | |
| fastboot flash boot boot.img | |
| fastboot flash recovery recovery.img | |
| fastboot flash dsp adspso.bin | |
| fastboot flash oem oem.img | |
| fastboot flash system system.img_sparsechunk.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
| version: '3.1' | |
| services: | |
| humhub: | |
| image: mriedmann/humhub:1.6.2 | |
| links: | |
| - "db:db" | |
| ports: | |
| - "8080:80" | |
| volumes: | |
| - "config:/var/www/localhost/htdocs/protected/config" |
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
| # App port to run on | |
| PORT=3000 | |
| # The name of the site where Kutt is hosted | |
| SITE_NAME=Kutt | |
| # The domain that this website is on | |
| DEFAULT_DOMAIN=localhost:3000 | |
| # Generated link length |
NewerOlder