const foo = 123;
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 {GraphQLClient, gql} from 'graphql-request'; | |
const client = new GraphQLClient('https://api.shopify.com/graphql', { | |
headers: { | |
authorization: 'Bearer MY_TOKEN' // environment variables here | |
} | |
}); | |
const GET_PRODUCTS = gql` | |
query GetProducts($query: 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 axios from 'axios'; | |
import bcrypt from 'bcryptjs'; | |
import { | |
AuthenticationError, | |
ForbiddenError, | |
UserInputError, | |
gql | |
} from 'apollo-server-express'; | |
import {Op} from 'sequelize'; | |
import {User} from '../db'; |
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 from 'react'; | |
import theme from './src/gatsby-plugin-chakra-ui/theme'; | |
import {getColor} from '@chakra-ui/theme-tools'; | |
// a helper function to create color variables given a variable name and theme keys | |
function createVar(name, light, dark) { | |
return ` | |
root.style.setProperty( | |
'${name}', | |
mql.matches |
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 PackGrid, {CardSkeleton, PacksLoading} from '../PackGrid'; | |
import PackLoader from './PackLoader'; | |
import PropTypes from 'prop-types'; | |
import React, {useEffect, useState} from 'react'; | |
import {NetworkStatus, gql, useQuery} from '@apollo/client'; | |
import {PACK_LISTING_FRAGMENT} from '../../utils'; | |
import {Text} from '@chakra-ui/core'; | |
const LIST_PACKS = gql` | |
query ListPacks( |
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 PageLayout from './PageLayout'; | |
import PropTypes from 'prop-types'; | |
import React from 'react'; | |
import getShareImage from '@jlengstorf/get-share-image'; | |
import {Helmet} from 'react-helmet'; | |
export default function PostLayout({children, pageContext}) { | |
const {title, description, tags} = pageContext.frontmatter; | |
const shareImage = getShareImage({ | |
title, |
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
update packs set old_id = id; | |
create extension "uuid-ossp"; | |
alter table packs alter column id set data type uuid using (uuid_generate_v4()); | |
update "packWords" P set "packId2" = (select id from packs where old_id = P."packId"); | |
update "games" P set "packId2" = (select id from packs where old_id = P."packId"); | |
drop sequence packs_id_seq; |
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 PropTypes from 'prop-types'; | |
import React, {useState} from 'react'; | |
import {BLOCK_FRAGMENT, CREATE_SIGNED_URL, uploadFile} from '../utils'; | |
import {Box, Button, Flex, Input, Stack, Text, Textarea} from '@chakra-ui/core'; | |
import {gql, useMutation} from '@apollo/client'; | |
const CREATE_BLOCK = gql` | |
mutation CreateBlock($input: CreateBlockInput!) { | |
createBlock(input: $input) { | |
...BlockFragment |
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
async function uploadFile(file, url, handleProgress) { | |
return new Promise((resolve, reject) => { | |
const req = new XMLHttpRequest(); | |
req.upload.addEventListener('progress', handleProgress); | |
req.addEventListener('load', () => resolve(true)); | |
req.addEventListener('error', () => { | |
const error = new Error('Upload failed'); | |
reject(error); | |
}); |
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 {Trick} from '../db'; | |
import {gql} from 'apollo-server'; | |
export const typeDef = gql` | |
type Attempt { | |
id: ID | |
successful: Boolean | |
offense: Boolean | |
redos: Int | |
skaterId: String |
NewerOlder