Skip to content

Instantly share code, notes, and snippets.

@ScalaWilliam
Last active May 11, 2017 02:22
Show Gist options
  • Save ScalaWilliam/b8c2741b72dc3c24c8f0c7ce6203b16a to your computer and use it in GitHub Desktop.
Save ScalaWilliam/b8c2741b72dc3c24c8f0c7ce6203b16a to your computer and use it in GitHub Desktop.
java.nio.file.Files.lines(
java.nio.file.Paths.get("/dev/stdin")
).map(function (line) {
var time = line.substring(0, line.indexOf(" "))
var payload = line.substring(line.indexOf(" ") + 1);
var instant = java.time.LocalDateTime.parse(time).atZone(java.time.ZoneId.of("Europe/Paris")).toInstant()
var newTimeStr = java.time.format.DateTimeFormatter.ISO_INSTANT.format(instant);
return [newTimeStr, "aura.woop.ac:10000", payload].join("\t");
})
.forEach(print);
java.nio.file.Files.lines(
java.nio.file.Paths.get("/dev/stdin")
).map(function (line) {
var time = line.substring(0, line.indexOf(" "))
var payload = line.substring(line.indexOf(" ") + 1);
var instant = java.time.LocalDateTime.parse(time).atZone(java.time.ZoneId.of("Europe/Paris")).toInstant()
var newTimeStr = java.time.format.DateTimeFormatter.ISO_INSTANT.format(instant);
return [newTimeStr, "aura.woop.ac:28763", payload].join("\t");
})
.forEach(print);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment