Skip to content

Instantly share code, notes, and snippets.

View hachi8833's full-sized avatar
😀

Shozo Hatta hachi8833

😀
View GitHub Profile
@hachi8833
hachi8833 / translation_memo.md
Last active September 15, 2015 16:49
Rails チュートリアル翻訳メモ

Rails チュートリアル翻訳メモ

green/red

  • green -> グリーン

  • red -> レッド

    リスト名直後の「グリーン」「レッド」にはかっこを付けない方で統一?

スペース

  • 原則として全角半角の間にスペースを置かない(今はかなり不揃い)
@hachi8833
hachi8833 / bindata.go
Created February 6, 2016 12:29
sample Go code to show the aim
// Code generated by go-bindata.
// sources:
// asset/conf.json
// DO NOT EDIT!
package main
import (
"bytes"
"compress/gzip"
# 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'
# hachi8833
## お仕事
BPS株式会社で技術ブログ「TechRacho」を運営しています。RailsチュートリアルとRailsガイドを翻訳しました。
正規表現が好き。
プライベートではなぜかGo言語でGobyというRubyライクな言語のメンテを手伝ったりなんかしています。
## 最近の課題
@hachi8833
hachi8833 / avatar.md
Last active April 17, 2018 09:41
sample picture

animal_hamster

<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>
@hachi8833
hachi8833 / hello_world.rb
Last active May 2, 2018 00:17
The Ruby code what I see beauty in
# Sandi Metz「オブジェクト指向設計実践ガイド」でリファクタリング後のduck-typingコードを美しいと思い
# それに触発されて書いたHello worldです。
# なおこのコードはRubyとGobyどちらでも動きます。
# Greetクラス
class Greet
attr_accessor :audience, :head, :tail
def initialize
@head = 'Hello, '
@hachi8833
hachi8833 / sample.ts
Last active September 4, 2020 02:24
Sample TS
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],
@hachi8833
hachi8833 / sample.js
Created March 12, 2021 08:53
Promise sample code 1
function delay(t){
return new Promise(function(resolve){
return setTimeout(resolve, t)
});
}
function logHi(){
console.log('hi');
}
delay(2000).then(logHi);
@hachi8833
hachi8833 / sample2.js
Created March 12, 2021 08:55
Promise sample code 2
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) => {