Kill sbt forked jvm
Recently I’ve been playing with akka under sbt. I often run sbt console and then use run command to execute my app. It works great for single threaded applications that exits by itself. When using akka, there are couple of threads that do not quit. Hitting ctrl+c quits running application AND unfortunately also sbt. I figured out, that it can be fixed with a little bit of hacking.
First, set fork in run := true is build.sbt. Then you can stop forked jam with the following shell line:
I’d suggest making it an alias or even better save as Shell Extension available via hotkey using awesome alfred app.
Neodatis OdbConfiguration printout
In case I might need this again…
Source: gist.github.com
Simple scala benchmark utility
Very, very simple. Strongly influenced by Ruby’s Benchmark
Usage …
.. and the result
Scala specs cheatsheet
Based on MatchersGuide
akka singleton actor
If you ever want to do something like this:
DON’T! NEVER. Even in tests or something, doesn’t matter, never!
Using singleton actor object + scala-specs = silen fail with message “null” and one big WTF.
akka actors cheatsheet
Small cheatsheet for great akka library
Scala: Combine several Partial Functions into one
Good old C-style for loop in scala
Source: gist.github.com
Handle exceptions inside Actor
and then
Source: gist.github.com
Decompile scala
Scala collections #collect
Scala remote actors
Server
Client
Scala String replace
Worth remembering, thx to lopex