This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
©2012 Viktor Klang | |
object Actor { | |
import java.util.concurrent.{ConcurrentLinkedQueue, Executor} | |
import java.util.concurrent.atomic.{AtomicBoolean} | |
type Behavior = Any => Effect | |
sealed trait Effect { def getOrElse(old: Behavior): Behavior } | |
case object Stay extends Effect { def getOrElse(old: Behavior): Behavior = old } | |
case class Become(like: Behavior) extends Effect { def getOrElse(old: Behavior): Behavior = like } |
apply plugin: 'java' | |
apply plugin: 'scala' | |
// For those using Eclipse or IntelliJ IDEA | |
apply plugin: 'eclipse' | |
apply plugin: 'idea' | |
def findPlay20(){ | |
def pathEnvName = ['PATH', 'Path'].find{ System.getenv()[it] != null } | |
for(path in System.getenv()[pathEnvName].split(File.pathSeparator)){ | |
for(playExec in ['play.bat', 'play.sh', 'play']){ |