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
<html> | |
</head> | |
<title>Thank you for sharing!</title> | |
<script> | |
!function(n,a,y,t,e,v,s){var globalNameSpace="GlobalNaytevNamespace"; | |
n[e]||(n[globalNameSpace]=n[globalNameSpace]||[],n[globalNameSpace].push(e),n[e]=function(){(n[e].q=n[e].q||[]).push(arguments) | |
},n[e].q=n[e].q||[],v=a.createElement(y),s=a.getElementsByTagName(y)[0],v.async=1,v.src=t,s.parentNode.insertBefore(v,s)) | |
}(window,document,"script","http://naytev-embed.global.ssl.fastly.net/prod/naytev.min.js","naytev"); | |
naytev("create", "551edbc6e4b0asdf23445b0d9fca"); | |
naytev("bind", "naytev.ready", function(){ |
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
naytev('activate') |
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
!function(n,a,y,t,e,v,s){var globalNameSpace="GlobalNaytevNamespace"; | |
n[e]||(n[globalNameSpace]=n[globalNameSpace]||[],n[globalNameSpace].push(e),n[e]=function(){(n[e].q=n[e].q||[]).push(arguments) | |
},n[e].q=n[e].q||[],v=a.createElement(y),s=a.getElementsByTagName(y)[0],v.async=1,v.src=t,s.parentNode.insertBefore(v,s)) | |
}(window,document,"script","//naytev-embed.global.ssl.fastly.net/prod/naytev.min.js","naytev"); | |
naytev("create", "551edbc6e4b0asdf23445b0d9fca"); |
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
String.prototype.foobar = function(){return this;} | |
> function (){return this;} | |
typeof "foo" | |
> "string" | |
typeof "foo".foobar() | |
> "object" |
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> |
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
<!-- 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
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
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
import sbt._ | |
import Keys._ | |
import PlayProject._ | |
object ApplicationBuild extends Build { | |
val appName = "website" | |
val appVersion = "1.2" | |
val common = PlayProject( |