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
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE QuasiQuotes #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
import Yesod | |
import Database.Persist | |
import Database.Persist.MongoDB |
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
#!/bin/bash | |
DIR="$( cd "$( dirname "$0" )" && pwd )" | |
cd $DIR/.. | |
name=`basename "$2"` | |
case $1 in | |
'start') | |
echo $ > ./tmp/$name.pid | |
exec $2 2>&1 1> ./log/$name.log |
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
def self.cached_method(meth) | |
eval <<-CODE | |
def #{meth}_with_cache | |
return @#{meth} if @#{meth} | |
result = #{meth}_without_cache | |
@#{meth} ||= result | |
end | |
CODE | |
alias_method_chain meth, :cache | |
end |
NewerOlder