Skip to content

Instantly share code, notes, and snippets.

View diegosorrilha's full-sized avatar

Diego Sorrilha diegosorrilha

View GitHub Profile
@diegosorrilha
diegosorrilha / contrib>env-sample
Last active June 6, 2019 20:17
Django + S3 Storage Configuration
# STORAGE CONFIGURATION IN S3 AWS
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_STORAGE_BUCKET_NAME=
@diegosorrilha
diegosorrilha / django-start-deploy-heroku.sh
Last active September 29, 2016 18:25
Script that creates a app in heroku and deploy a Django App.
# Shell script to create a app in heroku and deploy this.
# Working for python 3.5.0
# This script require heroku toolbelt installed and configured
# Usage:
# cd my_django_project
# curl https://gist.githubusercontent.com/diegosorrilha/68e2f411265c81e79ebc379a9ac26d49/raw/6b9c22779bbaf58a9de914ac78848f4701211e2b/django-start-deploy-heroku.sh -o ../django-start-deploy-heroku.sh
# WARNING: <namemyappdjango> Name need be same of the your app django
# source ../django-start-deploy-heroku.sh namemyappdjango
@diegosorrilha
diegosorrilha / django-start.sh
Last active December 28, 2016 22:18
Script that creates a basic Django project with a simple home page, 3 tests and settings using python-decouple.
# Shell script to create a basics Django project.
# This script require Python 3.x and pyenv
# This script was based in gist of @rg3915 => https://gist.github.com/rg3915/a264d0ade860d2f2b4bf
# The project contains:
# Settings config to Django 1.10
# Admin config
# Tests in view home
# Download:
#! /usr/bin/env python
import posixpath
import argparse
import urllib
import os
from SimpleHTTPServer import SimpleHTTPRequestHandler
from BaseHTTPServer import HTTPServer
@diegosorrilha
diegosorrilha / secret_gen.py
Created January 3, 2016 21:09 — forked from henriquebastos/secret_gen.py
SECRET_KEY generator.
#!/usr/bin/env python
"""
Django SECRET_KEY generator.
"""
from django.utils.crypto import get_random_string
chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
print(get_random_string(50, chars))
@diegosorrilha
diegosorrilha / fluxo_de_trabalho_para_merge.md
Created November 23, 2015 16:33
Fluxo de trabalho p/ merge

Fluxo de trabalho atual (merges)

Introdução

O fluxo apresentado abaixo baseia-se no modelo de Feature Branches com release, isto é, cada nova feature gera um novo branch, que é integrado com o develop. Esse, por sua vez, aguarda a data de liberação de uma release para ser integrado ao master.

@diegosorrilha
diegosorrilha / bobp-python.md
Created November 23, 2015 16:22 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens

Commands Unix (Mac OS)

Command Sample Description
pipe - Liga a saida de um comando na entrada de outro
&& cmd && cmd Executa um comando logo após o outro
cat cat Duplica o conteúdo digitado (ctrl+d = sair)
cat cat file.txt Lê um arquivo (ctrl+d = sair)
cat cat > file.txt Cria um arquivo com o conteúdo digitado (ctrl+d = sair)