今日のハマリ

昨日は風邪を引いたのでなし。三日坊主の三日目(2記事目)

JS 一意なデータバインド

こんなコードを

class HogeView
  constructor: ->
    @from = $('input#from')

  set_from : -> @from = $('input#from')

こんな風に

class HogeView
  from : -> $('input#from')

リファクタリングされた。確かに一意なデータバインドならこっちのほうがかっこいい。

Haskell

最近のMacだとLLVMでないGCCは入ってない。次のページから落としてくる
kennethreitz/osx-gcc-installer · GitHub https://github.com/kennethreitz/osx-gcc-installer

macのcabal がデフォルトで参照するgcc先は /Developers/usr/local/bin/gcc
パスの変更するのが面倒くさそうだったので、ln -s /Developers/usr/local/bin/gcc /usr/bin/gcc-4.2 した

cabal update
cabal install yesod