Skip to content

Instantly share code, notes, and snippets.

View nakajo2011's full-sized avatar

Yukishige Nakajo nakajo2011

View GitHub Profile
@nakajo2011
nakajo2011 / index.mjs
Last active May 3, 2021 08:07
Apollo Client/Getting Started sample
import fetch from 'cross-fetch';
import { gql, ApolloClient, HttpLink, InMemoryCache } from '@apollo/client';
const client = new ApolloClient({
link: new HttpLink({ uri: 'https://48p1r2roz4.sse.codesandbox.io', fetch }),
cache: new InMemoryCache()
});
client
.query({
query: gql`
query GetRates {
@nakajo2011
nakajo2011 / ExchangeRates.tsx
Last active May 3, 2021 08:31
Apollo Client/Getting Started sample2
import {gql, useQuery} from '@apollo/client';
const EXCHANGE_RATES = gql`
query GetExchangeRates {
rates(currency: "USD") {
currency
rate
}
}
`;
@nakajo2011
nakajo2011 / index.tsx
Created May 3, 2021 08:29
Apollo Client/Getting Started sample3
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import fetch from 'cross-fetch';
import { gql, ApolloProvider, ApolloClient, HttpLink, InMemoryCache } from '@apollo/client';
const endpoint = 'https://48p1r2roz4.sse.codesandbox.io' // apolloのGetting Started
@nakajo2011
nakajo2011 / App.tsx
Created May 3, 2021 08:35
Apollo Client/Getting Started sample4
import React from 'react';
import './App.css';
import './ExchangeRates'
import ExchangeRates from "./ExchangeRates";
export default function App() {
return (
<div>
<h2>My first Apollo app 🚀</h2>
@nakajo2011
nakajo2011 / contracts...BlindTransfer.sol
Created January 4, 2023 11:23
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.17+commit.8df45f5f.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title FlashTransfer
* @dev Simple blind transfer contract
*/
contract BlindTransfer {