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
<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
// 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
{ | |
"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
<?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
<?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
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
package com.busk.searching; | |
import org.elasticsearch.action.search.SearchRequestBuilder; | |
import org.elasticsearch.client.transport.TransportClient; | |
import org.elasticsearch.common.settings.ImmutableSettings; | |
import org.elasticsearch.common.transport.InetSocketTransportAddress; | |
import org.elasticsearch.search.aggregations.bucket.significant.SignificantTermsBuilder; | |
import static org.elasticsearch.index.query.QueryBuilders.*; | |
import static org.elasticsearch.search.aggregations.AggregationBuilders.*; |
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
{ | |
"results":[{ | |
"articles":[{ | |
"id":131720411, | |
"created_at":"2014-11-03 18:34:53", | |
"type":"articles", | |
"title":"Apucarana: Polícia Militar evita mais quatro golpes do falso sequestro", | |
"language_code":"pt", | |
"url":"http://www.tnonline.com.br/noticias/apucarana/45,304044,03,11,apucarana-policia-militar-evita-mais-quatro-golpes-do-falso-sequestro.shtml", | |
"published_at":"2014-11-03 18:34:18", |
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
// Construtor da classe é (nome: String) | |
class MinhaClasse(nome: String) { | |
def olaQuem() = s"Olá $nome!" | |
} | |
val minha = new MinhaClasse("Felipe") | |
val msg = minha.olaQuem() | |
println(msg) // Olá Felipe! | |