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
schema: http://localhost:3000/graphql | |
documents: "./src/**/*.graphql" | |
generates: | |
./src/graphql/generated.ts: | |
plugins: | |
- typescript | |
- typescript-operations | |
- typescript-react-query | |
config: | |
fetcher: "./utils#fetcher" |
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
version: '3.8' | |
services: | |
db: | |
image: postgres:14.1-alpine | |
restart: always | |
environment: | |
- POSTGRES_USER=postgres | |
- POSTGRES_PASSWORD=postgres | |
ports: | |
- '5432:5432' |
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, { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react'; | |
import { ethers } from 'ethers'; | |
declare global { | |
interface Window { | |
ethereum: { | |
on: (method: string, callback?: (arg: any) => void) => Promise<any>; | |
request: (args: EthereumRequestArguments) => Promise<any>; | |
removeListener: (method: string, callback?: (arg: any) => void) => Promise<any>; | |
selectedAddress: 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
# Install the most recent version of node or one that is at least v15 | |
nvm install node | |
# Change to this new version | |
nvm use node | |
# Install Rosetta 2, if you haven't already | |
softwareupdate --install-rosetta | |
# Uninstall node v12 and v14, if you installed them before. |
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
// Usage: dispatch(upload(createFormDataDocuments([...event.target.files]))) | |
export const createFormData = (data, isCamelized = false) => { | |
const formData = new FormData() | |
Object.keys(data).forEach(field => { | |
const fieldValue = data[field] | |
const formDataValue = (() => { | |
if (!fieldValue) { | |
return '' | |
} |
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 toggleStreetView = useCallback(() => { | |
const panorama = mapRef.current.getStreetView() | |
panorama.setPosition({ | |
lat: -16.7033165, | |
lng: -49.2747676, | |
}) | |
panorama.setPov({ | |
heading: 265, | |
pitch: 0, | |
}) |
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
//usage: routes.use(authMiddleware) in line above of the following authenticated routes | |
import jwt from 'jsonwebtoken' | |
import { promisify } from 'util' | |
import authConfig from '../config/auth' | |
export default async (req, res, next) => { | |
const authHeader = req.headers.authorization |
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 { useState, useEffect, useContext, createContext } from 'react' | |
import axios from 'axios' | |
const FetchContext = createContext() | |
const url = 'https://jsonplaceholder.typicode.com/posts' | |
const FetchProvider = ({ children }) => { | |
const [posts, setPosts] = useState([]) |
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
module.exports = { | |
config: { | |
// default font size in pixels for all tabs | |
fontSize: 16, | |
// font family with optional fallbacks | |
fontFamily: 'Fira Code, Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace', | |
// default font weight: 'normal' or 'bold' | |
fontWeight: 500, |
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
<meta httpEquiv="x-ua-compatible" content="IE=edge,chrome=1" /> | |
<meta name="MobileOptimized" content="320" /> | |
<meta name="HandheldFriendly" content="True" /> | |
<meta name="theme-color" content="#121214" /> | |
<meta name="msapplication-TileColor" content="#121214" /> | |
<meta name="referrer" content="no-referrer-when-downgrade" /> | |
<meta name="google" content="notranslate" /> | |
<meta property="og:title" content={pageTitle} /> | |
<meta property="og:description" content={description} /> |
NewerOlder