How examples/api-routes-apollo-server-and-client/apollo/client.js works
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
#!/usr/bin/env node | |
const fs = require('fs'); | |
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf-8')); | |
fs.writeFileSync( | |
'package.json', | |
JSON.stringify( | |
{ | |
...pkg, |
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 { Readable } = require('stream'); | |
const { pipe, pipeline } = require('pipeline-pipe'); | |
const Listr = require('listr'); | |
const { Observable } = require('rxjs'); | |
const ss = []; | |
const os = Array.from(Array(50)).map((_, i) => [ | |
i, new Observable(s => { | |
ss[i] = s; | |
}) |
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
#!/usr/bin/env bash | |
escapeUnicode() { | |
str="$1"; | |
escaped=$(node -e 'console.log(escape(process.argv[1]).toLowerCase().replace(/%u/g, "\\U"))' $str); | |
echo $escaped | |
} | |
# Fixing problem where IME steals Ctrl+Shift+r | |
defaults write -g NSUserKeyEquivalents -dict-add "$(escapeUnicode '再変換')" -string "@~^$r"; |
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
#!/usr/bin/env bash | |
#title eijiro-setup.sh | |
#description This script deploys downloaded zip/rar files of "英辞郎 Ver.158 for macOS Dictionary.app" into your ~/Library/Dictionaries | |
#author soichi | |
#date 2019-08-06 | |
#version 1.0.0 | |
#usage bash eijiro-setup.sh | |
#notes Befor run | |
# 1. go https://www.tecorin.com/osx/index.html and buy it (expect Ver.158) | |
# 2. download all six files you bought and leave them in your ~/Downloads |
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
Index: src/components/Footer/Footer.tsx | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
--- src/components/Footer/Footer.tsx (date 1557115556000) | |
+++ src/components/Footer/Footer.tsx (date 1557542501000) | |
@@ -8,32 +8,70 @@ | |
*/ | |
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
// @flow | |
declare type A = {a: string}; | |
declare type AB = A | {b: string}; | |
declare type ABC = AB | {b: string}; | |
type v = $Call< | |
& (ABC => 3) |
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
// @flow | |
declare class Hole<T> { | |
constructor(T): Hole<T>; | |
pipe<U>(fn: T => Promise<U>): Hole<U>; | |
pipe<U>(fn: T => U): Hole<U>; | |
} | |
new Hole(42) |
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
// @flow | |
import type {ExportedType} from './types'; | |
type LocalType = number; | |
function useExported(e): Promise<ExportedType> { | |
return (1: any) | |
} | |
function useLocal(e): Promise<LocalType> { | |
return (1: any) |
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
console.time('speed?'); | |
const r = createReadable(40); | |
const t = new Transform({ | |
objectMode: true, | |
transform(data, enc, callback) { | |
setTimeout(() => { | |
console.log(`-- t ${data}, ${this.writableLength}`); | |
callback(null, data); | |
}, 400); | |
} |