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
<cffunction name="getFile"> | |
<cfargument name="path"> | |
<cffile action="READ" file="#path#" variable="serverXML"> | |
<cfreturn xmlParse(serverXML)> | |
</cffunction> | |
<cffunction name="writeFile"> | |
<cfargument name="path"> | |
<cfargument name="xml"> | |
<cffile action="write" file="#path#" output="#ToString(xml)#"> | |
</cffunction> |
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 sbt._ | |
import Keys._ | |
import PlayProject._ | |
object ApplicationBuild extends Build { | |
val appName = "Blog" | |
val appVersion = "1.0-SNAPSHOT" | |
val appDependencies = Seq( |
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 sbt._ | |
import Keys._ | |
import GatlingPlugin._ | |
object MinimalBuild extends Build { | |
val SNAPSHOT = "-SNAPSHOT" | |
val appName = "gatling-sbt-sample" | |
val buildVersion = "0.0.1-SNAPSHOT" |
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 daos; | |
import java.util.*; | |
import javax.persistence.*; | |
import play.*; | |
import play.db.ebean.*; | |
import play.db.ebean.Model.*; | |
import play.data.format.*; | |
import play.data.validation.*; |
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 sbt._ | |
import Keys._ | |
import PlayProject._ | |
object ApplicationBuild extends Build { | |
val appName = "website" | |
val appVersion = "1.2" | |
val common = PlayProject( |
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
node r.js -o build.js | |
node r.js -o build.js optimize=none |
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
case class Author(id:ObjectId, name:String) | |
case class Book(id:ObjectId, name:String, authorId:ObjectId){ | |
//For eager relationship | |
val author = Author.findOneById(authorId) | |
//For lazy relationship | |
lazy val author = Author.findOneById(authorId) | |
} |
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
<!-- Bad Code --> | |
<div class="validation"> | |
... | |
<button class="btn btn-danger">Delete</button> | |
</div> | |
<script> | |
$(".validation .btn-danger").on('click', function(){ ... }); | |
</script> |
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
override def onRouteRequest(req: RequestHeader): Option[Handler] = { | |
(req.method, req.headers.get("X-Forwarded-Proto")) match { | |
case ("GET", Some(protocol)) if protocol != "https" => Some(Action{ MovedPermanently("https://"+req.host+req.uri)}) | |
case (_, _) => super.onRouteRequest(req) | |
} | |
} |
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
@(title:Option[String], contentString:Option[String], placement:String = "left", style:String = "default")(content:Html = Html.empty) | |
<span class="help @style" rel="popover" data-popover data-trigger="hover" data-placement="@placement" data-original-title="@title" data-content="@contentString.getOrElse(content)">?</span> |
OlderNewer