Skip to content

Instantly share code, notes, and snippets.

View mcalmels's full-sized avatar

Maxime Calmels mcalmels

View GitHub Profile
package utils.anorm
import anorm.ParameterValue
import anorm.SQL
/**
* @see Copy from http://nineofclouds.blogspot.fr/2013/04/in-clause-with-anorm.html
* @param query
* @param parameterValues
*/
package utils
import javax.mail.internet.InternetAddress
import org.apache.commons.mail._
import scala.util.{Try, Failure, Success}
import scala.concurrent.ExecutionContext
import scala.concurrent.Future
import java.io._
@mcalmels
mcalmels / gist:8331764
Created January 9, 2014 09:40
CORS JSONP
/**
* Send back a JSON object {"connected": false}
* or {"connected": true, "firstname": "Jean", "lastname": "DUPONT"}
*
* By default, the JSON object is wrapped in JSONP.
* But it can be sent as it if we're asked explicitly for JSON (http://…/login.json)
*
* See http://jsfiddle.net/HjCc2/6/ for usage.
*/
def login = {