blog.sowatchasayin

Rails etc.

配列おまとめyield

def お徳用(商品)
  return if 商品.length == 0
  if 商品.length >6
    [商品[0..5]] + お徳用(商品[6..商品.length])
  else
    [商品[0..5]]
  end
end

これを読んでおいてよかった。と思った瞬間。
(とはいえ、まだ全部読んでない)
The Little Schemer, 4th EditionThe Little Schemer, 4th Edition

The MIT Press 1995-12-21
売り上げランキング : 3390

Amazonで詳しく見る
by G-Tools


できた!と思ったら、each_sliceなんてものがあるのか…

traps in a sandbox

Lessons learnt the hard way: Don't use script/console --sandbox on production apps
It also commits implicit commit like ALTER TABLE. just get fucked now.

script/console --sandboxでALTER TABLEとかすると、その前の変更がコミットされちゃいます。くそ!

乗組員。

Debian Lenny + Rails2.3.3 + Passenger2.2.4で、デプロイしたっす。
「とりあえずやってよう」と思いやってみたら、特に何の問題もなく、あっという間に配備できました。
インストール後、
# passenger-install-apache2-module
で対話的に進みます。

参考:
Apache上でRuby on Railsアプリケーションを動かす/Passenger(mod_rails for Apache)の利用

Author

Fujimura Daisuke
http://fujimuradaisuke.com

Labels