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
object Test { | |
def main(args: Array[String]): Unit = { | |
import org.json4s._ | |
import org.json4s.JsonDSL._ | |
import org.json4s.native.JsonMethods._ | |
import org.json4s.native.Serialization | |
import org.json4s.native.Serialization.{ read, write, writePretty } | |
sealed trait Test | |
case object TestA extends Test | |
case object TestB extends Test |
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 | |
/** | |
* php --version | |
PHP 5.4.25-1+sury.org~precise+2 (cli) (built: Feb 12 2014 10:45:30) | |
Copyright (c) 1997-2014 The PHP Group | |
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies | |
**/ | |
$headers = []; |
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 | |
namespace Anima\Core\Services; | |
interface AnimaErpDataObject { | |
public function validate(); | |
public function toArray(); | |
} | |
class AnimaErpPayment implements AnimaErpDataObject |
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
{ | |
"response":{ | |
"coarseTopics":[ | |
{ | |
"id":0, | |
"label":"Business", | |
"wikiLink":"http://en.wikipedia.org/Category:Business", | |
"score":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
// before: | |
redisBlocking.blpop(Seq("workList", "otherKeyWithWork"), 5 seconds).map(result => { | |
result.map(_.map({ | |
case (key, work) => println(s"list $key has work : ${work.utf8String}") | |
})) | |
}) | |
// after: |
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
<p>Here at SNEAKHYPE, we love trees. So here’s a gallery of some of the most beautiful tree photography we’ve come across. <span id="more-64403"></span></p> | |
<p id="source">Source: <a href="http://creativefan.com/50-most-beautiful-tree-photos/" rel="external" target="_blank" rel="external nofollow">creativefan.com</a></p> | |
<div id="gallery" class="cfx"> | |
<div class="options"> | |
<span>Click an image to see it fullsize</span> | |
<strong><span>Expand</span> all images</strong> |
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
object MyActor { | |
val inProgress = metrics.counter("fetching-in-progress") // yammer/coda hales metrics | |
} | |
// I have around 25.000 actors of this type running | |
// runs on my-dispatcher | |
class MyActor extends Actor { | |
val id = ... | |
implicit val ec = context.system.dispatchers.lookup("dispatcher-for-IO-stuff") |
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> trait MyTrait extends (String => Int => Int) | |
defined trait MyTrait | |
scala> class X extends MyTrait { | |
| def apply(x: String)(i: Int): Int = 10 | |
| } | |
<console>:8: error: class X needs to be abstract, since method apply in trait Function1 of type (v1: String)Int => Int is not defined | |
(Note that T1 does not match String) | |
class X extends MyTrait { |
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 com.busk.stepsgraph | |
import akka.dispatch.{ ExecutionContext, Promise, Future, Await } | |
import java.util.concurrent.{ Executors, ExecutorService} | |
import akka.util.duration._ | |
import collection.mutable.HashMap | |
object StepsGraph { | |
def step[R, U](stepname: String, depStep: Step[_, U])(f: U => R): Step[U, R] = { | |
Step[U, R](stepname, Seq(depStep), f) |
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
name := "Test" | |
version := "0.1" | |
scalaVersion := "2.10.0" | |
resolvers += "Sonatype Repository" at "http://oss.sonatype.org/content/repositories/releases" | |
libraryDependencies ++= Seq( | |
"org.scalatra" % "scalatra" % "2.2.0", |