Skip to content

Instantly share code, notes, and snippets.

View elvisgs's full-sized avatar

Elvis Luciano Guimarães elvisgs

View GitHub Profile
@elvisgs
elvisgs / split_publicacoes.py
Created January 7, 2019 16:23
Script para dividir CSV de publicações do SIJ por edição e salvar como JSON
import csv
import itertools
import json
import os
import operator
import re
import sys
cwd = '/home/elvis/playground/stm'
SELECT distinct prod.*
FROM est_nf_ent nfe
JOIN est_nf_ent_it it ON nfe.CD_EMP = it.CD_EMP AND nfe.CD_FILIAL = it.CD_FILIAL and nfe.CD_NF = it.CD_NF
JOIN est_prod prod ON it.CD_EMP = prod.CD_EMP AND it.CD_PROD = prod.CD_PROD
WHERE nfe.DT_ENT BETWEEN '${data_inicial}' AND '${data_final}'
UNION
SELECT distinct prod.*
FROM est_nf_sai nfs
JOIN est_nf_sai_it it ON nfs.CD_EMP = it.CD_EMP AND nfs.CD_FILIAL = it.CD_FILIAL and nfs.CD_NF = it.CD_NF
JOIN est_prod prod ON it.CD_EMP = prod.CD_EMP AND it.CD_PROD = prod.CD_PROD
@elvisgs
elvisgs / .env
Created March 13, 2018 23:20
WinExpert Docker Compose Config
export WINEXPERT_PROJECT_ROOT=/storage/Projetos/GEP/Itec/gep_sped
export CARGA_TEMPLATE_SCRIPT_PATH="/work/scripts/carga-template_schema-only_custom-format.sql"
WINEXPERT_ROOT_PASSWD=senha
export WINEXPERT_PG_DB=sped
export WINEXPERT_PG_USER=sped
export WINEXPERT_PG_PASSWORD="${WINEXPERT_ROOT_PASSWD}"
export WINEXPERT_PG_JDBC_URL=jdbc:postgresql://postgres:5432/sped
@elvisgs
elvisgs / gist:956482
Created May 5, 2011 03:21 — forked from juanplopes/gist:955427
MaxOrDefault sem catch
public static TSource MaxOrDefault<TSource>(this IEnumerable<TSource> source)
where TSource : IComparable
{
return source.MaxOrDefault(default(TSource));
}
public static TSource MaxOrDefault<TSource>(this IEnumerable<TSource> source, TSource defaultValue)
where TSource : IComparable
{
return source.Aggregate(defaultValue, (a, b) => a != null && a.CompareTo(b) > 0 ? a : b);
@elvisgs
elvisgs / vinuz-exalted-dice-roller.mrc
Created March 21, 2011 03:41
VinuZ Exalted Dice Roller
;VinuZ Exalted Dice Roller 1.0.4 ***********************************************************************************
on *:load: { set %ord off | set %master $$?="Digite o nick do mestre" | echo Vinuz Exalted Dice Roller loaded. }
;on *:unload: { unset %init.* | unset %turn.* | unset %ord | unset %master }
;!roll <numero_de_dados> [dificuldade]
on *:text:!roll*:#Kgaio: {
var %nd $$2