Skip to content

Instantly share code, notes, and snippets.


Ryan Chenkie chenkie

View GitHub Profile
View globalPrisma.js
import { PrismaClient } from '@prisma/client';
const prisma = global.prisma || new PrismaClient();
if (process.env.NODE_ENV === 'development') global.prisma = prisma;
export default prisma;
View twitter-advanced-search.txt
// get all tweets 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
View function-component-interface.ts
interface FunctionComponent<P = {}> {
(props: PropsWithChildren<P>, context?: any): ReactElement<any, any> | null;
propTypes?: WeakValidationMap<P>;
contextTypes?: ValidationMap<any>;
defaultProps?: Partial<P>;
displayName?: string;
View react-types.ts
import React, { useState } from 'react';
// types and interfaces for props
type DashboardProps = {
totalSales: number;
const Dashboard: React.FC<DashboardProps> = (props) => (
<p>Total Sales: {props.totalSales}</p>
View shirt-shop-data.json
"name": "T-Shirt",
"description": "Great fit, super comfy",
"image": "",
"price": 25,
"sku": "123"
"name": "Sweater",
View AuthContext.js
return (
setAuthState: authInfo => setAuthInfo(authInfo)
View disable-vscode-autocomplete.json
"editor.acceptSuggestionOnEnter": "off",
"editor.hover.enabled": false,
"editor.quickSuggestions": false,
"editor.quickSuggestionsDelay": 10,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestOnTriggerCharacters": false,
"editor.wordBasedSuggestions": false
View graphql-parse-fields.js
const { ApolloServer, gql } = require('apollo-server');
const parseFields = require('graphql-parse-fields');
const typeDefs = gql`
type User {
firstName: String
lastName: String
age: Int
View speakdotdev.graphql
type Speaker {
firstName: String!
lastName: String!
email: String!
avatarLink: String
shortBio: String
fullBio: String
status: String
location: SpeakerLocation
shouldDisplayLocation: Boolean