I hereby claim:
- I am tbje on github.
- I am tbje (https://keybase.io/tbje) on keybase.
- I have a public key ASAKaaSO1Y7nE_TfyvDf1raxzYEXDxvW3vKzeg74psA_Lgo
To claim this, I am signing this object:
import scalanative.native._, stdlib._, stdio._ | |
@extern | |
object Pipe { | |
def popen(cmd: CString, mode: CString): Ptr[FILE] = extern | |
def pclose(file: Ptr[FILE]): Unit = extern | |
} | |
object Shell { | |
def runCommand(cmd: String, cwd: Option[String] = None): Option[String] = |
import com.typesafe.training.sbtkoan.SbtKoan | |
SbtKoan.autoImport.configurations := Set(Configurations.Test, Configuration("multi-jvm", "Multi-jvm dir", true, Nil, true)) |
I hereby claim:
To claim this, I am signing this object:
package misc | |
// Animal | |
abstract class Animal { | |
def name: String | |
def eat(food: Food): Animal = | |
this |
case class Match(cols: Column[_]*) { | |
def against(what: Column[_], modifier: SearchModifier.Value*) = | |
SimpleExpression[Boolean]{ case (nodes, qb) => | |
import qb._ | |
qb.sqlBuilder += "MATCH(" | |
qb.sqlBuilder.sep(nodes, ", ")(expr(_)) | |
qb.sqlBuilder += ") AGAINST(" | |
qb.expr(what.toNode) | |
qb.sqlBuilder += " " | |
qb.sqlBuilder.sep(modifier, " ")(_.toString) |
akka { | |
loggers = [akka.event.slf4j.Slf4jLogger] | |
loglevel = "DEBUG" | |
actor { | |
provider = akka.remote.RemoteActorRefProvider | |
} | |
remote { | |
enabled-transports = [akka.remote.netty.tcp] |
if test $(sbt test | grep -c -E "Reformatted|Failed") != 0 | |
#if test $(sbt compile | grep -c -E "Reformatted|Failed") != 0 | |
#if test $(sbt ";scalariformFormat;test:scalariformFormat" | grep -c -E "Reformatted|Failed") != 0 | |
then | |
echo "Sbt detected problems" | |
exit 1 | |
fi |
object Trond { | |
val age = 25 // value - immutable variable - final in java | |
def sayHi = println(s"My name is Trond and I'm $age years old!") // definition - method | |
} | |
// Trond.age = 27 does not compile as age is immutable (val) | |
Trond.sayHi | |
object Eli { // singleton object - only one of these in the JVM | |
var age = 22 // variable (mutable) |
case class User(name: String, email: String) | |
object User {} // <--- Notice this part here | |
// https://groups.google.com/forum/#!topic/scala-user/jyWBMz5Qslw | |
class Users(tag: Tag) extends Table[User](tag, "User") { | |
def name = column[String]("name", O.NotNull, O.PrimaryKey) | |
def email = column[String]("first", O.NotNull) | |
def * = (name, email) <> (User.tupled, User.unapply) | |
// Compile complains here ---^ | |
} |
// After having run eclipse with-sources=true from sbt (with sbteclipse) .classpath should contain sourcepaths: | |
val eclippseCp = scala.xml.XML.load(".classpath") | |
val entries = eclippseCp.child filter { _.label == "classpathentry" } | |
val sources = entries flatMap { _.attributes filter { _.key=="sourcepath" }} map { _.value.text } | |
val destDir = "~/ensime-sources" // feel free to modify this | |
def fileName(file: String) = new java.io.File(file).getName.replace("-sources.jar", "") | |
import java.io.File |