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 = global.prisma || new PrismaClient(); | |
if (process.env.NODE_ENV === 'development') global.prisma = prisma; | |
export default prisma; |
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
// get all tweets from @prisma | |
from:prisma | |
// tweets between two accounts | |
from:ryanchenkie to:chris__sev | |
// tweets by a hashtag but only with images | |
#InaugurationDay filter:images | |
// keywords by people on a specific list |
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
interface FunctionComponent<P = {}> { | |
(props: PropsWithChildren<P>, context?: any): ReactElement<any, any> | null; | |
propTypes?: WeakValidationMap<P>; | |
contextTypes?: ValidationMap<any>; | |
defaultProps?: Partial<P>; | |
displayName?: 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 React, { useState } from 'react'; | |
// types and interfaces for props | |
type DashboardProps = { | |
totalSales: number; | |
}; | |
const Dashboard: React.FC<DashboardProps> = (props) => ( | |
<section> | |
<p>Total Sales: {props.totalSales}</p> |
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
[ | |
{ | |
"name": "T-Shirt", | |
"description": "Great fit, super comfy", | |
"image": "https://i.imgur.com/KeQtXT3.png", | |
"price": 25, | |
"sku": "123" | |
}, | |
{ | |
"name": "Sweater", |
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
... | |
return ( | |
<Provider | |
value={{ | |
authState, | |
setAuthState: authInfo => setAuthInfo(authInfo) | |
}} | |
> | |
{children} |
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
{ | |
"editor.acceptSuggestionOnEnter": "off", | |
"editor.hover.enabled": false, | |
"editor.quickSuggestions": false, | |
"editor.quickSuggestionsDelay": 10, | |
"editor.suggest.snippetsPreventQuickSuggestions": false, | |
"editor.suggestOnTriggerCharacters": false, | |
"editor.wordBasedSuggestions": false | |
} |
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 { ApolloServer, gql } = require('apollo-server'); | |
const parseFields = require('graphql-parse-fields'); | |
const typeDefs = gql` | |
type User { | |
firstName: String | |
lastName: String | |
age: Int | |
} |
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 Speaker { | |
firstName: String! | |
lastName: String! | |
email: String! | |
avatarLink: String | |
shortBio: String | |
fullBio: String | |
status: String | |
location: SpeakerLocation | |
shouldDisplayLocation: Boolean |
NewerOlder