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
{ | |
"label" : "go", | |
"properties" : [ | |
{ | |
"label" : "id", | |
"type" : "java.lang.String" | |
}, | |
{ | |
"label" : "name", | |
"type" : "java.lang.String" |
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 com.thinkaurelius.titan.core._ | |
> import com.tinkerpop.blueprints.Vertex | |
> val g = TitanFactory.open(".") | |
> g.makeKey("k").dataType(classOf[String]).list().unique().indexed(classOf[Vertex]).make() | |
// is there any nicer way of creating TitanVertex? | |
> val v = g.addVertex(null).asInstanceOf[TitanVertex] | |
> v.addProperty("k", "foo") |
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
lazy val tagListSettings: Seq[Setting[_]] = | |
TagListPlugin.tagListSettings ++ Seq( | |
TagListKeys.tags := Set( | |
TagListPlugin.Tag("todo", TagListPlugin.Warn) | |
, TagListPlugin.Tag("fixme", TagListPlugin.Error) | |
) | |
) | |
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
object HListSubtract { | |
// We use here this construction: https://gist.github.com/laughedelic/6808000 | |
import UnionHList._ | |
// Filters an HList `L`, trowing away any elements, that are in the given union `U` | |
trait Filter[L <: HList, U] { | |
type Out <: HList | |
def apply(l: L): Out | |
} |
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
trait UnionOf[L <: HList] { | |
type Mix | |
type Out = not[Mix] | |
type is[O] = UnionAux[L, O] | |
} | |
/* Implicits for constructing union: */ | |
object UnionOf { | |
implicit val nil = | |
new UnionOf[HNil] { type Mix = not[Nothing] } |
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
[app] | |
... | |
name: foo_2.10 | |
cross-versioned: false | |
[scala] | |
version: 2.10.0 |
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
namespace FooNamespace | |
{ | |
class Class | |
{ | |
static void Method1(){} | |
static void Method2(){} | |
class InnerClass | |
{ | |
static void InnerMethod1(){} |
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
# assuming that this script lies in g8test/ folder of the root directory of a g8-template | |
cd g8test | |
g8 file://.. --name=template > /dev/null | |
echo "Template applied in g8test/template/" | |
cd template | |
echo "sbt test:" && sbt test | |
cd ../.. |
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
module DecemberFair where | |
import Data.Maybe (listToMaybe) | |
import Data.List (permutations, nubBy) | |
-- only non-symetric permutations | |
permute :: (Eq a) => [a] -> [[a]] | |
permute = nubBy (\ys zs -> ys == (reverse zs)) . permutations | |
-- binary operators |
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
{-# LANGUAGE FunctionalDependencies #-} | |
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, UndecidableInstances #-} | |
module Prolog (Petja, Vasja, Serg, Father, Son, GrandFather) where | |
data Petja = Petja | |
data Vasja = Vasja | |
data Serg = Serg |