Revisions
-
mandubian revised this gist
Jul 22, 2013 . 3 changed files with 32 additions and 19 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1 +0,0 @@ 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ import play.api.libs.json._ import play.api.libs.functional.syntax._ sealed trait Shape case class Circle(c: (Float, Float), r: Float) extends Shape object Circle { // reader is covariant and can be implicit in inheriting caseclasses implicit val reader = Json.reads[Circle] // writer is contravariant and can't be implicit in inheriting caseclasses val writer = Json.writes[Circle] } case class Polygon(points: Seq[(Float, Float)]) extends Shape object Polygon { // reader is covariant and can be implicit in inheriting caseclasses implicit val reader = Json.reads[Polygon] // writer is contravariant and can't be implicit in inheriting caseclasses val writer = Json.writes[Polygon] } object Shape { // Note the map to convert into Shape because we want a Reads[Shape] // As we don't have any type indication, we can just use try/fail strategy implicit val shapeReads = __.read[Rect].map(x => x:Shape) orElse __.read[Circle].map(x => x:Shape) implicit val shapeWrites = Writes[Shape]{ case circle: Circle => Circle.writer.writes(circle) case poly: Polygon => Polygon.writer.writes(poly) } } 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 charactersOriginal file line number Diff line number Diff line change @@ -1,18 +0,0 @@ -
playxamplez-admin revised this gist
Jul 21, 2013 . 4 changed files with 19 additions and 16 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1 +1 @@ <put your code here & change extension to your language> 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 charactersOriginal file line number Diff line number Diff line change @@ -1,15 +0,0 @@ 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ ### [Play-Xamplez](http://play.xamplez.io) Root Gist How to create [Play Framework](http://www.playframework.org) code snippets? 1. Fork this Root Gist to create a new snippet. 2. Modify your gist according to following rules: 1. **You MUST put a gist description** which summarizes your snippet as precisely as possible: * Words starting with `#` like `#tag` are indexed as hashtags. * Words starting with `@` like `@john` are highlighted as Twitter links (You can also precise `@twitter:john` or `@github:john` * URL will be highlighted in the description 2. You can add as many files as you want in your gist 3. File extensions are used to identify the language (e.g. `code.scala` -> scala) 4. A code snippet shouldn't be too long (a few lines if possible) so don't hesitate to cut in several files 5. If you want to explain precisely your code or provide usage examples, please use a Markdown file (e.g. `README.md`) 6. You can put a License in `__LICENSE.txt` case your code need to be protected in anyway 7. You can delete `_README.md` and any modification in it isn't taken into account 3. Save it & wait for [Play Xamplez](http://play.xamplez.io) to index it. File renamed without changes. -
playxamplez-admin revised this gist
Jul 20, 2013 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,12 +4,12 @@ How to create [Play Framework](http://www.playframework.org) code snippets? 1. Fork this Root Gist to create a new snippet. 2. Modify your gist according to following rules: * **You MUST put a gist description** which summarizes your snippet as precisely as possible. * All words starting in the description with a dash `#tag` are indexed as tags. * You can add as many files as you want in your gist * File extensions are used to identify the language (e.g. `code.scala` -> scala) * A code snippet shouldn't be too big (a few lines if possible) so don't hesitate to cut in several files * If you want to explain precisely your code or provide usage examples, please use a Markdown file (e.g. `README.md`) * You can put a License in case your code need to be protected in anyway 3. Save it & wait for [<Put Xamplez Instance URL Here>](http://blablabla.blabla) to index it. -
playxamplez-admin revised this gist
Jul 20, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ### [Play-Xamplez](http://play.xamplez.io) Root Gist How to create [Play Framework](http://www.playframework.org) code snippets? -
playxamplez-admin revised this gist
Jul 20, 2013 . 1 changed file with 2 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,6 @@ ## [Play-Xamplez](http://play.xamplez.io) Root Gist How to create [Play Framework](http://www.playframework.org) code snippets? 1. Fork this Root Gist to create a new snippet. 2. Modify your gist according to following rules: -
playxamplez-admin revised this gist
Jul 20, 2013 . 1 changed file with 2 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,6 @@ ## Play-Xamplez's Root Gist for [Play Framework](http://www.playframework.org) code snippets How to? ---------- 1. Fork this Root Gist to create a new snippet. -
xamplez-admin revised this gist
Jul 20, 2013 . 1 changed file with 9 additions and 12 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,16 +6,13 @@ How to use ---------- 1. Fork this Root Gist to create a new snippet. 2. Modify your gist according to following rules: 1. **You MUST put a gist description** which summarizes your snippet as precisely as possible. 2. All words starting in the description with a dash `#tag` are indexed as tags. 3. You can add as many files as you want in your gist 4. File extensions are used to identify the language (e.g. `code.scala` -> scala) 5. A code snippet shouldn't be too big (a few lines if possible) so don't hesitate to cut in several files 6. If you want to explain precisely your code or provide usage examples, please use a Markdown file (e.g. `README.md`) 7. You can put a License in case your code need to be protected in anyway 3. Save it & wait for [<Put Xamplez Instance URL Here>](http://blablabla.blabla) to index it. -
xamplez-admin revised this gist
Jul 14, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ How to use 1. Fork this Root Gist to create a new snippet. 2. Modify your gist according to Rules. 3. Save it and wait for [<Put Xamplez Instance URL Here>](http://blablabla.blabla) to index it. Rules ----- -
xamplez-admin revised this gist
Jul 14, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,13 @@ # Xamplez's Root Gist This is the Root Gist for `<PUT YOUR TOPIC HERE>` Xamplez's instance How to use ---------- 1. Fork this Root Gist to create a new snippet. 2. Modify your gist according to Rules. 3. Save it and wait for [<Put Xamplez Instance URL Here>](http://blablabla.blabla) to index it. Rules ----- -
xamplez-admin revised this gist
Jul 14, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,13 @@ # Xamplez's Root Gist This is the Root Gist for `PUT YOUR TOPIC HERE` Xamplez's instance How to use ---------- 1. Fork this Root Gist to create a new snippet. 2. Modify your gist according to Rules. 3. Save it and wait for [Put Xamplez Instance URL Here>](http://blablabla.blabla) to index it. Rules ----- -
xamplez-admin revised this gist
Jul 14, 2013 . 1 changed file with 3 additions and 9 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,11 @@ # Xamplez's Root Gist This is the Root Gist for <PUT YOUR TOPIC HERE> Xamplez's instance How to use ---------- 1. Fork this Root Gist to create a new snippet. 2. Modify your gist according to Rules. 3. Save it and wait for [<Put Xamplez Instance URL Here>]() to index it. -
xamplez-admin created this gist
Jul 14, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ <put your code here> 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ # Xamplez's Root Gist of the Root Gists ## Instructions for Xamplez administrators When you create a new instance of Xamplez, you must first fork your configuration from the [Lord of the Gists](). Then, you create your Root Gist(s) by forking this Root Gist of the Root Gists. It just gives a default template that you can modify. Finally, make the configuration gist point to this/these Root Gist. ## Instructions for Xamplez code snippet creators How to use ---------- 1. Fork the Root Gist to create a new snippet. 2. Modify your gist according to Rules. 3. Save it and wait for [<Put Xamplez Instance URL Here>]() to index it. Rules ----- 1. **You MUST put a gist description** which summarizes your snippet as precisely as possible. 2. All words starting in the description with a dash `#tag` are indexed as tags. 3. You can add as many files as you want in your gist 4. File extensions are used to identify the language (e.g. `code.scala` -> scala) 5. A code snippet shouldn't be too big (a few lines if possible) so don't hesitate to cut in several files 6. If you want to explain precisely your code or provide usage examples, please use a Markdown file (e.g. `README.md`) 7. You can put a License in case your code need to be protected in anyway 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2013 YOUR_NAME_HERE <YOUR_URL_HERE> Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed. DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE FUCK YOU WANT TO.