Skip to content

Instantly share code, notes, and snippets.

@gassantos
gassantos / SqlAlchemyGet.py
Created September 27, 2022 12:15 — forked from Razzo78/SqlAlchemyGet.py
Python, SQL Server - Connect and get data with SqlAlchemy
from sqlalchemy import create_engine, MetaData, Table
from sqlalchemy.orm import mapper
from sqlalchemy.sql import select
class MyTable(object):
pass
# Trusted Connection
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
pool:
vmImage: 'windows-latest'
@gassantos
gassantos / GitCommitEmoji.md
Created August 14, 2021 04:45 — forked from HelioCampos/GitCommitEmoji.md
Git Commit message Emoji
@gassantos
gassantos / gitflow.md
Created August 14, 2021 04:43 — forked from HelioCampos/gitflow.md
Manual de git flow

GIT FLOW

Instalando

MAC OS X:

brew install git-flow

UBUNTU/LINUX:

sudo apt-get install git-flow

Inicializando

@gassantos
gassantos / SQLAlchemyMSSQL.py
Created May 20, 2021 01:56
Exemplo de CRUD com SQLAlchemy e MS SQL Server.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Exemplo de CRUD com SQLAlchemy e MS SQL Server.
Em caso de problemas na instalação com ``pip install pyodbc``
pode-se utilizar: `pyodbc <https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyodbc>`_
Além do conector é necessária a instalação do driver do SQL Server:
- `Windows <https://docs.microsoft.com/pt-br/sql/connect/odbc/windows/system-requirements-installation-and-driver-files?view=sql-server-2017#installing-microsoft-odbc-driver-for-sql-server>`_.
@gassantos
gassantos / README.md
Created March 5, 2021 14:55 — 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:

@gassantos
gassantos / query_finder.sql
Created September 3, 2018 13:36 — forked from mezis/query_finder.sql
Finding long-running queries in MySQL
SELECT id,state,command,time,left(replace(info,'\n','<lf>'),120)
FROM information_schema.processlist
WHERE command <> 'Sleep'
AND info NOT LIKE '%PROCESSLIST%'
ORDER BY time DESC LIMIT 50;
@gassantos
gassantos / edm2.ipynb
Created August 29, 2018 23:06 — forked from ruizendaalr-zz/edm2.ipynb
EDM_student_grade_prediction
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gassantos
gassantos / oracle.pl
Created April 7, 2016 14:18 — forked from lorn/oracle.pl
Script perl para Oracle
#!/usr/bin/perl
use strict;
use warnings;
use DBD::Oracle qw(:ora_session_modes);
### Variaveis e conexao ao Oracle.
my $oracle_hostname = $ARGV[0];
my $oracle_database = $ARGV[1];
my $oracle_port = $ARGV[2];
my $oracle_username = 'SYS';