Memento memo.

Today I Learned.

2016-12-01から1ヶ月間の記事一覧

Ruby: Hash -> Structの変換

こんな感じで書けます def deep_struct(hash) foo = hash.values.map do |v| case v when Hash deep_struct(v) when Array v.map { |x| deep_struct(x) } else v end end Struct.new(*hash.keys).new(*foo) end OOPっぽく書きたければHash, Arrayに deep_str…

Hacktoberfest 2016 に参加してきた

Hacktoberfestなるものに参加して景品のTシャツを貰いました。あとステッカーも7枚ほど貰いました。 Finally, #hacktoberfest swag has just arrived! Thanks @digitalocean @github pic.twitter.com/nLrMdipoJ1— shotat (@shotat_jp) 2016年12月7日 Hackto…

サイバーマンデーのセールでPS4買って優勝した

サイバーマンデーが最高だった話です。技術ブログ要素ゼロ。 普通にPS4買う場合: 30,895円 PlayStation 4 ジェット・ブラック 500GB(CUH-2000AB01)出版社/メーカー: ソニー・インタラクティブエンタテインメント発売日: 2016/09/15メディア: Video Gameこの…

Docker と node_modules と Volume Trick

Rails & Node.jsの構成で Docker環境を作ろうとしたらハマったのでメモ 現象 npm installを実行する Dockerfileを記述 ... RUN mkdir /app WORKDIR /app # npm install ADD package.json /app/package.json RUN npm install ... カレントディレクトリを /app…