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
let url = "https://site.com/endpoint"; | |
let client = Client::default(); | |
let response :String = match client | |
.get(url) | |
.send() | |
.await { | |
Ok(mut resp) => match resp.body().await { | |
Ok(r) => String::from_utf8(r.to_vec()).unwrap_or_default(), | |
Err(e) => { | |
println!("{}", e); |
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
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box. | |
✅ did:muport:QmRkqEhrjBmGKLwuucDx8kxuc4nwDJVyX2n4q9gPBMF5XC ✅ | |
Create your profile today to start building social connection and trust online at https://3Box.io/ |
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
Verifying that +fxzo is my openname (Bitcoin username). https://onename.io/fxzo |
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
// Cette requête retourne bien l'enregistrement | |
val cursor: Cursor[JsObject] = connections. | |
find(BSONDocument("lastName" -> BSONString(mask))). | |
cursor[JsObject] | |
// Celle ci ne retourne rien ? | |
val cursor: Cursor[JsObject] = connections. | |
find(BSONDocument("lastName" -> BSONRegex("/"+mask+"/", "i"))). | |
cursor[JsObject] | |
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 elastic | |
import play.api.libs.ws.{Response, SignatureCalculator, WS} | |
import play.api.libs.json._ | |
import play.api.libs.json.Json._ | |
import scala.concurrent._ | |
import ExecutionContext.Implicits.global | |
/** | |
* Created with IntelliJ IDEA. |
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 controllers | |
import play.api._ | |
import libs.iteratee.Iteratee | |
import libs.json.{JsValue, JsArray, Json} | |
import play.api.mvc._ | |
import models._ | |
import collection.mutable | |
object Application extends Controller { |
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 utils | |
import org.joda.time.{Period, LocalDate} | |
object DateUtils { | |
def dateRange(from: LocalDate, to: LocalDate, step: Period): Iterator[LocalDate] = | |
Iterator.iterate(from) { | |
dt => dt.plus(step) | |
}.takeWhile(!_.isAfter(to)) |
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 controllers | |
import play.api.mvc._ | |
import play.api.libs.iteratee.{Iteratee, Input} | |
import play.api.libs.concurrent.Promise | |
import play.api.libs.iteratee.Input.{El, EOF, Empty} | |
import au.com.bytecode.opencsv.CSVReader | |
import java.io.StringReader | |
import scala.collection.JavaConversions._ | |
import play.api.libs.json.Json._ |
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
<!-- Example row of columns --> | |
@table(queryResult, | |
"[Nom du Client|Prenom du Client|Résidence]", | |
"[Nom|prenom|adresse]" | |
) |
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
/** | |
* Handles the comet event stream. | |
*/ | |
def cometStream = Action { | |
AsyncResult { | |
implicit val timeout = Timeout(5.seconds) | |
val actor=Akka.system.actorOf(Props[EventListener]) | |
// Actor is listening for event on the eventStream | |
Akka.system.eventStream.subscribe(actor,classOf[ChangeEvent]) | |
// For each event, stream the data to client |