- Go to https://thegraph.com/hosted-service/, register a new account using your Github account
- Go to https://thegraph.com/hosted-service/dashboard, -> Add Subgraph, then fill the information. Use: Test Uniswap Graph for name
- Grab your subgraph id. If it is https://thegraph.com/hosted-service/subgraph/hungdoansy/uniswap-v2-experiment, grab hungdoansy/uniswap-v2-experiment
- Clone an example repo or create a new one from CLI
git clone [email protected]:hungdoansy/test-the-graph.git test-uniswap-graph cd test-uniswap-graphyarnto install all dependencies
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
| console.log(`Built time: %c${new Date(Number(process.env.REACT_APP_BUILT_TIME) * 1000)}`, "color: #bada55"); |
General
Request URL: https://www.binance.com/bapi/composite/v1/public/cms/article/catalog/list/query?catalogId=48&pageNo=1&pageSize=15
Request Method: GET
Status Code: 200
Remote Address: 13.225.99.49:443
Referrer Policy: origin-when-cross-originNo need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.
- Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
- Create or import a key -- see below for https://keybase.io
- Run
gpg --list-secret-keysand look forsec, use the key ID for the next step - Configure
gitto use GPG -- replace the key with the one fromgpg --list-secret-keys
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
| const getBase64 = async url => { | |
| const response = await axios.get(url, { | |
| responseType: 'arraybuffer', | |
| }); | |
| const imageType = response.headers['content-type']; | |
| const base64 = Buffer.from(response.data, 'binary').toString('base64'); | |
| const dataURI = `data:${imageType};base64,${base64}`; | |
| return dataURI; |
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
| const getNumbers = () => { | |
| const numbers = []; | |
| for(let i = 0; i < 50000; i++) { | |
| const n = +(Math.random() * 10000).toFixed(5); | |
| numbers.push(n); | |
| } | |
| return numbers; | |
| } |
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 { useCallback } from 'react'; | |
| import { useHistory, useLocation } from 'react-router-dom'; | |
| import queryString from 'query-string'; | |
| const useQueryParam = (key) => { | |
| const history = useHistory(); | |
| const location = useLocation(); | |
| const { search } = location; | |
| const params = queryString.parse(search); |
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
| // Codesandbox: https://codesandbox.io/s/elegant-frog-hbs3f?file=/src/Carousel.js:0-5654 | |
| import React, { useRef, useState } from "react"; | |
| import classNames from "classnames"; | |
| import styled from "styled-components"; | |
| const ArrowDownContainer = styled.div` | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; |
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
| /* | |
| * This is helpful when you have multiple items and want to have some control over each of them. | |
| */ | |
| export const useMultipleRefs = (n) => { | |
| const refs = useRef( | |
| Array(n) | |
| .fill(1) | |
| .reduce((acc, _, index) => { | |
| acc[index] = React.createRef(); |
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
| // ==UserScript== | |
| // @name Hide sponsored items | |
| // @namespace whatisthis | |
| // @version 0.1 | |
| // @description try to sanitize Facebook | |
| // @author Sy Hung Doan | |
| // @match https://www.facebook.com/* | |
| // @match https://facebook.com/* | |
| // @grant none | |
| // ==/UserScript== |