Skip to content

Instantly share code, notes, and snippets.

View kermitas's full-sized avatar

Artur Stanek kermitas

View GitHub Profile
@kermitas
kermitas / index_of_genome_banks.md
Last active May 30, 2016 18:04
Index of genome banks.

Genome banks:

website can genome files be uploaded can genome files be downloaded additional info
SureVAULT no yes the service is connected with SureDNA (the whole genome sequencing service)
@kermitas
kermitas / index_of_genome_use_cases.md
Last active May 25, 2016 18:20
Index of genome use cases.
@kermitas
kermitas / index_of_genome_sequencing_and_analysing_websites.md
Last active March 14, 2018 09:54
Indexes of genome sequencing and genome analysing websites.
@kermitas
kermitas / ProjectLiftProblemMain.scala
Created January 26, 2016 19:04
File that holds Project settings (in SBT project structure).
import sbt._
import Keys._
import Implicits._
import SettingsScala.{ v210, v211 }
object ProjectLiftProblemMain {
val subProjectName = "main"
val mainClassFullyQualifiedName: Option[String] = Some("org.lift.problem.Main")
@kermitas
kermitas / SettingsAkka.scala
Created January 26, 2016 18:29
File that holds Akka settings (in SBT project structure).
import sbt._
import Keys._
object SettingsAkka {
val akkaVersion = "2.3.11"
val akkaStreamsVersion = "1.0-RC3"
def apply() = Seq(
libraryDependencies += "com.typesafe.akka" %% "akka-actor" % akkaVersion,
@kermitas
kermitas / Build.scala
Last active January 27, 2016 00:16
Easy to read and easy to maintain Build.scala (SBT's main file).
object Build extends sbt.Build {
implicit val artifactConfig = ArtifactConfig(
name = "lift-problem",
organization = "org.stanek",
version = "0.1.0-SNAPSHOT"
)
// ==== projects definition
@kermitas
kermitas / Scala45Pl20151024FutureTest.scala
Last active February 16, 2016 16:18
Short lecture about Future(s) at #scala45pl, 2015-10-24, http://www.meetup.com/WarszawScaLa/events/225320171/ .
package scala.concurrent
import duration._
import scala.util.{ Success, Try }
import org.scalatest.FeatureSpec
/**
* #scala45pl http://www.meetup.com/WarszawScaLa/events/225320171/
*
* Also during this presentation:
@kermitas
kermitas / FutureUtils.scala
Last active October 22, 2015 23:31
Future.sequence() is fine but it will fail if any of passed Futures will fail. Sometimes we would like to have the same functionality but it should not fail - it should just have a collection of completed Futures (completed with Success or Failure).
package scala.concurrent
import scala.util.{ Try, Success }
object FutureUtils {
/**
* @return resulted future will be completed when all passed futures will be completed (either with Success or Future)
*/
def completeAll[T](fs: Future[T]*)(implicit ec: ExecutionContext): Future[Seq[Future[T]]] = Future.successful(fs).flatMap { fs =>
@kermitas
kermitas / FutureStackTraceTest.scala
Last active October 21, 2015 20:59
By using future.recover() we can easily have informative stack traces.
package scala.concurrent
import scala.concurrent.duration._
import org.scalatest.FeatureSpec
class FutureStackTraceTest extends FeatureSpec {
ignore("stack trace of Future") {
implicit val executionContext = scala.concurrent.ExecutionContext.Implicits.global
@kermitas
kermitas / CallingThreadExecutionContext.scala
Last active November 21, 2017 05:37
Maybe not perfect but simple calling thread ExecutionContext can help if we already have thread (for example: taken from thread pool) and want to execute few operations in a row.
/**
* [[ExecutionContext]] that will execute actions in calling thread (and by that making them blocking).
*/
class CallingThreadExecutionContext extends ExecutionContext {
override def execute(runnable: Runnable): Unit = runnable.run
override def reportFailure(t: Throwable): Unit = throw t
}