This re-styles your sublime text sidebar to be dark, it fits default Monokai theme.
Save the Default.sublime-theme file into packages/Theme - Default, make a backup of your original if you want to be able to go back easily.
Based on:
import Stream._ | |
/** A possibly finite stream that repeatedly applies a given function to a start value. | |
* | |
* @param start the start value of the stream | |
* @param f the function that's repeatedly applied | |
* @return the stream returning the possibly finite sequence of values `start, f(start), f(f(start)), ...` | |
*/ | |
def iterate[A](f: A => A, a: A): Stream[A] = unfold((x: A) => Some((x, f(x))), a) |
brew update | |
brew versions FORMULA | |
cd `brew --prefix` | |
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions" | |
brew install FORMULA | |
brew switch FORMULA VERSION | |
git checkout -- Library/Formula/FORMULA.rb # reset formula | |
## Example: Using Subversion 1.6.17 | |
# |
This re-styles your sublime text sidebar to be dark, it fits default Monokai theme.
Save the Default.sublime-theme file into packages/Theme - Default, make a backup of your original if you want to be able to go back easily.
Based on:
// optionally filter on a column with a supplied predicate | |
case class MaybeFilter[X, Y](val query: scala.slick.lifted.Query[X, Y]) { | |
def filter[T](data: Option[T])(f: T => X => scala.slick.lifted.Column[Boolean]) = { | |
data.map(v => MaybeFilter(query.filter(f(v)))).getOrElse(this) | |
} | |
} | |
// example use case | |
def find(id: Option[Int], createdMin: Option[Date], createdMax: Option[Date], modifiedMin: Option[Date], modifiedMax: Option[Date]) = { |
// Please comment in case of typos or bugs | |
import scala.slick.driver.H2Driver._ | |
val db = Database.for...(...) | |
case class Record( ... ) | |
class Records(tag: Tag) extends Table[Record](tag,"RECORDS"){ | |
... | |
def * = ... <> (Record.tupled,Record.unapply) | |
// place additional methods here which return values of type Column |
{-# LANGUAGE GADTs, MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances, FlexibleContexts, OverlappingInstances, ScopedTypeVariables #-} | |
-- The goal of the code below is to emulate OO method dispatch. | |
-- | |
-- The use-case is binding to a C++ GUI framework that is heavily OO and | |
-- providing the user with a familiar experience. | |
-- | |
-- This scheme sketched out below emulates not only OO style method dispatch | |
-- but also allows users to "sub-class", "override" and even arbitrarily | |
-- change the type signature of overridden methods, all without touching the | |
-- original library code. |
import org.specs2._ | |
import execute._ | |
import specification._ | |
import core._ | |
class TestSuite(tests: Fragment*) extends Specification { | |
def is = br ^ Fragments.foreach(tests)(f => Fragments(f, br)) | |
} | |
object TestSuite { |
"biz.enef" %% "slogging-slf4j" % "0.3" | |
"biz.enef" %% "surf-akka" % "0.0.1" | |
"bound" %% "bound-core" % "1.3.0" | |
"bound" %% "bound-f0-binding" % "1.3.0" | |
"bound" %% "bound-scalacheck-binding" % "1.3.0" | |
"com.elderresearch" %% "monadic-jfx" % "0.1.0" | |
"com.geteit" %% "geteit-app" % "0.1" | |
"com.geteit" %% "geteit-utils" % "0.3" | |
"com.github.gearzero" %% "slick-threeten-mapper" % "0.1.0" | |
"com.github.imapi" %% "spark-sqs-receiver" % "1.0.1" |
scala> import cats.implicits._ | |
import cats.implicits._ | |
scala> (1 -> 2) === (1 -> 3) | |
res0: Boolean = true | |
scala> import scala.reflect.runtime.universe._ | |
import scala.reflect.runtime.universe._ | |
scala> showCode(reify { (1 -> 2) === (1 -> 3) }.tree) |
import scalatags.Text.all._ | |
import collection.mutable | |
// http://flatuicolors.com/ | |
val red = "#c0392b" | |
val green = "#27ae60" | |
val yellow = "#f39c12" | |
val blue = "#2980b9" | |
val magenta = "#8e44ad" | |
val cyan = "#16a085" | |
val black = "#000" |