I hereby claim:
- I am ticidesign on github.
- I am ticianadeandrade (https://keybase.io/ticianadeandrade) on keybase.
- I have a public key ASCPqnP_pM4-iOG4Lk2OoTDbNc53DpB8QKLBrB9mlAd4Owo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
// https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-1.html#recursive-conditional-types | |
type Primitive = string | number | boolean | null | |
type JSONObject = {[k: string] : JSONValue} | |
type JSONArray = JSONValue[] | |
type JSONValue = | |
| Primitive | |
| JSONObject | |
| JSONArray |
# Logs | |
logs | |
*.log | |
npm-debug.log* | |
yarn-debug.log* | |
yarn-error.log* | |
# Runtime data | |
pids | |
*.pid |
# Switching from v3.4 to latest | |
select_lastest() { | |
# Stop and unlink 3.4 | |
brew services stop mongodb@3.4 | |
brew unlink mongodb@3.4 | |
# Link last version | |
brew unlink mongodb && brew link mongodb | |
# Update mongo logs and database paths |
import { useState, useRef, useEffect } from 'react'; | |
/** | |
* A hook to load data from remote and keep track of the loading state | |
*/ | |
function useRemoteData( url, isJson = true, timeout = 3000 ) { | |
const [ loadingState, setLoadingState ] = useState('loading'); | |
const loadingStateRef = useRef( loadingState ); | |
const [ data, setData ] = useState([]); |
.App { | |
font-family: 'Roboto', sans-serif; | |
color: #484848; | |
} | |
.header__wrapper { | |
padding: 20px 52px; | |
border-bottom: 1px solid rgba(0, 0, 0, 0.1); | |
display: flex; | |
align-items: flex-end; |
export const menuData = [ | |
{ | |
emoji: '🍔', | |
label: 'burger', | |
name: 'Cheeseburger', | |
description: | |
'Cheeseburger with pickles, lettuce, tomato and sauce on a sesame seed bun', | |
price: 10 | |
}, | |
{ |
import { useEffect, useState } from 'react'; | |
import ResizeObserver from 'resize-observer-polyfill'; | |
import raf from 'raf-schd'; | |
const LISTENER_OPTIONS = { passive: true }; // we don't call `event.preventDefault()` | |
export function useScroll(ref, { isPassive = true }) { | |
// const scrollTarget = ref.current || document.documentElement; | |
// define setters and getters |
import { mockServer, MockList } from 'graphql-tools'; | |
import casual from 'casual-browserify'; | |
// The GraphQL schema. Described in more detail here: | |
// https://medium.com/apollo-stack/the-apollo-server-bc68762e93b | |
const schema = ` | |
type User { | |
id: ID! | |
name: String | |
lists: [List] |
// customize mocking per type (i.e. Integer, Float, String) | |
mockServer(schema, { | |
Int: () => 6, | |
Float: () => 22.1, | |
String: () => 'Hello', | |
}); | |
// customize mocking per field in the schema (i.e. for Person.name and Person.age) | |
mockServer(schema, { | |
Person: () => ({ |