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
| /** | |
| * Remember me cookie based authentication using Action Composition in Play 2.0. | |
| * | |
| * Code based on blog post from http://jaspan.com/improved_persistent_login_cookie_best_practice | |
| * | |
| * Create an object or class with this trait, and put it in your Global.onRouteRequest like so: | |
| * | |
| * <pre> | |
| override def onRouteRequest(request: RequestHeader): Option[Handler] = { | |
| super.onRouteRequest(request).map { |
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
| # --- !Ups | |
| CREATE TABLE users( | |
| email VARCHAR(255) NOT NULL PRIMARY KEY, | |
| name VARCHAR(255) | |
| ); | |
| CREATE TABLE subjects( | |
| id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
| title LONGTEXT NOT NULL, |
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 models | |
| import scala.Option.option2Iterable | |
| import org.scalastuff.scalabeans.Preamble.descriptorOf | |
| import org.scalastuff.scalabeans.BeanDescriptor | |
| import com.mongodb.casbah.Imports._ | |
| import play.Logger | |
| /** | |
| * Utility trait for MongoDB to mix into entity classes. |
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
| document.write('<style type="text/css">body{padding); margin:0}</style>'); | |
| document.write('<iframe id="iwonder_hack" src="http://' + location.host + '/" width="100%" height="100%" style="border:0;padding:0;margin:0"></iframe>'); | |
| setTimeout(function(){ | |
| var frmdoc = document.getElementsByTagName('iframe')[0].contentWindow.document | |
| ,rotation = 0 | |
| ,links = frmdoc.getElementsByTagName('a') | |
| ,images = frmdoc.getElementsByTagName('img') | |
| ,props = ['transform', 'WebkitTransform', 'msTransform', 'MozTransform', 'OTransform'] | |
| ,transform = function(elem, trans) { | |
| for (var i = 0; i < props.length; i++) { |
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
| Choose a ticket class: <select id="tickets"></select> | |
| <p id="ticketOutput"></p> | |
| <script id="ticketTemplate" type="text/x-jquery-tmpl"> | |
| {{if chosenTicket}} | |
| You have chosen <b>${ chosenTicket().name }</b> | |
| ($${ chosenTicket().price }) | |
| <button data-bind="click: resetTicket">Clear</button> | |
| {{/if}} |
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
| ko.nativeTemplateEngine = function () { | |
| // monkey patch to convert possible NodeList into Array before iterating | |
| ko.utils._setDomNodeChildren = ko.utils.setDomNodeChildren; | |
| ko.utils.setDomNodeChildren = function (domNode, childNodes) { | |
| var childNodesArray = Array.prototype.slice.call(childNodes); | |
| ko.utils._setDomNodeChildren(domNode, childNodesArray); | |
| }; | |
| // adapted from MooTools.Element | |
| // |
NewerOlder