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
import org.scalatra.ScalatraServlet | |
import org.scalatra.json.JacksonJsonSupport | |
import java.util.Date | |
import com.novus.salat.annotations._ | |
import com.novus.salat.dao.SalatDAO | |
import com.novus.salat.global._ | |
import com.novus.salat.grater | |
import com.mongodb.casbah.Imports._ |
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 createDataSource(name: String): ComboPooledDataSource = { | |
val cpds = new ComboPooledDataSource(name) | |
logger.info(f"Created c3p0 connection pool: $name") | |
cpds | |
} | |
val cpdsMaster = createDataSource("master") | |
val cpdsSlave = createDataSource("slave") |
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
post("/files") { | |
// HACK Transform all BigInts to Doubles | |
val transformedBody = parsedBody transformField { | |
case (key, JInt(bigInt)) => (key, JDouble(bigInt.toDouble)) | |
} | |
val meta = transformedBody.asInstanceOf[JObject].values.get("meta").get.asInstanceOf[Map[String, Map[String, Any]]] | |
//... | |
/// Store in Database | |
updateFileMetadata(fileOrigin, meta) |
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
See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. | |
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] | |
log4j:WARN No appenders could be found for logger (org.eclipse.jetty.util.log). | |
log4j:WARN Please initialize the log4j system properly. | |
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. | |
java.lang.ExceptionInInitializerError | |
at org.eclipse.jetty.servlet.ServletContextHandler.newSessionHandler(ServletContextHandler.java:241) | |
at org.eclipse.jetty.servlet.ServletContextHandler.getSessionHandler(ServletContextHandler.java:334) | |
at org.eclipse.jetty.servlet.ServletContextHandler.relinkHandlers(ServletContextHandler.java:180) | |
at org.eclipse.jetty.servlet.ServletContextHandler.<init>(ServletContextHandler.java:157) |
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
import scala.language.experimental.macros | |
object implicit_dsls extends App { | |
trait DSLImpl { | |
def getImpl(route: String)(action: => Any): Unit | |
} |
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
// this is the macro expansion | |
RescopingMacros.transplant({ | |
class X extends scala.AnyRef { | |
def <init>(): X = { | |
X.super.<init>(); | |
() | |
}; | |
private[this] val request: Int = 1; | |
<stable> <accessor> def request: Int = X.this.request; |
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 foo | |
import java.io.{PrintWriter, StringWriter} | |
import org.fusesource.scalate.{TemplateEngine, DefaultRenderContext} | |
class SimpleTemplateEngine(templateSource: String) { | |
val templateEngine = new TemplateEngine() |
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 foo | |
import java.io.{PrintWriter, StringWriter} | |
import org.fusesource.scalate.{TemplateEngine, DefaultRenderContext} | |
class SimpleTemplateEngine(templateSource: String) { | |
val templateEngine = new TemplateEngine() |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDWKIzx+Z/9hvxex7gqoOfdxPsoz3tV9nq/kvJVN4v61eekGDTW2m5U/ufD01btEzoFA2M83qBOCzADeo3Tvj+yOTlnDPnnJBFVNcI67LskRNxzsF/5U3TxF1cII5zHg89F8kzb7+5+6FUNs6mIMImNux1TJfzVoK0FfKhhRhb6c5x/0HcIFswxv/nSeJfuSz6Nr3D4lHd0ZDMJjIwq4RM9+U2b5wZAJ5Qy2sQgw2NNP0xVZhbGcN2irYojiXf9uqqAUeDTjo5TxTP6hW8y/3FuFzbzlyEIf8aRtUlRcPgo8zVikJH6i6hHqiTzYpbHTB5F5w0GjVTYFak8bJF6hqC/ stefan@helix |
OlderNewer