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"; | |
import { auth } from "../firebase"; | |
import { | |
signInWithPopup, | |
GoogleAuthProvider, | |
AuthProvider, | |
getAuth | |
} from "firebase/auth"; | |
import { useAuthState } from "react-firebase-hooks/auth"; |
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
model Owner { | |
id Int @id @default(autoincrement()) | |
name String | |
dogs Dog[] | |
} | |
model Dog { | |
id Int @id @default(autoincrement()) | |
name String | |
age Int @default(1) |
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 { PrismaClient } from "@prisma/client"; | |
const prisma = new PrismaClient(); | |
// * DOGGOS | |
const fetchAllDoggos = async () => { | |
const dogs = await prisma.dog.findMany({ include: { owner: true } }); | |
console.log(dogs); | |
}; |
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 Fastify, { FastifyReply, FastifyRequest } from "fastify"; | |
import { PrismaClient } from "@prisma/client"; | |
const prisma = new PrismaClient(); | |
const server = Fastify(); | |
// Route to check if the server is running | |
server.get("/ping", async (request, reply) => { | |
reply.send("Server is running"); | |
}); |
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 Carousel from "./Carousel"; | |
import img1 from "path-to-local-image.jpg"; | |
import img2 from "path-to-local-image.jpg"; | |
import img3 from "path-to-local-image.jpg"; | |
export default function ImageCarousel() { | |
const slides = [img1, img2, img3]; | |
return ( | |
<div className="relative"> |
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
type SomeRes = { | |
id: number; | |
title: string; | |
}; | |
const fetchSomeStuff = async () => { | |
const res = await fetch("..."); | |
if (res.ok) { | |
const data: SomeRes = await res.json(); | |
// no error even tho the link doesn't even exist |