This file contains hidden or 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
| --- | |
| # ^^^ YAML documents must begin with the document separator "---" | |
| # | |
| #### Example docblock, I like to put a descriptive comment at the top of my | |
| #### playbooks. | |
| # | |
| # Overview: Playbook to bootstrap a new host for configuration management. | |
| # Applies to: production | |
| # Description: | |
| # Ensures that a host is configured for management with Ansible. |
This file contains hidden or 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
| scala> List("foo","bar","baz") andThen { | |
| | case "bar" => 1.0 | |
| | case _ => 0.0 | |
| | } | |
| res0: PartialFunction[Int,Double] = <function1> | |
| scala> res0(0) | |
| res1: Double = 0.0 | |
| scala> res0(1) |
This file contains hidden or 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
| [error] SERVER ERROR: Service Unavailable url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.apache.maven/maven-aether-provider/3.1.0/jars/maven-aether-provider.jar |
This file contains hidden or 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
| curl -X POST \ | |
| --header "Content-Type: application/json" \ | |
| --header "im-wskid:1386609095" \ | |
| --header "im-secret:hLGJURZG0X5h9k6B07Hh55jqdYYlE/AOVnsQxdJ5bhXlbLhldyaSY1hpJ5mHfyIfGBuhAd4h7iIFq251vFoA2yKA4KXk6Ypp0hO28LblJA4nI+IwP8nCmJvkHWFSnKZADqhKV/7iScaay7PcWvctgAN+1JksASCYGfwR0sN0EKhhMmKOKq6hghGM3wazLAiuS61mnObfKB0xGv9nWJmKtg==" \ | |
| -d '{"to":["qwertyuiop"],"kind":"device:global","preferred":[{"kind":"services-intel-developer","config":{"foo":"bar"}}],"minimum":[]}' \ | |
| -v https://imqa-su3264.svc.m.infra-host.com:9443/allocations | |
| =================== |
This file contains hidden or 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
| Welcome to Scala version 2.9.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_25). | |
| Type in expressions to have them evaluated. | |
| Type :help for more information. | |
| scala> import shapeless._, HList._ | |
| import shapeless._ | |
| import HList._ | |
| scala> "foo" :: 124 :: HNil | |
| res0: shapeless.::[java.lang.String,shapeless.::[Int,shapeless.HNil]] = foo :: 124 :: HNil |
This file contains hidden or 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 scalaz.akkaz | |
| import scala.language.higherKinds | |
| import scalaz.{Monad, Monoid, Comonad, Traverse, Applicative} | |
| import scala.concurrent.{Await, ExecutionContext, Future, Promise} | |
| import scala.concurrent.duration._ | |
| /** | |
| * @see [[scalaz.akkaz.future]] for examples | |
| */ |
This file contains hidden or 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
| scalaVersion := "2.10.0" | |
| libraryDependencies += "org.scalaz" %% "scalaz-core" % "7.0.0-M7" | |
| resolvers += "sontatype.releases" at "https://oss.sonatype.org/content/repositories/releases/" |
This file contains hidden or 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 demo | |
| class User(name: String, age: Int) | |
| object Example { | |
| import com.esotericsoftware.kryo.{Kryo,io}, io.{Output,Input} | |
| val kryo = new Kryo | |
| kryo.register(classOf[User]) |
This file contains hidden or 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
| <?php | |
| // set a value | |
| $theCount = 123; | |
| // set a string that happens to be the same name as the | |
| // previous (unrelated) value | |
| $someString = 'theCount'; | |
| // print out the string... oh... WAT. | |
| echo $$someString; // echo's 123 | |
| echo "\n"; |
This file contains hidden or 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 js { | |
| implicit def arrayExpr[A](es: Seq[A])(implicit f: A => Expr): ArrayExpr = | |
| ArrayExpr(es.map(f)) | |
| implicit def objectExpr[A](fs: Seq[(String, A)])(implicit f: A => Expr): ObjectExpr = | |
| ObjectExpr(fs.map { case (k, v) => (k, f(v)) }) | |
| implicit def booleanLiteral(b: Boolean): LiteralBoolean = LiteralBoolean(b) | |
| implicit def nodeSeqLiteral(ns: NodeSeq): LiteralNodeSeq = LiteralNodeSeq(ns) | |
| implicit def numericLiteral[A: Numeric](n: A): LiteralNumeric[A] = LiteralNumeric(n) | |
| implicit def stringLiteral(s: String): LiteralString = LiteralString(s) | |
| implicit def symbolReference(in: Symbol): Reference = Reference(in.name) |