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 { gql, useMutation, useQuery, useSubscription } from "@apollo/client"; | |
| import React, { useEffect } from "react"; | |
| import { Helmet } from "react-helmet-async"; | |
| import { Link, useHistory, useParams } from "react-router-dom"; | |
| import { Dish } from "../../components/dish"; | |
| import { | |
| VictoryAxis, | |
| VictoryChart, | |
| VictoryLabel, | |
| VictoryLine, |
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 RedisStore = connectRedis(session); | |
| const redis = new Redis(process.env.REDIS_URL); | |
| app.set("trust proxy", 1); | |
| app.use( | |
| cors({ | |
| origin: process.env.CORS_ORIGIN, | |
| credentials: true, | |
| }) | |
| ); | |
| app.use( |
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
| // This is your Prisma schema file, | |
| // learn more about it in the docs: https://pris.ly/d/prisma-schema | |
| datasource db { | |
| provider = "postgresql" | |
| url = env("PG_CONNECTIONSTRING") | |
| } |
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
| generator client { | |
| provider = "prisma-client-js" | |
| previewFeatures = ["orderByRelation", "referentialActions", "nApi"] | |
| } | |
| datasource postgresql { | |
| provider = "postgresql" | |
| url = env("PG_CONNECTIONSTRING") | |
| } |
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
Show hidden characters
| { | |
| "compilerOptions": { | |
| "outDir": "./lib", | |
| "target": "es5", | |
| "module": "esnext", | |
| "baseUrl": ".", | |
| "paths": { | |
| "*": ["src/*"], | |
| "@layout":["src/layout/*"], |
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 React, { useState } from 'react'; | |
| import Link from 'next/link'; | |
| import { Divider } from './devider'; | |
| import { AllArticles } from './Articales'; | |
| import { AllProject } from './AllProject'; | |
| import { Projects } from './syg'; | |
| interface Props { | |
| color: 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 React from "react"; | |
| import { Helmet } from "react-helmet-async"; | |
| import { useForm } from "react-hook-form"; | |
| import { Link } from "react-router-dom"; | |
| import { authTokenVar, isLoginVar } from "../Hocks/useApollo"; | |
| import { Button } from "../components/button"; | |
| import {MessageError}from'../components/Form/errorrMessage' | |
| import { Input } from "../components/Form/input"; | |
| import { LOCALSTORAGE_TOKEN } from "../cosntatns"; | |
| import { useLoginMutationMutation as useLoginMutation } from "../generated/graphql"; |
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 { NextApiRequest, NextApiResponse } from 'next'; | |
| import NextAuth, { InitOptions } from 'next-auth'; | |
| import Providers from 'next-auth/providers'; | |
| import { SessionUser } from 'lib/data-types'; | |
| import { getUserFromId, updateUser } from 'db/user-dao'; | |
| const options: InitOptions = { | |
| providers: [ | |
| Providers.GitHub({ | |
| clientId: process.env.GITHUB_ID || '', |
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
| // call by value when you are used any the prmitive type like | |
| // number ,string ,boolean ,undefined ,null like | |
| // are always assigned/passed by | |
| // value-copy: null, undefined, string, number, boolean, and ES6’s symbol. | |
| // - First: Pass by value example | |
| // some hint | |
| // The original variable is not modified on changes in other variables. | |
| let x=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
| type Operation="+"|"-"|"*"|"/" | |
| function calcalater(a:Array<number>=[1,2,3],b:Array<number>=[5,2,3],operation:Operation='-'){ | |
| let len=a.length>=b.length?a.length:b.length | |
| let res:Array<number>=[] | |
| for(let i=0;i<len;i++){ | |
| let first | |
| let secand | |
| if(operation==='+' ||operation==="-"){ |