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
twd = (time) -> | |
date = new Date(time * 1e3) | |
diff = ((+new Date - date.getTime()) / 1e3) | |
ddiff = Math.floor(diff / 86400) | |
d = date.getDate() | |
m = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ")[date.getMonth()] | |
y = date.getFullYear().toString().slice(2) | |
return if isNaN(ddiff) or ddiff < 0 | |
ddiff is 0 and (diff < 60 and Math.floor(diff) + "s" or diff < 3600 and Math.floor(diff / 60) + "m" or diff < 86400 and Math.floor(diff / 3600) + "h") or ddiff < 365 and d + " " + m or ddiff >= 365 and d + " " + m + " " + y |
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
package models | |
import java.util.Date | |
import play.api.db._ | |
import play.api.Play.current | |
import play.api.db.slick.DB | |
import play.api.db.slick.Config.driver.simple._ | |
case class Page(id: Option[Long] = None, title: String, slug: String, content: String, posted_at: Date) |
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
brew install https://raw.github.com/gist/4725583/play.rb | |
brew switch play 2.1.0 | |
brew which play |
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
brew install https://raw.github.com/gist/4703352/play.rb | |
brew switch play 2.1-RC4 | |
brew which play |
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
brew install https://raw.github.com/gist/4670809/play.rb | |
brew switch play 2.1-RC3 | |
brew which play |
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
brew install https://raw.github.com/gist/4553175/play.rb | |
brew switch play 2.1-RC2 | |
brew which play |