Skip to content

Instantly share code, notes, and snippets.

View ArnaudPiroelle's full-sized avatar

Arnaud Piroelle ArnaudPiroelle

View GitHub Profile
version: "3"
services:
jackett:
container_name: jackett
image: linuxserver/jackett
ports:
- 9117:9117
environment:
- TZ=Europe/Paris
- PUID=1000
@ArnaudPiroelle
ArnaudPiroelle / FutureUtils.kt
Created February 4, 2020 10:45
FutureUtils.kt
package io.robotsdk.model.coroutines.utils
import com.aldebaran.qi.Future
import java.util.concurrent.CancellationException
import kotlin.coroutines.Continuation
import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException
import kotlin.coroutines.suspendCoroutine
suspend fun <T> Future<T>.await(): T {
onRobot {
// Get a single service
val conversation: Conversation = getService()
val osef = conversation.makeSay(robotContext, Phrase("Hello"))
// Make a simple say
val say: Say = say("Hello you !")
// Wait for focus before start a action
import Foundation
import Firebase
extension AppDelegate {
func setupNotifications(application: UIApplication) {
FIRApp.configure()
let settings: UIUserNotificationSettings = UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: nil)
application.registerUserNotificationSettings(settings)
let thumbnail: UIImageView = ...
thumbnail.rx_setImage(url: URL(string: currentVideo.thumbnail)!, placeholderImage: UIImage(named: "Placeholder Video"), animated: true)
let params: QueryParameters = ["key": "value"]
let headers: Headers = ["key", "value"]
RxNetwork.request("http://www.google.com", headers: headers).asData()
.subscribe(onNext: { data in
// Use data as Data
})
let thumbnail: UIImageView = ...
thumbnail.rx_setImage(url: URL(string: currentVideo.thumbnail)!, placeholderImage: UIImage(named: "Placeholder Video"))
RxNetwork.withData<Model>(URLRequest(url: url!))
.subscribe(onNext: { data in
// Use data as Data
})
let videoObservable : Observable<Video> = RxNetwork.withJSON(URLRequest(url: url!))