This file contains hidden or 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 com.banksimple.util | |
| import org.scala_tools.time.Imports._ | |
| import org.joda.time.format.{DateTimeFormat,DateTimeFormatter} | |
| class SafeDateTimeFormatter(val self: DateTimeFormatter) extends Proxy { | |
| def safelyParseDateTime(input: String): Option[DateTime] = | |
| try Some(self.parseDateTime(input)) | |
| catch { case _ => None } | |
| } |
This file contains hidden or 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
| Error locating template /recurse.html.Message: Expected ';'java.lang.RuntimeException: Expected ';'scala.xml.parsing.MarkupParserCommon$class.takeUntilChar(MarkupParserCommon.scala:88) scala.xml.parsing.MarkupParserCommon$class.normalizeAttributeValue(MarkupParserCommon.scala:148) scala.xml.parsing.MarkupParserCommon$class.xAttributeValue(MarkupParserCommon.scala:79) net.liftweb.util.PCDataXmlParser.xAttributeValue(PCDataMarkupParser.scala:98) net.liftweb.util.PCDataXmlParser.xAttributes(PCDataMarkupParser.scala:113) scala.xml.parsing.MarkupParser$class.mkAttributes(MarkupParser.scala:245) net.liftweb.util.PCDataXmlParser.mkAttributes(PCDataMarkupParser.scala:98) net.liftweb.util.PCDataXmlParser.mkAttributes(PCDataMarkupParser.scala:98) scala.xml.parsing.MarkupParserCommon$class.xTag(MarkupParserCommon.scala:47) net.liftweb.util.PCDataXmlParser.xTag(PCDataMarkupParser.scala:98) scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:509) net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.sc |
This file contains hidden or 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
| <div id="main" class="lift:surround?with=default&at=content"> | |
| <div> | |
| This demonstrates Lift's recursive snippets | |
| </div> | |
| <div class="lift:Recurse"> | |
| <div id="first" class="lift:FirstTemplate"> | |
| The first template. | |
| </div> | |
This file contains hidden or 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 com.banksimple.testing.util | |
| import akka.actor._ | |
| class ReplayActor extends Actor { | |
| var lastSeen: List[Any] = List() | |
| override def receive: Receive = { | |
| case 'dump => { self.reply(lastSeen) ; lastSeen = List() } | |
| case a => lastSeen = a :: lastSeen | |
| } | |
| } |
This file contains hidden or 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 com.banksimple.util | |
| private[util] final class Also[T](val origin: T) { | |
| def andAlso(x: T => Unit): T = { x(origin) ; origin } | |
| def andThen(x: => Unit): T = { x ; origin } | |
| } | |
| object Also { |
This file contains hidden or 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
| <html> | |
| <head> | |
| <title> Fuck everything! </title> | |
| </head> | |
| <body class="lift:content_id=content"> | |
| <div class="lift:surround?with=default;at=content span-24 last" id="content"> | |
| <head_merge><title>Headmerge!</title></head_merge> | |
| <div class="span-12"> Fully html5!!!<br>And with some css besides!!!!!!<br>Whee</div> |
This file contains hidden or 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 com.swipr.lib | |
| import dispatch._ | |
| import net.liftweb.json._ | |
| import java.net.URL | |
| package Google.ImageSearch { | |
| case class Result(url: String) | |
| case class SearchResponse(results: List[Result]) | |
| case class SearchEnvelope(responseData: SearchResponse, |
This file contains hidden or 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 com.swipr.lib | |
| import akka.actor._ | |
| import akka.dispatch._ | |
| import scala.collection.immutable._ | |
| package HordeProtocol { | |
| case class GetOrCreate(key: Any, valueGenerator: () => Any) | |
| case class ClearJob(keyToClear: Any, value: Any) | |
| } |
This file contains hidden or 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 com.banksimple.util | |
| private[util] final class Effectful[T](val origin: T) { | |
| /** | |
| * A special case of doto, andAlso is useful for | |
| * quick logging or output tasks. Similar in use | |
| * to doto, but only takes one function. | |
| * */ | |
| def andAlso(x: T => Unit): T = { x(origin) ; origin } |
This file contains hidden or 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
| ;;This is needed for Erlang mode setup | |
| (defun get-erlang-root () | |
| (if (file-exists-p "/p/lib/erlang") | |
| "/p/lib/erlang" | |
| "/usr/local/lib/erlang")) | |
| (let* ((root-dir (get-erlang-root)) | |
| (bin-dir (expand-file-name "bin" root-dir)) |