Skip to content

Instantly share code, notes, and snippets.

@jmhofer
jmhofer / Build.scala
Last active December 20, 2016 11:49
SBT build for Scalatron (see also https://github.com/jmhofer/scalatron-bot.g8)
// copy all jars from Scalatron's distribution (bin directory) into lib/
lazy val botDirectory = settingKey[File]("bot-directory")
lazy val play = taskKey[Int]("Plays a game of Scalatron, returns the exit code upon completion.")
lazy val Versions = new {
lazy val Specs2 = "3.8.6"
}
lazy val root = (project in file(".")).settings(
@jmhofer
jmhofer / build.sbt
Created April 6, 2012 08:52
sbt build file with sample jacoco4sbt configuration
import de.johoop.jacoco4sbt._
import JacocoPlugin._
organization := "my.organization"
name := "my-project"
scalaVersion := "2.9.1"
seq(jacoco.settings : _*)
@jmhofer
jmhofer / SharpyTheFirst_1.fs
Created August 4, 2012 22:00
Robocode with F#: Very First Steps
#light
namespace johofer
open Robocode
type SharpyTheFirst() =
inherit Robot()
@jmhofer
jmhofer / Main.scala
Created October 25, 2012 08:46
Union Bug in Slick
import scala.slick.driver.ExtendedProfile
import scala.slick.driver.H2Driver.simple._
import Database.threadLocalSession
abstract class Drinks(tableName: String) extends Table[(Long, Long)](tableName) {
def pk = column[Long]("pk")
def pkCup = column[Long]("pkCup")
def * = pk ~ pkCup
}
// plain old Java
import rx.Observable;
import rx.util.functions.Action1;
public class Main {
public static void main(String[] args) {
String[] names = new String[] {
"foo", "bar", "baz"
};