This file contains hidden or 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
Show hidden characters
| { | |
| "env": { | |
| "browser": true, | |
| "es2020": true, | |
| "node": true, | |
| "jest": true | |
| }, | |
| "extends": [ | |
| "plugin:react/recommended", | |
| "standard", |
This file contains hidden or 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
| node_modules |
This file contains hidden or 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
| FROM node:12 AS build | |
| WORKDIR /app | |
| COPY package* yarn.lock ./ | |
| RUN yarn install | |
| COPY public ./public | |
| COPY src ./src | |
| RUN yarn run build | |
| FROM nginx:alpine | |
| COPY --from=build /app/build /usr/share/nginx/html |
This file contains hidden or 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 Unsplash, { toJson } from 'unsplash-js'; | |
| const unsplashInstance = new Unsplash({ | |
| secret: 'Your secret here', | |
| accessKey: 'Your accessKey here', | |
| }); | |
| async function fetchPhotos(keyword, page, limit = 10) { | |
| const photoResult = await unsplashInstance.search | |
| .photos(keyword, page, limit) |
This file contains hidden or 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 Unsplash, { toJson } from 'unsplash-js' | |
| const unsplashInstance = new Unsplash({ | |
| secret: 'Your secret here', | |
| accessKey: 'Your accessKey here', | |
| }) | |
| const UnsplashFeed = () => { | |
| const [error, setError] = useState() | |
| const [isFetching, setIsFetching] = useState(true) |
This file contains hidden or 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
| function filterArraysByKey (arr1, arr2, key) { | |
| var result = []; | |
| result = arr1.filter(function (el) { | |
| var res = true; | |
| for (var i = arr2.length - 1; i >= 0; i--) { | |
| if (arr2[i][key] === el[key]) { | |
| res = false; | |
| break; | |
| } | |
| } |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Intl.NumberFormat</title> | |
| <script type="text/javascript" charset="UTF-8" src="script.js"></script> | |
| </head> | |
| <body> | |
| <output id=output></output> |
This file contains hidden or 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 PropTypes from 'prop-types'; | |
| let timeout; | |
| const SearchBar = ({placeholder, buttonLabel, inputDelay, onChange, onButtonClick}) => { | |
| const onChangeDebounce = (evt) => { | |
| timeout && clearTimeout(timeout); | |
| const target = evt.target; | |
| timeout = setTimeout(() => onChange({target}), inputDelay); |
This file contains hidden or 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 { ObjectType, Field } from "@nestjs/graphql"; | |
| @ObjectType() | |
| export class PageInfo { | |
| @Field({ nullable: true }) | |
| startCursor: string; | |
| @Field({ nullable: true }) | |
| endCursor: string; |