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
new Promise(function(resolve, reject) { | |
setTimeout(() => resolve(1), 2000); | |
}).then((result) => { | |
alert(result); | |
return result + 2; | |
}).then((result) => { | |
alert(result); | |
return result + 2; | |
}).then((result) => { |
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
function delay(t){ | |
return new Promise(function(resolve){ | |
return setTimeout(resolve, t) | |
}); | |
} | |
function logHi(){ | |
console.log('hi'); | |
} | |
delay(2000).then(logHi); |
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
type Digits = /* 上記参照 */; | |
type DigitsStr = `${Digits}`; | |
type Tile<T extends unknown[], N extends Digits | DigitsStr | 10 | '10'> = [ | |
[], | |
[...T], | |
[...T, ...T], | |
[...T, ...T, ...T], | |
[...T, ...T, ...T, ...T], | |
[...T, ...T, ...T, ...T, ...T], | |
[...T, ...T, ...T, ...T, ...T, ...T], |
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
# Sandi Metz「オブジェクト指向設計実践ガイド」でリファクタリング後のduck-typingコードを美しいと思い | |
# それに触発されて書いたHello worldです。 | |
# なおこのコードはRubyとGobyどちらでも動きます。 | |
# Greetクラス | |
class Greet | |
attr_accessor :audience, :head, :tail | |
def initialize | |
@head = 'Hello, ' |
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
<iframe src="https://docs.google.com/presentation/d/e/2PACX-1vQrS0wzkaS6hvy7Era6Iz6Gx12TNp83OtWQ4nh3iJMW3ywViiaLgjYAORUtH5PKLHyg-k-Ecv_L7yAu/embed?start=false&loop=false&delayms=3000" frameborder="0" width="960" height="569" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe> |
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
# hachi8833 | |
## お仕事 | |
BPS株式会社で技術ブログ「TechRacho」を運営しています。RailsチュートリアルとRailsガイドを翻訳しました。 | |
正規表現が好き。 | |
プライベートではなぜかGo言語でGobyというRubyライクな言語のメンテを手伝ったりなんかしています。 | |
## 最近の課題 |
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
# kazzさん謹製 | |
module MyModlue | |
class BaseClass | |
def public_method | |
'called public_method' | |
end | |
def call_methods_with_self | |
puts self.public_method rescue puts 'CANNOT call public_method' | |
puts self.protected_method rescue puts 'CANNOT call protected_method' |
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
// Code generated by go-bindata. | |
// sources: | |
// asset/conf.json | |
// DO NOT EDIT! | |
package main | |
import ( | |
"bytes" | |
"compress/gzip" |
NewerOlder