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 from 'react' | |
import { | |
View, | |
ScrollView, | |
StyleSheet, | |
Image, | |
Switch, | |
TouchableOpacity, | |
TouchableHighlight, | |
TouchableWithoutFeedback, |
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
const bcrypt = require("bcrypt"); | |
const db = require("../models"); | |
const jwt = require("jsonwebtoken"); | |
const User = db.users; | |
const signup = async (req, res)=> { | |
try { | |
const {userName, password, email} = req.body; | |
const 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
function searchBinary(arrays, item) { | |
let baixo = 1 | |
let alto = (arrays - 1) | |
if(baixo <= alto) { | |
let meio = (baixo + alto)/ 2 | |
let chute = arrays[meio] | |
if (chute == item) { | |
return meio | |
} | |
if(chute > item) { |
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
// app.js | |
import Clock from './deps/clock.js'; | |
import View from './views.js'; | |
const view = new View(); | |
const clock = new Clock() | |
let took = '' | |
view.configureOnFileChange (file=> { |
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
package com.example.crud.controllers; | |
import com.example.crud.domain.product.Product; | |
import com.example.crud.domain.product.ProductRepository; | |
import com.example.crud.domain.product.RequestProductDTO; | |
import jakarta.persistence.EntityNotFoundException; | |
import jakarta.validation.Valid; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.http.ResponseEntity; | |
import org.springframework.transaction.annotation.Transactional; | |
import org.springframework.web.bind.annotation.*; |
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 { useEffect, useState } from 'react' | |
import {api} from './api/api' | |
interface IDescription { | |
description:string; | |
id:string; | |
} |
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 { Injectable } from '@nestjs/common'; | |
import { PrismaService } from '../services/prisma.service'; | |
import { BooksDto } from './../booksDto/books.dto'; | |
@Injectable() | |
export class BooksService { | |
constructor(private prisma: PrismaService) {} | |
async create(data: BooksDto) { |
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 Head from 'next/head' | |
import Image from 'next/image' | |
import { useEffect, useState } from 'react'; | |
import {api} from './api/api' | |
interface IBooks { | |
id:string; | |
title:string; | |
author:string; | |
year:string; |
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
//fazendo a interface entender que devo trazer dados de um array | |
const [books, setBook] = useState<IBooks[]>([]); | |
//na chamada da lista(ul) estava colocado a chamada do map errado mas corrigir dessa forma: | |
{books.map((item) => ( | |
<li key={item.id}> | |
{item.title} | |
</li> | |
))} //coloquei as chaves e parentenses de forma correta |
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 Head from 'next/head' | |
import Image from 'next/image' | |
import { useEffect, useState } from 'react'; | |
import {api} from './api/api' | |
interface IBooks { | |
title: string; | |
} | |
export default function Home() { |
NewerOlder