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 express = require("express"); | |
const app = express(); | |
var users = [{ | |
name: "Harsh", | |
kidneys: [{ | |
healthy: false, | |
}, { | |
healthy:true, | |
}] | |
}] |
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 express = require("express"); | |
const app = express(); | |
app.get("/health-checkup", function (req, res) { | |
// do health checks here | |
const kidneyId = req.query.kidneyKid; | |
const username = req.headers.username; | |
const password = req.headers.password; | |
if (username != "harsh" && password != "pass") { | |
res.status(403).json({ | |
msg: "User doesnt exist", |
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 express = require("express"); | |
const jwt = require("jsonwebtoken"); | |
const jwtPassword = "123456"; | |
const app = express(); | |
app.use(express.json()); | |
const ALL_USERS = [ | |
{ | |
username: "harkirat@gmail.com", | |
password: "123", |
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
import { Link, useLocation } from "react-router-dom"; | |
import { gradientBackgroundStyle } from "../utils/constants"; | |
import { useState, useEffect } from "react"; | |
const Header = () => { | |
const [isLogin, setIsLogin] = useState(false); | |
const location = useLocation(); | |
useEffect(() => { | |
// Update isLogin state based on the current route |
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
import { PrismaClient } from '@prisma/client/edge' | |
import { withAccelerate } from '@prisma/extension-accelerate' | |
import { Hono } from "hono"; | |
import { verify } from 'hono/jwt'; | |
export const blogRouter = new Hono<{ | |
Bindings: { | |
DATABASE_URL: string; | |
JWT_SECRET: string; | |
}, |
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
import tiktoken | |
enc = tiktoken.encoding_for_model("gpt-4") | |
text = "Hello, GPT" | |
tokens = enc.encode(text) | |
print(tokens) |