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 S3File | |
object HelloWorldController extends Controller { | |
def index = { | |
val file = S3File("id", "path/to/file") | |
val json = Json.toJson(file)(S3File.linkSigningS3FileWrites) | |
Ok(json) | |
} | |
} |
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
object S3File { | |
// ... | |
def linkSigningS3FileWrites: Writes[S3File] = s3FileFormat.writes.transform( | |
(JsPath \ "path").json.update(JsPath.read[JsString].map(path => { | |
JsString(generateSignedLink(path)) | |
})) | |
) | |
} |
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 S3File(id: String, path: String) | |
object S3File { | |
implicit def s3FileFormat: Format[S3File] = Json.format[S3File] | |
def generateSignedLink(path: String): String = ??? | |
} |
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
// Simple unit testing in wren. | |
class Spec { | |
new(description, body) { | |
_description = description | |
if (_body.type == Fiber){ | |
_body = body | |
} else { | |
_body = new Fiber(body) |
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
// Simple unit testing in wren. | |
class Spec { | |
new(description, body) { | |
_description = description | |
_body = body | |
} | |
description { _description } |
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
// Simple unit testing in wren. | |
class Spec { | |
new(description, body) { | |
_description = description | |
_body = body | |
} | |
description { _description } |
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
// Simple unit testing in wren. | |
class Spec { | |
new(description, body) { | |
_description = description | |
_body = body | |
} | |
description { _description } |
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
// The prototypes you added | |
MC.View = Backbone.View; | |
MC.View.prototype.Terms = Terms.m; | |
MC.View.prototype.formats = formats; | |
// In your view: | |
render : function() { | |
this.$el.html(this.template({ | |
terms: this.Terms | |
// Put any other data you want in your template inside this object as well |
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
premise | Infractions | |
---|---|---|
1351 | 76 | |
217 | 75 | |
733 | 64 | |
2181 | 64 | |
1022 | 62 | |
2249 | 60 | |
416 | 58 | |
929 | 56 | |
1158 | 56 |
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
premise | Infractions | |
---|---|---|
1351 | 76 | |
217 | 75 | |
733 | 64 | |
2181 | 64 | |
1022 | 62 | |
2249 | 60 | |
416 | 58 | |
929 | 56 | |
1158 | 56 |
NewerOlder