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
| import typings.d3DashSelectionLib.d3DashSelectionMod.ValueFn | |
| import typings.d3Lib.d3Mod.{^ => d3} | |
| import typings.stdLib.HTMLDivElement | |
| import typings.d3DashSelectionLib.d3DashSelectionLibStrings.div | |
| import scala.scalajs.js | |
| import scala.scalajs.js.| | |
| val data = js.Array(4, 8, 15, 16, 23, 42) | |
| val x = d3.scaleLinear() | |
| .domain(js.Array(0, data.max)) |
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
| var data = [4, 8, 15, 16, 23, 42]; | |
| var x = d3.scaleLinear() | |
| .domain([0, d3.max(data)]) | |
| .range([0, 420]); | |
| d3.select(".chart") | |
| .selectAll("div") | |
| .data(data) | |
| .enter().append("div") | |
| .style("width", function(d) { return x(d) + "px"; }) | |
| .text(function(d) { return d; }); |
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
| val json = ujson.read("""{"name":"Some Group","persons":[{"name":"Antoine","age":27},{"name":"Souad","age":29}]}""") | |
| println(json("persons")(0)) // prints {"name":"Antoine","age":27} |
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
| println(write(Person("Antoine", 27))) // prints {"name":"Antoine","age":27} | |
| println(write( | |
| Group( | |
| "Some Group", | |
| List( | |
| Person("Antoine", 27), | |
| Person("Souad", 29) | |
| ) | |
| ) | |
| )) // prints {"name":"Some Group","persons":[{"name":"Antoine","age":27},{"name":"Souad","age":29}]} |
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
| import upickle.default._ | |
| object Person { | |
| implicit val readWriter: ReadWriter[Person] = macroRW | |
| } | |
| object Group { | |
| implicit val readWriter: ReadWriter[Group] = macroRW | |
| } |
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
| import monix.execution.Scheduler.Implicits.global | |
| import fr.hmil.roshttp.HttpRequest | |
| import scala.util.{Failure, Success} | |
| val request = HttpRequest("https://raw.githubusercontent.com/hmil/RosHTTP/master/README.md") | |
| (request.send() | |
| .map(response => { | |
| val body = response.body | |
| val words = for { |
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
| import monix.execution.Scheduler.Implicits.global | |
| import fr.hmil.roshttp.HttpRequest | |
| val request = HttpRequest("https://raw.githubusercontent.com/hmil/RosHTTP/master/README.md") | |
| val response = request.send() |
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
| import fr.hmil.roshttp.HttpRequest | |
| import fr.hmil.roshttp.Protocol.HTTPS | |
| val request = HttpRequest() | |
| .withProtocol(HTTPS) | |
| .withHost("raw.githubusercontent.com") | |
| .withPath("hmil/RosHTTP/master/README.md") |
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
| import fr.hmil.roshttp.HttpRequest | |
| val request = HttpRequest("https://raw.githubusercontent.com/hmil/RosHTTP/master/README.md") |
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
| #!/bin/bash | |
| rm *.jks 2> /dev/null | |
| rm *.pem 2> /dev/null | |
| echo "====================================================" | |
| echo "Creating fake third-party chain root -> ca" | |
| echo "====================================================" | |
| # generate private keys (for root and ca) |
NewerOlder