Skip to content

Instantly share code, notes, and snippets.

View begnini's full-sized avatar
🏠
Working from home

Humberto Pereira begnini

🏠
Working from home
View GitHub Profile
EVENTO ACERTOS ERROS % ACERTO
NOMEACAO_EM_CARGO_EFETIVO 26 2 92.85714285714286
LICENCA_DESEMPENHO_DE_MANDATO_CLASSISTA 19 0 100.0
SUSPENSAO 7 0 100.0
EXONERACAO_DE_CARGO_COMISSIONADO 30 0 100.0
ELEVACAO_PROGRESSAO_PROMOCAO_DE_NIVEL 26 1 96.29629629629629
LICENCA_PARA_ATIVIDADE_POLITICA 21 0 100.0
RECONDUCAO 8 0 100.0
AVERBACAO_OU_RECONHECIMENTO_DE_TEMPO_DE_SERVICO 29 0 100.0
@begnini
begnini / sizes.txt
Created November 5, 2022 16:10
Tamanho dos arquivos de download das eleicoes 2022
AC, round, 1 296M
AC, round, 2 349M
AL, round, 1 1034M
AL, round, 2 1362M
AM, round, 1 1158M
AM, round, 2 1474M
AP, round, 1 260M
AP, round, 2 303M
BA, round, 1 5378M
BA, round, 2 6954M
@begnini
begnini / download_logs_urna.sh
Last active November 5, 2022 15:56
Baixa os arquivos transmitidos para a totalizacaos das Eleicoes 2022
#!/bin/bash
STATES="AC AL AM AP BA CE DF ES GO MA MG MS PA PB PE PI PR RJ RN RO RR RS SC SE SP TO ZZ"
for state in $(echo $STATES); do
for round in $(echo "1 2"); do
echo 'Downloading', $state, 'round', $round;
wget -nv --show-progress --header="User-Agent: Mozilla" https://cdn.tse.jus.br/estatistica/sead/eleicoes/eleicoes2022/arqurnatot/bu_imgbu_logjez_rdv_vscmr_2022_${round}t_${state}.zip
done;
done;
#!/bin/bash
URL_DATA="https://resultados.tse.jus.br/oficial/ele2022/545/dados-simplificados/br/br-c0001-e000545-r.json"
data=$(wget -q -O - $URL_DATA)
echo $data | jq -r '
[50*"="],
[" ELEICOES 2022 - 2 turno"],
[50*"="],
(["% apurado", .pst, "atualizado", .hg]),
@begnini
begnini / roi.py
Last active June 30, 2019 22:08
ROI nao retangulo
import cv2
import numpy as np
image = cv2.imread('QWO9Y.jpg')
mask = np.zeros(image.shape, dtype=np.uint8)
# pontos do poligono
pts = [
[150, 124],
@begnini
begnini / feijoes.php
Created July 13, 2018 02:23
Busca de feijoes em imagem
<?php
use function CV\imread;
use function CV\imwrite;
use function CV\threshold;
use function CV\findContoursWithoutHierarchy;
use function CV\boundingRect;
use function CV\rectangleByRect;
use function CV\cvtColor;
<?php
function agrupa_alunos($query)
{
$alunos = [];
foreach ($query->result() as $key => $value)
{
$id = $value->numerodoaluno;