$ demo on|off [hhmm]
Enable or disable the demo mode on a connected Android device or emulator. You can also pass in a custom value for the system clock in the HHMM format (only used when you use the on command).
| /* | |
| * Copyright 2017 Google Inc. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| /** | |
| * Generate Case class from DataFrame.schema | |
| * | |
| * val df:DataFrame = ... | |
| * | |
| * val s2cc = new Schema2CaseClass | |
| * import s2cc.implicit._ | |
| * | |
| * println(s2cc.schemaToCaseClass(df.schema, "MyClass")) | |
| * |
| /** | |
| * This is an example of a one-way or "messaging span", which is possible by use of the {@link | |
| * Span#flush()} operator. | |
| * | |
| * <p>Note that this uses a span as a kafka key, not because it is recommended, rather as it is | |
| * convenient for demonstration, since kafka doesn't have message properties. | |
| * | |
| * <p>See https://github.com/openzipkin/zipkin/issues/1243 | |
| */ | |
| public class KafkaExampleIT { |
| package com.example.hello.api | |
| import akka.NotUsed | |
| import com.example.hello.api.SlackCustomIntegration.Message | |
| import com.lightbend.lagom.scaladsl.api.{Descriptor, Service, ServiceCall} | |
| import com.lightbend.lagom.scaladsl.api.Service._ | |
| import com.lightbend.lagom.scaladsl.api.transport.Method | |
| import play.api.libs.json._ | |
| import play.api.libs.functional.syntax._ |
$ demo on|off [hhmm]
Enable or disable the demo mode on a connected Android device or emulator. You can also pass in a custom value for the system clock in the HHMM format (only used when you use the on command).
| <?xml version="1.0" encoding="utf-8"?> | |
| <!-- | |
| Copyright 2016 Google Inc. | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 |
| import java.util | |
| import org.apache.kafka.clients.consumer.KafkaConsumer | |
| import scala.collection.JavaConverters._ | |
| object ConsumerExample extends App { | |
| import java.util.Properties |
| import akka.actor.ActorSystem | |
| import akka.http.scaladsl.Http | |
| import akka.stream.ActorMaterializer | |
| object Boot extends App with Service with CorsSupport { | |
| override implicit val system = ActorSystem() | |
| override implicit val executor = system.dispatcher | |
| override implicit val materializer = ActorMaterializer() | |
| Http().bindAndHandle(corsHandler(routes), "0.0.0.0", 1337) |
| # Ask for the user password | |
| # Script only works if sudo caches the password for a few minutes | |
| sudo true | |
| # Install kernel extra's to enable docker aufs support | |
| sudo apt-get -y install linux-image-extra-$(uname -r) | |
| # Add Docker PPA and install latest version | |
| sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
| sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" |