- Node v16.15.0 (LTS)
- NPM v8.5
- Docker Compose v1.29
This file contains hidden or 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
enum PizzaFlavour { | |
CALABREZA = 'CALABREZA', | |
FRANGO_CATUPIRY = 'FRANGO_CATUPIRY', | |
NORDESTINA = 'NORDESTINA', | |
} | |
type PizzaFlavourKey = keyof typeof PizzaFlavour; | |
const pizzaFlavourPriceMap: Map<PizzaFlavourType, number> = new Map<PizzaFlavourKey, number>([ | |
[PizzaFlavour.CALABREZA, 10], |
This file contains hidden or 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
// src/components/Posts.js | |
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
class Posts extends React.Component { | |
render(){ | |
const { posts } = this.props; | |
return ( |
This file contains hidden or 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
-- todos os registros | |
-- musica de maior duração | |
-- mais antiga | |
-- musica maior nome | |
-- album menor nome |
This file contains hidden or 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
-- todos os registros | |
SELECT * FROM tracks; | |
-- musica de maior duração | |
SELECT * FROM tracks ORDER BY duration DESC LIMIT 1; | |
-- mais antiga | |
SELECT * FROM tracks ORDER BY release_date ASC LIMIT 1; | |
-- musica maior nome | |
SELECT *, length(name) AS char_qtt FROM tracks ORDER BY LENGTH(name) DESC LIMIT 1; | |
SELECT *, MAX(LENGTH(name)) as maior_nome FROM tracks; | |
-- album menor nome |
This file contains hidden or 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
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; | |
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; | |
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES'; | |
DROP database IF EXISTS `northwind-dev` ; | |
CREATE database IF NOT EXISTS `northwind-dev` DEFAULT CHARACTER SET latin1 ; | |
USE `northwind-dev` ; | |
-- ----------------------------------------------------- | |
-- Table `northwind-dev`.`customers` |
- Academia
- Dados
- Problema:
- Uma academia quer fazer um sistema que gerencia as fichas de treino das pessoas que lá treinam
- Premissas
- Cada ficha:
- só pode estar vinculada a uma pessoa cliente.
- Cada ficha:
- tem uma pessoa responsável que é professora na academia.
This file contains hidden or 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
// no mongo ou mongosh | |
// use aula_29_2; | |
// no vscode \/ | |
// use("aula_29_2"); | |
db.filmes.drop(); | |
db.filmes.insertMany( | |
[ |
This file contains hidden or 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
# PetTrybe - Testes (pré TFC ⚽) | |
- Assuntos importantes | |
- Mockar JWT ✅ | |
- Associações (propriedades a mais) ✅ | |
- Tipagem de stubs ✅ | |
- Cobertura de testes :x: | |
- Script | |
- Introdução | |
- Dar contexto que aplicaremos testes de integração |
This file contains hidden or 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
const connection = require('./connection'); | |
const insert = async (travel) => { | |
const { passengerId, startingAddress, endingAddress } = travel; | |
const [{ insertId }] = await connection.execute( | |
'INSERT INTO travels' | |
+ '(passenger_id, starting_address, ending_address)' | |
+ 'VALUE (?, ?, ?)', | |
[passengerId, startingAddress, endingAddress], |