Skip to content

Instantly share code, notes, and snippets.

@augustovictor
augustovictor / app.py
Created January 27, 2024 16:58
Simple python app
# --- app.py ---
from flask import Flask, jsonify
import os
app = Flask(__name__)
@app.route('/health')
def health():
return 'Healthy', 200
create table company_divisions (
department varchar(100),
company_division varchar(100),
primary key (department)
);
insert into company_divisions values ('Automotive','Auto & Hardware');
insert into company_divisions values ('Baby','Domestic');
insert into company_divisions values ('Beauty','Domestic');
{
"gameId": 2585564703,
"gameCreation": 1504029869598,
"gameDuration": 2752,
"mapId": 11,
"seasonId": 9,
"gameMode": "CLASSIC",
"gameType": "MATCHED_GAME",
"teams": [
{
@Repository
@Transactional
public class SingerServiceImpl implements SingerService {
final static String ALL_SINGER_NATIVE_QUERY =
"select id, first_name, last_name, birth_date, version from singer";
private Log log =
LogFactory.getLog(SingerServiceImpl.class);
@PersistenceContext
private EntityManager em;
...
task generateQueryDSL(type: JavaCompile, group: 'build',
description: 'Generates the QueryDSL query types') {
source = sourceSets.main.java
classpath = configurations.compile + configurations.querydslapt
options.compilerArgs = [
"-proc:only",
"-processor", "org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor"
]
destinationDir = sourceSets.generated.java.srcDirs.iterator.next
}
curl --request POST \
--url 'your-jira-org/rest/api/3/issue' \
--user 'your-jira-email:your-jira-api-key' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"fields": {
"summary": "Summit 2019 is awesome!",
"issuetype": {
"name": "Bug"
class Solution {
fun reverseStrRecursively(str: String): String {
return if (str.length == 1) str
else reverseStrRecursively(str.substring(1, str.length)) + str.substring(0, 1)
}
fun reverseStrIteratively(str: String): String {
val result = mutableListOf<String>()
var i = str.length
@SpringBootApplication
class MedAvailableApplication
fun main(args: Array<String>) {
val application = runApplication<MedAvailableApplication>(*args).getBean(GuiaContabilRepository::class.java)
val result = application.save(ImportacaoContrato())
}
///////////////////////////////////////////////////

Code review checklist

Analizando o valor de negócio

Verificar primeiro se o valor de negócio está sendo entregue, ou seja, se o teste funcional é aprovado.

O ponto aqui é que se temos a funcionalidade entregando a feature esperada, podemos avaliar se temos tempo para refactoring. Caso contrário podemos assumir o débito técnico e cadastrar uma nova task no gerenciador de tarefas.

Não execute testes manuais, garanta testes automatizados. Pros:

  • No time is spent creating a script for how to setup the environment for the test
#!/bin/sh
TERRAFORM_DIR=./terraform
APP_PROPERTIES_DIR=./src/main/resources
TERRAFORM_SSM_FILE="${TERRAFORM_DIR}/ssm.tf"
APP_PROPERTIES_FILE="${APP_PROPERTIES_DIR}/application.properties"
TERRAFORM_SSM_PROPERTY_PREFIX=""