Skip to content

Instantly share code, notes, and snippets.

View lefou's full-sized avatar

Tobias Roeser lefou

  • Freelancer, working remotely
  • Germany, Lusatia
  • 11:07 (UTC +02:00)
  • Mastodon @[email protected]
View GitHub Profile
@lefou
lefou / rmvn.sh
Created February 8, 2018 09:21
Run Maven from the project root directory with the current project pre-selected
#!/usr/bin/env bash
basedir=
dirname=
found=0
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
@lefou
lefou / SimpleTest.java
Created November 15, 2014 10:05
Lambda Test based TestNG Suite fails under Ant
// copy this to: src/test/java/org/example/SimpleTest.java
package org.example;
import de.tobiasroeser.lambdatest.testng.FreeSpec;
class SimpleTest extends FreeSpec {{
test("1 + 1 = 2", () -> {
assertEquals(1 + 1, 2);
});
@lefou
lefou / TargetRefs2.scala
Created May 28, 2014 13:40
Minimized test case to reproduce a ScalaTest issue
package scalatest_issue
// The following test will not run with Scala 2.11.1 and ScalaTest 2.1.7
import org.scalatest.FreeSpec
object TargetRefs2 {
def apply(targetRefs: String*): TargetRefs2 = new TargetRefs2(Seq(targetRefs))
}
# ~/.screenrc
# use visual bell
vbell on
# set a big scrolling buffer
defscrollback 1000
# Set the caption on the bottom line
caption always "%{= kw}%-w%{= BW}%n %t%{-}%+w %-= @%H - %LD %d %LM - %c"
@lefou
lefou / commandline output of scalac failure
Last active December 15, 2015 17:49
scalac depends on order of given source files when compiling scala library. The build fails, if the sources are unordered but succeeds when sorted before. scalac is the current "starr" compiler. Its Bundle-Version is "2.11.0-20121228-195556-b7840d6b41". Although SBuild (http://sbuild.tototec.de) is used as buildsystem, the commandl ine used to i…
lefou@x2 ~/work/tototec/sbuild/build-foreign-project-examples/scala.git $ sbuild-svn-unsorted compileScala-quick-library
Calculating dependency tree...
[0%] Executing...
[2%] Executing target: compile-forkjoin
Compiling 10 source files to /home/lefou/work/tototec/sbuild/build-foreign-project-examples/scala.git/target/forkjoin/classes
warning: [options] bootstrap class path not set in conjunction with -source 1.5
1 warning
[3%] Executing target: target/forkjoin.jar
Building jar: /home/lefou/work/tototec/sbuild/build-foreign-project-examples/scala.git/target/forkjoin.jar
[10%] Executing target: compileJava-locker-library
@lefou
lefou / scala.nanorc
Last active November 18, 2021 05:06
Color theme for console editor nano, supporting Scala language.
## Nano color theme for Scala.
## 2013, 2018, Tobias Roeser
##
syntax "scala" "\.(scala|sbt|sc)$"
color green "\<(new|this|transient)\>"
color green "\<(catch|do|else|finally|for|if|match|return|switch|throw|try|val|var|while)\>"
color green "\<(def|abstract|class|extends|final|import|package|private|protected|public|trait|volatile)\>"
color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)|\+|\-|\*|\/"
color red "@(\\.|[^(])*"
color yellow "\<(true|false|null)\>"