Skip to content

Instantly share code, notes, and snippets.

View carlosdelfino's full-sized avatar
💭
De volta as origens, com o canal Basicão da Eletrônica

Carlos Delfino carlosdelfino

💭
De volta as origens, com o canal Basicão da Eletrônica
View GitHub Profile
import express from "express";
import session from "express-session";
import { Request, Response, NextFunction } from "express";
import { AppController } from "./appController";
import { AppConfig, AppRequest } from "./types";
// @ts-ignore
import createLogger from "../../library/logger";
import path from "path";
import bodyParser from 'body-parser';
import AuthRouters from "./routes/auth";
@carlosdelfino
carlosdelfino / README.md
Last active June 26, 2024 14:57
Extrator de Esquemas de Imagens

Passos Detalhados para Instalação no Windows

Instalar Poppler para Windows:

  • Baixe o Poppler de aqui: http://blog.alivate.com.au/poppler-windows/.
  • Extraia o conteúdo do arquivo ZIP baixado.
  • Adicione o caminho do binário do Poppler (path\to\poppler\bin) à variável de ambiente PATH.
  • Instalar Pacotes Python Necessários:

Use pip para instalar os pacotes necessários. Vamos instalar opencv-python-headless para evitar problemas relacionados ao Qt, e outras bibliotecas necessárias.

@carlosdelfino
carlosdelfino / import-xlsx.mysql.py
Last active June 12, 2024 15:03
O script abaixo é para importar os dados do arquivos xlsx para o mysql
import pandas as pd
from sqlalchemy import create_engine, Table, MetaData
# Configurações do banco de dados
db_username = 'telegram_bot'
db_password = 'telegram_bot'
db_host = 'localhost'
db_name = 'telegram_bot'
# Criação da engine de conexão
Starting SFDX: Preview Component Locally
16:53:11.704 sfdx force:lightning:lwc:preview -p Android -t Nexus_5X_API_30 -n c/selector -a browser -d /home/carlosdelfino/workspace/salesforce/bikeCard --loglevel warn
(node:18895) Warning: Deprecated environment variable: SFDX_JSON_TO_STDOUT. Please use SF_JSON_TO_STDOUT instead.
(Use `node --trace-warnings ...` to show where the warning was created)
❯ Requirements
❯ Checking SDK root location
❯ Checking Android SDK Prerequisites
❯ Checking Android Command Line Tools
❯ Checking SDK Platform Tools
from django.conf import settings
from django.db import models
from datetime import datetime
#from carteira.models.corretora import Corretora
class AgentesCorretoras(models.Model):
corretora = models.ForeignKey('carteira.Corretora', on_delete=models.CASCADE)
agente = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
data_contratacao = models.DateField('Data de contratação do Agente',
@carlosdelfino
carlosdelfino / COTAHIST_D12122022.TXT
Last active January 28, 2023 21:56
Arquivos para uso no curso de python
This file has been truncated, but you can view the full file.
00COTAHIST.2022BOVESPA 20221212
012022121234MMMC34 0103M DRN R$ 000000001654500000000168960000000016545000000001664600000000167160000000016622000000001689600026000000000000000369000000000006142714000000000000009999123100000010000000000000BRMMMCBDR000143
012022121202RRRP3 0103R PETROLEUMON NM R$ 000000000326700000000033520000000003212000000000328000000000033330000000003331000000000333413048000000000003392100000000011129194700000000000000009999123100000010000000000000BRRRRPACNOR5100
012022121296RRRP3F 0203R PETROLEUMON NM R$ 000000000327700000000033680000000003214000000000327300000000033670000000003336000000000336700994000000000000015232000000000049863149000000000000009999123100000010000000000000BRRRRPACNOR5100
012022121202TTEN3 0103TENTOS O
@carlosdelfino
carlosdelfino / create_database.md
Last active December 13, 2022 02:13
Carregando dados dos arquivos de histórico da B3 para banco de dados SQLite, execute primeiro os comandos do arquivo create_database.txt para criar o banco de dados e seus índices.

Use os comandos abaixo com o SQLite3 para criar o banco de dados.

sqlite3 cotacoes/database.db 'create table COTACOES (
                    DATA_PREGAO date not null,
                    CODBDI text,
                    CODIGO_NEGOCIACAO text not null,
                    TIPO_MERCADO integer,
                    NOME_RESUMIDO text,
                    ESPECI text,
                    PRAZO_TERMO integer,
@carlosdelfino
carlosdelfino / primeiro_dia_util.py
Last active October 31, 2022 15:20
Obtém o primeiro e último dia útil de cada mês.
resmin = []
for month in range(1, 13):
calmin = calendar.monthcalendar(year, month)
for i, w in enumerate(calmin):
for j, d in enumerate(w):
if 0 == d:
calmin[i][j] = 32
day = min([week[0:5] for week in calmin][0])
if day == 32:
day = min([week[0:5] for week in calmin][1])
@carlosdelfino
carlosdelfino / baixar_historico_b3.py
Created October 29, 2022 18:13
Códigos para uso nos dados históricos da B3
import os
from pathlib import Path
import requests as req
def get_cotacoes(ano, mes=None, dia=None, overwrite=True):
if dia and mes:
zip_file_name = "COTAHIST_D{:02d}{:02d}{}.ZIP".format(dia,mes,ano);
elif mes:
zip_file_name = "COTAHIST_M{:02d}{}.ZIP".format(mes,dia);
@carlosdelfino
carlosdelfino / README.md
Created September 19, 2022 16:49 — forked from cshaa/README.md
Example of a markdown-it extension written in TypeScript

Mark Plugin for markdown-it

This is a sample implementation of a basic extension. It uses the @types/markdown-it package from NPM which contains the documentation for markdown-it. The code here is mostly copied from the backtick rule implementation you can find in the original markdown-it repository.

Keywords

Plugin example for markdown-it, extension tutorial, markdown-it extension API, TypeScript, jsDoc, documentation for extensions, specification of plugin API, how to write an extension for markdown-it.