Skip to content

Instantly share code, notes, and snippets.

View benshaw's full-sized avatar
🤖

Ben Shaw benshaw

🤖
  • Squamish BC
View GitHub Profile
@staltz
staltz / introrx.md
Last active July 29, 2024 05:55
The introduction to Reactive Programming you've been missing
# IMPORTANT: this example is potentially out of date. The latest version can be found here: https://github.com/papertrail/remote_syslog2/blob/master/examples/remote_syslog.ebextensions.config
# See http://help.papertrailapp.com/kb/hosting-services/aws-elastic-beanstalk/
# Usage:
# - replace <VERSION> with the version of remote_syslog2 you want to use. Example: .../download/v0.14/remote_syslog_linux_amd64.tar.gz
# - replace <YOUR-TRACKED-FILES> with the files you want to monitor for new log lines. Example: - /var/log/httpd/access_log
# - replace <YOUR-APP-NAME> with the name of the application
# - replace <YOUR-LOG-DESTINATION> and <YOUR-PORT-NUMBER> with the values shown under log destinations: https://papertrailapp.com/account/destinations
sources:
import io.circe._
import io.circe.generic.auto._
import io.circe.parser._
val jsonPoint = "{ \"type\": \"Point\", \"coordinates\": [100.0, 0.0] }"
val jsonLineString = "{ \"type\": \"LineString\",\n \"coordinates\": [ [100.0, 0.0], [101.0, 1.0] ]\n }"
val jsonPolygon = "{ \"type\": \"Polygon\",\n \"coordinates\": [\n [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]\n ]\n }"
val jsonPolygonWithHoles = "{ \"type\": \"Polygon\",\n \"coordinates\": [\n [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],\n [ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]\n ]\n }"
val jsonGC = "{ \"type\": \"GeometryCollection\",\n \"geometries\": [\n { \"type\": \"Point\",\n \"coordinates\": [100.0, 0.0]\n },\n { \"type\": \"LineString\",\n \"coordinates\": [ [101.0, 0.0], [102.0, 1.0] ]\n }\n ]\n }"