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
<?php | |
namespace Anima\Core\Services; | |
interface AnimaErpDataObject { | |
public function validate(); | |
public function toArray(); | |
} | |
class AnimaErpPayment implements AnimaErpDataObject |
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
<?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 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 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 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 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! | |
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
{ | |
"results":[{ | |
"articles":[{ | |
"id":147239368, | |
"created_at":"2015-02-06 13:49:11", | |
"type":"articles", | |
"title":"INVESTOR ALERT: Levi & Korsinsky, LLP Commences an Investigation of the Board of Directors of Hospira Inc. In Connection With the Fairness of the Sale of the Company to Pfizer -- HSP", | |
"language_code":"en", | |
"url":"http://www.benzinga.com/pressreleases/15/02/n5218605/investor-alert-levi-korsinsky-llp-commences-an-investigation-of-the-boa", | |
"published_at":"2015-02-06 13:41:48", |
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
{ | |
"id":147061902, | |
"created_at":"2015-02-05 15:30:30", | |
"type":"articles", | |
"title":"Why Pfizer wants Hospira", | |
"language_code":"en", | |
"url":"http://www.cnbc.com/id/102400727", | |
"content":"<div class=\"group\" itemprop=\"articleBody\" gravityscore=\"162\" gravitynodes=\"6\">\n <p> Hospira makes biosimilars as well. Its injectable and infused pharmaceuticals business includes about 200 generic drugs, like the antibacterials azithromycin and ceftazidime, and the anticoagulant heparin sodium. </p>\n <p>Hospira has also been in the news in recent years as the only U.S. maker of drugs used in lethal injection. (The company said in 2011 it would stop making the anesthetic, <a class=\"inline_asset\" href=\"http://www.nytimes.com/2011/01/22/us/22lethal.html?_r=1&\" target=\"_blank\">sodium thiopental</a>, because it didn't have U.S. manufacturing capabilities for it, and it had run into opposition in Italy.)</p>\n <p> Read More<a href=\"/id/102396903\" target=\"_self\">Pricing wars heat up over hepatitis |
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
package com.busk.searchserver.api | |
import javax.servlet.http.{HttpServletRequest, HttpServletResponse} | |
import org.scalatra.ScalatraBase | |
import org.scalatra.auth.strategy.{BasicAuthStrategy, BasicAuthSupport} | |
import org.scalatra.auth.{ScentryConfig, ScentrySupport} | |
/** | |
* Created by felipehummel on 12/01/15. |
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 JsonExtensions { | |
def withDefaultCreatedAt[T](base: Format[T]) = new Format[T]{ | |
def reads(json: JsValue): JsResult[T] = base.compose(JsonExtensions.withDefault("createdAt", DateTime.now())).reads(json) | |
def writes(o: T): JsValue = base.writes(o) | |
} | |
def withDefault[A](key:String, default:A)(implicit writes:Writes[A]) = | |
__.json.update((__ \ key).json.copyFrom((__ \ key).json.pick orElse Reads.pure(Json.toJson(default)))) | |
} | |
// ..... |
OlderNewer