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
grep -rl matchstring somedir/ | xargs sed -i 's/string1/string2/g' |
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
object prereg { | |
def OptList[A](in: List[A]): List[Option[A]] = | |
None :: in.toList.map(Some(_)) | |
object GG extends Enumeration { val CT, SA, SDIL = Value } | |
object Affinity extends Enumeration { | |
val Agent, Individual, Org_Admin, Org_Assistant, Other = Value | |
} |
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 enumtest | |
import play.api.libs.json._ | |
object EnumUtils { | |
def enumReads[E <: Enumeration](enum: E): Reads[E#Value] = new Reads[E#Value] { | |
def reads(json: JsValue): JsResult[E#Value] = json match { | |
case JsString(s) => { |