Skip to content

Instantly share code, notes, and snippets.

View nenodias's full-sized avatar

Horácio Dias Baptista Neto nenodias

View GitHub Profile
@nenodias
nenodias / migrate.py
Last active March 29, 2023 02:45
Arquivo de Migração de Base Firebird para Postgresql
# -*- coding:utf-8 -*-
from pdb import set_trace
from sqlalchemy import create_engine, MetaData
from sqlalchemy import Column, Integer, String, Table, Text
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
metadata = MetaData()
FIREBIRD = 'firebird+fdb://sysdba:[email protected]:3050//var/lib/firebird/2.5/data/millenium.fdb?charset=ISO8859_1'
@nenodias
nenodias / exemplo.py
Last active November 22, 2016 11:45
Flask example
# -*- coding:utf-8 -*-
'''
(py3) hdias@hdias-SUPPORT:~/Downloads$ pip install flask
(py3) hdias@hdias-SUPPORT:~/Downloads$ pip install gunicorn
Collecting gunicorn
Using cached gunicorn-19.6.0-py2.py3-none-any.whl
Installing collected packages: gunicorn
Successfully installed gunicorn-19.6.0
(py3) hdias@hdias-SUPPORT:~/Downloads$ gunicorn exemplo:app
@nenodias
nenodias / standalone.conf.bat
Created December 2, 2016 10:17
Correção no encode do wildfly no windows
# Acertar no standalone.conf.bat
set LC_ALL=pt_BR.UTF-8
set LANG=pt_BR.UTF-8
set LANGUAGE=pt_BR.UTF-8
-Dfile.encoding=UTF-8 -Dclient.encoding.override=UTF-8
@nenodias
nenodias / README.md
Last active December 9, 2016 14:16 — forked from rduplain/README.md
Connect to MSSQL using FreeTDS / ODBC in Python.

Goal: Connect to MSSQL using FreeTDS / ODBC in Python.

Host: Ubuntu 11.10 x86_64

Install:

sudo apt-get install freetds-dev freetds-bin unixodbc-dev tdsodbc
pip install pyodbc sqlalchemy

In /etc/odbcinst.ini:

@nenodias
nenodias / barraca-da-limeira.kml
Last active December 12, 2016 18:57
barraca-da-limeira
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Document><name><![CDATA[Barraca da Limeira :wikiloc.com]]></name><Style id="lineStyle"><LineStyle><color>F03399FF</color><width>4</width></LineStyle></Style><Style id="waypointStyle"><IconStyle><Icon><href>http://s0.wklcdn.com/wikiloc/images/pictograms/ge/wpt.png</href></Icon></IconStyle><BalloonStyle><text>$[description]</text></BalloonStyle></Style><Folder><name>Trails</name><open>true</open><Folder><open>false</open><name><![CDATA[Barraca da Limeira]]></name><Placemark><name><![CDATA[Barraca da Limeira]]></name><Snippet maxLines="0"/><styleUrl>#m2448438</styleUrl><description><table width="400" style="color:#666"><tr><td colspan="2" align="left"><a href="http://www.wikiloc.com"><img src="http://s0.wklcdn.com/wikiloc/images/wikiloc.png" alt="Wikiloc" /></a></td></tr><tr><td colspan="2"><font style="font-size:14pt;color:#2B60DE"><![CDATA[Barraca da Limeira]]></font></td></tr><tr><td width="40"><img src="http://s0.wklcdn.com
-- FALHAS
ALTER TABLE falhas ADD COLUMN id bigserial;
ALTER TABLE falhas ADD CONSTRAINT falhas_pkey PRIMARY KEY (id);
-- CADPECAS
ALTER TABLE cadpecas DROP CONSTRAINT cadpecas_pkey;
ALTER TABLE cadpecas ADD COLUMN id bigserial;
ALTER TABLE cadpecas ADD CONSTRAINT cadpecas_pkey PRIMARY KEY (id);
@nenodias
nenodias / ia_busca_star.py
Last active April 22, 2023 01:05
Algoritmo de Busca A* (A-Star) Python
#Matriz visual usada pra montar a matris de adjacência
matriz = [ [0, 1, 2],
[3, 4, 5],
[6, 7, 8], ]
'''
0 | 1 2
---
3 4 5
---
@nenodias
nenodias / gist:7df1e88caf2b15afb8b2b18e3164a068
Created February 6, 2017 12:42
Generate Java Class for Web Service with Wsimport
wsimport -keep -verbose <WSDL_URL>
@nenodias
nenodias / README.md
Last active February 22, 2017 23:32
Simple Http Server Python for static / PHP

python 2

python -m SimpleHTTPServer 8000

#python 3 python -m http.server 8080

#PHP-cli instalado php -S localhost:8000

@nenodias
nenodias / example.md
Created February 17, 2017 22:44
git setting vim

git config --global core.editor "vim"