Skip to content

Instantly share code, notes, and snippets.

View anapaulagomes's full-sized avatar

Ana Paula Gomes anapaulagomes

View GitHub Profile
CRATE_SIZE = 24
def beer_formula(rsvps):
minimum = 1.3
maximum = 2
return int(minimum * rsvps), int(maximum * rsvps)
>>> f" Ana ".center(50, "o")
'oooooooooooooooooooooo Ana ooooooooooooooooooooooo'
@anapaulagomes
anapaulagomes / from_mommy_to_bakery.py
Created October 11, 2019 16:24
Helping people moving from model_mommy to model_bakery
"""
Migrate from model_mommy to model_bakery.
``python from_mommy_to_bakery.py --dry-run``
"""
import argparse
import os
import re
@anapaulagomes
anapaulagomes / from_mommy_to_bakery.py
Last active October 17, 2019 18:02
Helping people moving from model_mommy to model_bakery
"""
Migrate from model_mommy to model_bakery.
``python from_mommy_to_bakery.py --dry-run``
Please check your dependency files.
"""
import argparse
import os
@anapaulagomes
anapaulagomes / tricks.py
Created October 27, 2019 17:36
Python tricks
# install dependencies from .cfg file (from https://stackoverflow.com/a/46573039/1344295)
python -c "import configparser; c = configparser.ConfigParser(); c.read('setup.cfg'); print(c['options']['install_requires'])" | xargs pip install
@anapaulagomes
anapaulagomes / override_silently.py
Created November 7, 2019 11:03
Find methods and classes override by Python silently
"""Find class or methods override by Python silently."""
import argparse
import os
import re
from pprint import pprint
CLASS_OR_METHOD = r'\b(class|def) (.*)\('
CLASS_OR_METHOD_PATTERN = re.compile(CLASS_OR_METHOD)
@anapaulagomes
anapaulagomes / README.md
Last active October 3, 2024 06:13
Classificação da Despesa Orçamentária por Natureza
@anapaulagomes
anapaulagomes / README.md
Created June 5, 2020 19:50
Beneficiários do Auxílio Emergencial em Feira de Santana
@anapaulagomes
anapaulagomes / README.md
Last active June 24, 2020 13:41
Filtra dados do Auxílio Emergencial por Código do Município no IBGE
@anapaulagomes
anapaulagomes / api.py
Last active September 7, 2020 10:27
Twilio Call Queue
from flask import Flask, request
from twilio.twiml.voice_response import Dial, VoiceResponse, Gather
from calls import CallQueue
call_queue = CallQueue("support")
app = Flask(__name__)
AGENTS = {
"+000000000001": "Ana",