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
<div className="card"> | |
<img className="card-img-top" src={data?.viewer.avatarUrl} alt="Card image" /> | |
<div className="card-body"> | |
<h4 className="card-title">{data?.viewer.name}</h4> | |
<p className="font-weight-light">@{data?.viewer.login}</p> | |
<p className="card-text">{data?.viewer.bio}</p> | |
<a href="https://github.com/ivanstnsk" className="btn btn-primary">See Profile</a> | |
</div> | |
</div> |
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 { createServer } = require('http'); | |
const { execute, subscribe } = require('graphql'); | |
const { SubscriptionServer } = require('subscriptions-transport-ws'); | |
const { makeExecutableSchema } = require('@graphql-tools/schema'); | |
const { ApolloServer, gql } = require('apollo-server-express'); | |
const { MockList } = require('@graphql-tools/mock'); | |
const { ApolloServerPluginLandingPageGraphQLPlayground } = require('apollo-server-core'); | |
const express = require('express'); |
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
// Requires extra step: install the package apollo-server-core | |
const { ApolloServer, gql } = require('apollo-server'); | |
const { ApolloServerPluginLandingPageGraphQLPlayground } = require('apollo-server-core'); | |
const typeDefs = gql` | |
type Query { | |
totalDays: Int! | |
} | |
`; |
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
#!/bin/bash | |
COLOR_OK='\033[1;32m' | |
COLOR_HEADING='\033[0;36m' | |
COLOR_ERROR='\033[0;31m' | |
NC='\033[0m' | |
# Set your project directory | |
APP_REPO_DIR=~/dev/project-dir |
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 { useEffect, useState } from 'react'; | |
import { PermissionsAndroid } from 'react-native'; | |
type THook = [boolean, boolean]; | |
interface PermissionsAndroidResponse { | |
[key: string]: 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 { useEffect, useState, useRef } from 'react'; | |
type THook<T extends HTMLElement> = [ | |
React.RefObject<T>, | |
number, | |
]; | |
export const useMouseScroll = <T extends HTMLElement>(): THook<T> => { | |
const [scrollY, setScrollY] = useState<number>(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
import { useEffect, useState } from 'react'; | |
type TWindowSize = [number, number]; | |
type THook = TWindowSize; | |
export const useWindowResize = (): THook => { | |
const initSize: TWindowSize = [ | |
window.innerWidth, |
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 { useEffect, useState, useRef } from 'react'; | |
type THook<T extends HTMLElement> = [ | |
React.RefObject<T>, | |
boolean, | |
]; | |
export const useMouseHover = <T extends HTMLElement>(): THook<T> => { | |
const [hovered, setHovered] = useState(false); |
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
export const delay = (timeMs: number): Promise<void> => { | |
return new Promise((resolve) => { | |
setTimeout(resolve, timeMs); | |
}); | |
}; | |
// await delay(2000); |
NewerOlder