Skip to content

Instantly share code, notes, and snippets.

@lovuikeng
lovuikeng / gist:1589059
Created January 10, 2012 13:21
Play 2 Specs2 form test
object Application extends Controller {
val helloForm = Form(
of(
"name" -> nonEmptyText,
"repeat" -> number(min = 1, max = 100),
"color" -> optional(text)
)
)
//
}
@lovuikeng
lovuikeng / http-delete-cookie.xml
Created December 10, 2011 01:09
Spring Security 3.1 added features
@lovuikeng
lovuikeng / scala-spring-controller.scala
Created December 6, 2011 05:52
Scala controller in Spring
// https://github.com/cbeams/hello-spring-scala/blob/master/src/main/scala/com/vmware/hello/HomeController.scala
import scala.collection._
@Controller
class HomeController {
val env = new CloudEnvironment
@Autowired var dataSource: DataSource = null
/**
@lovuikeng
lovuikeng / htmlexpense-controller.js
Created December 3, 2011 09:33
SpringOne 2GX HTMLExpense client controller
// source: https://github.com/SpringSource/html5expense/blob/master/client/www/controller.js
document.addEventListener('deviceready', onDeviceReady, false);
function onDeviceReady() {
pictureSource = navigator.camera.PictureSourceType;
destinationType = navigator.camera.DestinationType;
...
}