Skip to content

Instantly share code, notes, and snippets.

View passichenko's full-sized avatar

Sergey Passichenko passichenko

View GitHub Profile
@passichenko
passichenko / TestScala
Created October 16, 2013 03:01
case class instantiation from class name via reflection
package test
object TestScala extends App {
val className = "test.MyClass"
val value = "test"
import scala.reflect.runtime.{universe => ru}
val mirror = ru.runtimeMirror(getClass.getClassLoader)
val classSymbol = mirror.staticClass(className)
@passichenko
passichenko / gist:6980170
Last active December 25, 2015 12:59
corrected
public class Sample {
private volatile boolean ready = false;
private final Object lock = new Object();
public void m1() throws InterruptedException {
synchronized(lock) {
new Thread(new Runnable() {
public void run() {
m2();
}
@passichenko
passichenko / Test.scala
Last active December 15, 2015 22:39
common api for ScalaTest FreeSpec and path.FreeSpec via abstract stuctured type
package test
import org.scalatest._
/**
* Author: Sergey V. Passichenko
* Date: 08.04.13
*/
class Test1 extends FreeSpec with Commons {
commons()