This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.liba | |
class UtilityA { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.Semaphore | |
import scala.annotation.tailrec | |
import scala.collection.immutable.Queue | |
import scala.concurrent.Promise | |
import monix.eval.Task | |
import monix.execution.atomic.AtomicAny | |
import monix.execution.atomic.PaddingStrategy.LeftRight128 | |
import monix.tail.Iterant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** You can represent numbers as types. Why? Because you can! | |
*/ | |
object TypesafeNumbers extends App { | |
println(Number[E2[`2`] + E1[`4`] + `6`]) | |
println(Number[`8` ~ `6` ~ `7` ~ `5` ~ `3` ~ `0` ~ `9`]) | |
} | |
// raw digits |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Mock version of a Database Session | |
*/ | |
class Session { | |
println("opened session") | |
def close() = println("closed session") | |
} | |
/* | |
* Mimic Slick's `database.withSession` method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.slick.driver.H2Driver.simple._ | |
import Database.threadLocalSession | |
object FailingApp extends App with Tables with PopulateTables { | |
val db = Database.forURL("jdbc:h2:mem:test1", driver = "org.h2.Driver") | |
/** Run a labeled test in a block, catching and printing Exceptions. | |
* Set quiet to `false` for the whole stack trace. (default) | |
* Set quiet to `true` for just the exception's `toString`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Foo | |
{ | |
public void bar(String a){ | |
System.out.println("Foo.bar(a)"); | |
} | |
public void bar(String a, String b){ | |
System.out.println("Foo.bar(a, b)"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
var notifyFunc = chat.notify | |
var extraNotifyFunc = function(jid, sender, message){ | |
selfPopups(jid, message); | |
notifyFunc(jid, sender, message); | |
} | |
chat.notify = extraNotifyFunc |