Skip to content

Instantly share code, notes, and snippets.

wget https://github.com/oracle/python-cx_Oracle/archive/master.zip
unzip master.zip
cd python-cx_Oracle-master
wget https://github.com/oracle/odpi/archive/master.zip
unzip master.zip
rm -rf odpi
mv -i odpi-master odpi
python setup.py install
@rafaelreuber
rafaelreuber / boleto.py
Created April 23, 2019 03:19
Geração de boleto usando python-boleto
def gerar_itau(fatura, bank, encargos=0):
invoice = BoletoItau()
invoice.data_vencimento = fatura.dtvencto.date()
invoice.data_documento = fatura.dtemissao
invoice.nosso_numero = fatura.nosso_numero
invoice.numero_documento = fatura.fatura
invoice.valor_documento = fatura.valor
empresa = Empresa.objects.get(pk=settings.STUR_EMPRESA)
@rafaelreuber
rafaelreuber / gist:1203967
Created September 8, 2011 17:15
Algoritmo de altura
function height(root){
if(root.isLeaf()) { //Se for folha
return 0;
}
else {
var h = 0;
h = Math.max(height(root.left),h);
h = Math.max(height(root.right),h);
return h + 1;
}