Skip to content

Instantly share code, notes, and snippets.

View joaodaher's full-sized avatar
🎯
Focusing

Joao Daher joaodaher

🎯
Focusing
View GitHub Profile
from dataclasses import dataclass
from typing import Dict, Any
from urllib.parse import urlparse
import requests
from django.core.cache import cache
from rest_framework import status
from tenacity import retry, stop_after_delay, retry_if_exception_type
DEFAULT_PAGE_SIZE: int = 50
@joaodaher
joaodaher / setup.py
Last active March 31, 2020 17:48
Pipfile to setup.py install_requires
import json
import os
from setuptools import find_packages, setup
def read(f):
return open(f, 'r', encoding='utf-8').read()
def parse_requirements():
@joaodaher
joaodaher / content_api_checker.py
Last active September 25, 2018 16:46
Test all possible v1 endpoints from Content API, comparing staging and development environments
import requests
from dateutil.parser import parse
class DictDiffer(object):
"""
Calculate the difference between two dictionaries as:
(1) items added
(2) items removed
(3) keys same in both but changed values
from datetime import datetime
def _ordinal(day):
SUFFIX = {
1: 'st',
2: 'nd',
3: 'rd',
}
if day in [11, 12, 13]:

Fluxo de desenvolvimento

Branches

Master

Cada commit nessa branch deve ser considerado pronto para deploy em produção (ContinuousIntegration-ready)

  • Branch off: -
  • Merge to: hotfix/
Run Docker daemon
brew install socat
socat TCP-LISTEN:2375,reuseaddr,fork UNIX-CONNECT:/var/run/docker.sock
In PyCharm, go to Preferences>Build,Execution>Docker and add a new:
API URL: tcp://localhost:2375
Certficates Folder: <empty>
Docker Compose Executable: /Applications/Docker.app/Contents/Resources/bin/docker-compose