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
from urllib.parse import urlsplit | |
from flask import Blueprint, redirect, url_for, render_template, flash, request | |
from flask_login import current_user, login_user, login_required, logout_user | |
from src.models.usuario import User | |
from src.modules import db | |
from src.forms.auth import LoginForm | |
bp = Blueprint('auth', __name__, url_prefix='/admin/user') |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
{% from 'bootstrap5/utils.html' import render_icon %} | |
<!DOCTYPE html> | |
<html lang="pt-BR"> | |
<head> | |
{% block head %} | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no" /> | |
<title>{% if title %}{{ title }}{% else %}Aplicação{% endif %}</title> | |
{{ bootstrap.load_css() }} | |
<link rel="stylesheet" href="{{ url_for('static', filename='css/custom.css') }}" /> |
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
seed_data = [ | |
{"categoria": "Bebidas", | |
"produtos": [{"nome": "Refrigerante Guaraná Antarctica Zero Açúcar 200ml", "preco": 1.43}, | |
{"nome": "Refrigerante Coca Cola 2 Litros", "preco": 9.99}, | |
{"nome": "Água de Coco Kerococo 1L", "preco": 10.49}, | |
{"nome": "Água Tônica Zero Açúcar Schweppes Lata 220ml", "preco": 1.99}, | |
{"nome": "Água Mineral Minalba sem Gás 1,5L", "preco": 2.99}, | |
{"nome": "Refresco em Pó Tang Limão 18g", "preco": 1.28}, | |
{"nome": "Bebida a Base de Soja Original ADES 1 Litro", "preco": 7.16}, | |
{"nome": "Suco Pronto Maguary Laranja 1L", "preco": 5.70} |
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 socket | |
import mensagens | |
HOST, PORT = input().split() | |
PORT = int(PORT) | |
with (socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s): | |
s.connect((HOST, PORT)) | |
mensagem = mensagens.Mensagem(mensagens.CODIFICAR, payload=["3", "Ola, velhinho"]) |
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 socket | |
import threading | |
def trata_cliente(socket_do_cliente: socket.socket, addr): | |
print(f"Iniciando conexao com o cliente {addr[0]}:{addr[1]}") | |
try: | |
mensagem = socket_do_cliente.recv(1024).decode() | |
socket_do_cliente.sendall(mensagem.encode()) | |
except Exception as e: |
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 socket | |
import threading | |
def trata_cliente(socket_do_cliente: socket.socket, addr): | |
print(f"Iniciando conexao com o cliente {addr[0]}:{addr[1]}") | |
try: | |
mensagem = socket_do_cliente.recv(1024).decode() | |
socket_do_cliente.sendall(mensagem.encode()) | |
except Exception as e: |
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 socket | |
def codifica(texto: str, passo: int = 3) -> str: | |
retorno = "" | |
for letra in texto: | |
if letra.isupper(): | |
retorno += chr(((ord(letra) - 65 + passo) % 26) + 65) | |
elif letra.islower(): | |
retorno += chr(((ord(letra) - 97 + passo) % 26) + 97) | |
else: |
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
user www; | |
worker_processes auto; | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { |
NewerOlder