Skip to content

Instantly share code, notes, and snippets.

@Peksa
Peksa / MetricsPlugin.java
Created Jul 29, 2012
Codahale metrics with Play framework
View MetricsPlugin.java
package plugins;
import play.PlayPlugin;
import play.mvc.Http;
import play.mvc.Http.Request;
import play.mvc.Http.Response;
import play.mvc.Router.Route;
import play.vfs.VirtualFile;
import util.MetricsUtil;
@Peksa
Peksa / pushstate.html
Created Jan 29, 2012
pushState tests
View pushstate.html
<!DOCTYPE html>
<html>
<head>
<title>#{get 'title' /}</title>
<meta charset="UTF-8">
<script src="@{'/public/javascripts/jquery-1.7.1.min.js'}"></script>
</head>
<body>
<a href="#" id="home">Hem</a>
<a href="#" id="local">Lokal</a>
@Peksa
Peksa / BinderPlugin.java
Created Jan 5, 2012
Custom JSON Binder
View BinderPlugin.java
package misc;
import play.*;
import play.mvc.*;
import com.google.gson.*;
import java.util.*;
import java.lang.reflect.*;
import java.lang.annotation.*;
@Peksa
Peksa / Application.java
Created Dec 29, 2011
Play base controller
View Application.java
@With(BaseController.class)
public class Application extends Controller
{
// Normal controller actions here
}
You can’t perform that action at this time.