Skip to content

Instantly share code, notes, and snippets.

View OtavioBraga's full-sized avatar

Otavio Braga OtavioBraga

View GitHub Profile
@OtavioBraga
OtavioBraga / gist:e25890b9c53756fa18990ffc51fb8158
Created September 27, 2016 14:48
debian initial configs for using docker-compose
ssh get-them-all
apt-get update
apt-get install -y apt-transport-https ca-certificates
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo debian-jessie main" > /etc/apt/sources.list.d/docker.list
apt-get update
@OtavioBraga
OtavioBraga / get-them-all.txt
Created September 27, 2016 14:50
Debian jessie initial configs for using docker-compose
ssh get-them-all
apt-get update
apt-get install -y apt-transport-https ca-certificates
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo debian-jessie main" > /etc/apt/sources.list.d/docker.list
apt-get update
@OtavioBraga
OtavioBraga / script.sh
Created May 10, 2017 13:45
Gist for install python 3 with pip
sudo apt-get update
sudo apt-get install python3-dev python3-pip
@OtavioBraga
OtavioBraga / script.sh
Last active May 10, 2017 14:07
Script to create a virtualenv with python 3 using virtualenv wrapper
# Você pode colocar o nome que quiser no ambiente :)
mkvirtualenv nome-do-meu-ambiente --python=python3
@OtavioBraga
OtavioBraga / script.sh
Last active May 10, 2017 14:34
Script to install pytest with coverage
pip install pytest coverage pytest-cov flask
@OtavioBraga
OtavioBraga / script.sh
Created May 10, 2017 14:52
Script to create a basic flask test project
mkdir flask-tdd
cd flask-tdd
touch app.py
touch test_core.py
@OtavioBraga
OtavioBraga / test_core.py
Last active May 10, 2017 15:11
basic test for a flask application using pytest
# Importamos nosso app
from app import meu_web_app
# Importamos a biblioteca de testes
import unittest
class TestHomeView(unittest.TestCase):
'''
cd flask-tdd
py.test
@OtavioBraga
OtavioBraga / app.py
Created May 10, 2017 17:50
Basic flask hello world
from flask import Flask
meu_web_app = Flask('meu_web_app')
@meu_web_app.route('/')
def pagina_inicial():
return "Hello World"
@OtavioBraga
OtavioBraga / script.sh
Created May 10, 2017 18:08
Pytest with coverage
# py.test --cov=name-of-your-app
py.test --cov=app