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 { render, screen, fireEvent } from '@testing-library/react'; | |
import PortaMisteriosa from './PortaMisteriosa'; | |
describe('quando carregar o componente', () => { | |
test('deve mostrar a porta e o botão de abrir porta', () => { | |
render(<PortaMisteriosa />); | |
expect(screen.getByText(/Você vê uma porta/i)).toBeInTheDocument(); | |
expect(screen.getByText(/Abrir Porta/i)).toBeInTheDocument(); | |
}); | |
}) |
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 React, { useState } from 'react'; | |
function PortaMisteriosa({ qualMonstroEh }) { | |
const [aberta, setAberta] = useState(false); | |
const [monstro, setMonstro] = useState(qualMonstroEh); | |
const [monstroAparece, setMonstroAparece] = useState(false); | |
const [vezesQueAbriAPorta, setVezesQueAbriAPorta] = useState(1); | |
const abrirPorta = () => { |
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
/* | |
O Azimute está relacionado à topografia. | |
Ele é basicamente o ângulo calculado entre um ponto e | |
o norte, onde o ponto é importado de uma estação total. | |
Porém a unidade de trabalho que devemos utilizar | |
é graus minutos e segundos. | |
Recebemos o mesmo em decimal e precisamos convertê-lo | |
*/ |
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
version: "3" | |
services: | |
rails: | |
build: . | |
env_file: | |
- .env | |
command: ruby bin/rails s -p 5000 -b '0.0.0.0' | |
volumes: | |
- ".:/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
FROM ruby:2.5.5 | |
ENV EDITOR="/bin/true" | |
# Install container dependencies | |
RUN apt-get update && apt-get install -y git libc-ares2 postgresql-client --no-install-recommends && rm -rf /var/lib/apt/lists/ | |
# Install NodeJS Version 12 to use MJML templates | |
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - | |
RUN apt-get install -y nodejs && npm install -g mjml@4.3.0 | |
ENV PATH $PATH:/node_modules/mjml/lib | |
# Set the work directory inside container | |
RUN mkdir /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
/* | |
Descrição do problema: | |
Temos uma função chamada listWithPagination que retorna um array de registros paginados. | |
A única maneira de conseguir um array com todos os registros, | |
é fazer requisições sequenciais para cada página, concatenando os resultados. | |
Descrição da solução: | |
Criar uma função chamada concatenateResults, que receba como parâmetro a função original | |
que retorna os dados paginados, e chama essa função sequencialmente para cada página, | |
até que a resposta seja um array vazio, o que indica que a paginação terminou. |
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
#!/bin/bash | |
port=8080 | |
url="http://localhost:$port" | |
echo abrindo a aplicação no navegador | |
# se o s.o. for linux | |
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then | |
xdg-open "$url" | |
# se o s.o. for windows 32 bits | |
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then | |
start "$url" |
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
SELECT DISTINCT | |
/*Informacoes do Objeto*/ | |
o.id, | |
o.nome, | |
o.descricao, | |
o.observacao, | |
/*Pre Lances por Objeto, num leilão específico*/ | |
C.lista_leiloes_pre_lances, | |
/*Valores do Objeto e Informações de Venda*/ | |
o.vendido, |