Skip to content

Instantly share code, notes, and snippets.

View chenkie's full-sized avatar

Ryan Chenkie chenkie

View GitHub Profile
import { PrismaClient } from '@prisma/client';
const prisma = global.prisma || new PrismaClient();
if (process.env.NODE_ENV === 'development') global.prisma = prisma;
export default prisma;
// 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
interface FunctionComponent<P = {}> {
(props: PropsWithChildren<P>, context?: any): ReactElement<any, any> | null;
propTypes?: WeakValidationMap<P>;
contextTypes?: ValidationMap<any>;
defaultProps?: Partial<P>;
displayName?: string;
}
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>
[
{
"name": "T-Shirt",
"description": "Great fit, super comfy",
"image": "https://i.imgur.com/KeQtXT3.png",
"price": 25,
"sku": "123"
},
{
"name": "Sweater",
...
return (
<Provider
value={{
authState,
setAuthState: authInfo => setAuthInfo(authInfo)
}}
>
{children}
{
"editor.acceptSuggestionOnEnter": "off",
"editor.hover.enabled": false,
"editor.quickSuggestions": false,
"editor.quickSuggestionsDelay": 10,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestOnTriggerCharacters": false,
"editor.wordBasedSuggestions": false
}
const { ApolloServer, gql } = require('apollo-server');
const parseFields = require('graphql-parse-fields');
const typeDefs = gql`
type User {
firstName: String
lastName: String
age: Int
}
type Speaker {
firstName: String!
lastName: String!
email: String!
avatarLink: String
shortBio: String
fullBio: String
status: String
location: SpeakerLocation
shouldDisplayLocation: Boolean