Skip to content

Instantly share code, notes, and snippets.

View tai2's full-sized avatar
🐢

Taiju Muto tai2

🐢
View GitHub Profile
英語は主に本からかなー。思い出せる限りまとめてみる。
英語勉強しはじめたのは、21から(それまで中学英語レベルもまったくできなかった)。
まず最初にやったのは、中学英語の教科書を本屋さんいって買ってきて、その本文を100回だっけな?
通しで音読した。英語に対する苦手意識を克服することが目的。全部暗記する勢いで読む。
Sunshine 1 [平成28年度採用] 教科書 (当時使ってたのこれじゃないけど参考までに)
https://www.amazon.co.jp/dp/430408075X/
それから、冠詞のメカニズムを理解するために冠詞の本読んだ。
export default class Deferred<T> {
promise: Promise<T>
resolve: (value?: T | PromiseLike<T>) => void
reject: (reason?: any) => void
constructor() {
this.resolve = () => {}
this.reject = () => {}
this.promise = new Promise<T>((resolve, reject) => {
this.reject = reject;
We couldn’t find that file to show.
package main
import (
"fmt"
"sync"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.
package main
import (
"fmt"
"golang.org/x/tour/tree"
)
//type Tree struct {
// Left *Tree
// Value int
/// <reference types="node" />
declare module 'through2-spy' {
import stream = require('stream');
function through2_spy(transform?: SpyFunction): stream.Transform;
type SpyFunction = (this: stream.Transform, chunk: any) => void;
export = through2_spy;
package main
import (
"io"
"os"
"strings"
)
type rot13Reader struct {
r io.Reader
package main
import (
"io"
"os"
"strings"
)
type rot13Reader struct {
r io.Reader
import "strings"
func WordCount(s string) map[string]int {
counts := make(map[string]int)
words := strings.Fields(s)
for _, word := range words {
count, ok := counts[word]
if ok {
counts[word] = count + 1
} else {
@tai2
tai2 / errorLoggerMiddleware.ts
Created April 4, 2019 13:51
Dump stack trace to console when FSA contains an error.
import { Dispatch } from 'redux'
type ErrorAction = { payload: Error }
function isErrorAction(action: any): action is ErrorAction {
return (<ErrorAction>action).payload instanceof Error
}
const errorLoggerMiddleware = (store: any) => (next: Dispatch) => (
action: any