⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
class A | |
class A2 extends A | |
class B | |
trait M[X] | |
// | |
// Upper Type Bound | |
// | |
def upperTypeBound[AA <: A](x: AA): A = x |
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
trait Block[T] extends Function1[String, T] | |
object Block { | |
implicit def functionBlock[T](f: String => T): Block[T] = new Block[T] { | |
def apply(s: String): T = f(s) | |
} | |
implicit val unitBlock: Block[Unit] = new Block[Unit] { | |
def apply(s: String): Unit = {} | |
} | |
} |
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
Originally: | |
https://gist.github.com/7565976a89d5da1511ce | |
Hi Donald (and Martin), | |
Thanks for pinging me; it's nice to know Typesafe is keeping tabs on this, and I | |
appreciate the tone. This is a Yegge-long response, but given that you and | |
Martin are the two people best-situated to do anything about this, I'd rather | |
err on the side of giving you too much to think about. I realize I'm being very | |
critical of something in which you've invested a great deal (both financially |
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
#Add these mappings to .inputrc | |
"\e[1;9D": backward-word | |
"\e[1;9C": forward-word | |
"\e[D": beginning-of-line | |
"\e[C": end-of-line | |
"\e[1;3Z": backward-kill-word #configure iterm to send this signal for alt-delete | |
"\e[1;4Z": backward-kill-line #configure iterm to send this signal for cmd-delete |
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
"copy file" in { | |
var i = 0 | |
val fileGenerator = Enumerator.fromCallback( () => | |
if(i<1000){ i+=1; Future.successful(Some((new java.util.Date).getTime.toString + "\n")) } else Future(None) | |
) | |
val f = FileChannel("/tmp/testwrite.txt").delete.writing.create | |
val f2 = FileChannel("/tmp/testwrite2.txt").delete.writing.create | |
fileGenerator // generates data |
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
find . -name *.jar -exec bash -c "echo {} && jar tvf {} | head -n 1" \; |
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
package demos | |
import org.specs2.mutable._ | |
class FPStyleDIDemo extends Specification { | |
class Db { | |
def name = "sony-db" | |
} | |
object Db { |
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
package demos | |
import org.specs2.mutable._ | |
class ScalaComponentsUseExtends extends Specification { | |
trait DbComp { | |
class Db { | |
def name = "prod-db" | |
} |
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
for { | |
product <- productRepo.getProduct(id) | |
metadata <- getMetadata(product.id) | |
} yield metadata | |
flow { | |
val product = productRepo.getProduct(id)() |
OlderNewer