This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sqlite3 | |
import subprocess | |
import tempfile | |
from pathlib import Path | |
from sqlite3 import Error | |
def get_db_location(): | |
return os.path.join(tempfile.gettempdir(), "test.db") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TarefasFlat(): | |
def __init__(self, data): | |
if data is not None: | |
self.dados = self.convert_to_flat_object(data) | |
def convert_to_flat_object(self, data): | |
ativo_flat_list = [] | |
for tarefa in data: | |
ativo_flat_list.append(self.reduce_tarefa_fields(tarefa)) | |
return ativo_flat_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error: | |
'CMRESHandler' object has no attribute '_timer' | |
Execute: | |
sudo hostname localhost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import connexion | |
from flask import request | |
app = connexion.App(__name__, specification_dir="./swagger/") | |
@app.app.before_request | |
def log_request_info(): | |
print('Body: %s', request.get_data()) | |
logger.info('Body: %s', request.get_data()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker volume rm $(docker volume ls -qf dangling=true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM mongo | |
COPY init.json /init.json | |
CMD mongoimport --host mongo --db reach-engine --collection users --type json --file /init.json --jsonArray |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: python | |
matrix: | |
include: | |
- python: 3.6 | |
env: TOXENV=py36 | |
install: | |
- pip install tox | |
script: | |
- tox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.7.1-slim-stretch | |
RUN mkdir -p /usr/src/app | |
WORKDIR /usr/src/app | |
COPY requirements.txt /usr/src/app/ | |
RUN pip3 install --no-cache-dir -r requirements.txt --upgrade | |
COPY . /usr/src/app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: rust | |
rust: | |
- stable | |
- beta | |
script: | |
- cargo build --verbose --all | |
- cargo test --verbose --all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM rust:1.30.1 | |
WORKDIR /usr/src/app | |
COPY . . | |
RUN cargo install | |
CMD ["rust-hello-word"] |