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 accetto/ubuntu-vnc-xfce-g3 | |
| USER 0 | |
| RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | |
| RUN apt update \ | |
| && apt install -y wget gnupg2 \ | |
| && rm -rf /var/lib/apt/lists/* |
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 | |
| import jwt | |
| from fastapi import Depends, HTTPException, Response, status | |
| from fastapi.security import OAuth2PasswordBearer | |
| from helpers.config_helper import Config | |
| oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") | |
| class OAuth2TokenValidation: | |
| def __init__(self): |
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 requests | |
| import json | |
| import time | |
| class Office365EmailClient: | |
| def __init__(self, client_id: str, client_secret: str, tenant_id: str): | |
| self.client_id = client_id | |
| self.client_secret = client_secret | |
| self.tenant_id = tenant_id | |
| self.token = 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
| <%* | |
| function getMonday(d) { | |
| d = new Date(d); | |
| var day = d.getDay(), | |
| diff = d.getDate() - day + (day == 0 ? -6 : 1); // ajustar quando o dia for domingo | |
| return new Date(d.setDate(diff)); | |
| } | |
| function formatDate(date) { | |
| let dd = date.getDate(); |
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
| # AUTHOR https://github.com/viniciusccosta/ClipBarcode/blob/master/clipbarcode/digito_verificador.py | |
| # ============================================================================= | |
| import re | |
| from abc import ABC, abstractmethod | |
| from decimal import Decimal | |
| from .datetime_tools import calculate_date | |
| from .digito_verificador import mod10, mod11 |
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 contextlib import contextmanager | |
| import time | |
| from requests_oauthlib import OAuth2Session | |
| from oauthlib.oauth2 import BackendApplicationClient | |
| class TokenManager: | |
| def __init__(self, client_id, client_secret, token_url, scopes): | |
| self.client_id = client_id | |
| self.client_secret = client_secret | |
| self.token_url = token_url |
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 sqlalchemy import Table | |
| from sqlalchemy.orm import class_mapper | |
| def filtrar_colunas_validas(data, table): | |
| valid_columns = set(table.columns.keys()) | |
| return {key: value for key, value in data.items() if key in valid_columns} | |
| # Exemplo de uso | |
| filtered_data = filter_valid_columns(viagem.model_dump(), viagem_cif_table) | |
| stmt_viagem = insert(viagem_cif_table).values(filtered_data) |
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 fastapi import FastAPI, Request, HTTPException | |
| from pydantic import BaseModel | |
| import os | |
| import requests | |
| app = FastAPI() | |
| TELEGRAM_BOT_TOKEN = "" | |
| TELEGRAM_CHAT_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 logging | |
| from time import sleep | |
| class Threadlock(): | |
| '''Singleton''' | |
| _instance = None | |
| _locked = False | |
| def is_locked(self): | |
| return self._locked |
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 datetime import time | |
| import logging | |
| import asyncio | |
| from fastapi import FastAPI, Response | |
| from fastapi.concurrency import asynccontextmanager | |
| from pydantic import BaseModel | |
| from pygen import anexar_arquivo, baixar_planilha, executar_atividade | |
| from guias import Imposto, emitir_guia_difal, emitir_guia_fethab, emitir_guia_iagro | |
| from apuracao import processar_apuracao_difal, processar_apuracao_fethab, processar_apuracao_iagro | |
| import urllib3 |