Skip to content

Instantly share code, notes, and snippets.

@pfcoperez
Created May 20, 2019 12:02
Show Gist options
  • Save pfcoperez/03615b3b57284b3a653fc9f859fcf08b to your computer and use it in GitHub Desktop.
Save pfcoperez/03615b3b57284b3a653fc9f859fcf08b to your computer and use it in GitHub Desktop.
Example using clipboard access from Ammonite added in https://github.com/lihaoyi/Ammonite/pull/656
import $ivy.`io.circe::circe-parser:0.11.1`
import io.circe._, io.circe.parser._, io.circe.syntax._
for {
input <- parse(repl.clipboard.read).right
toAdd <- parse("""{"new_field": "added programatically"}""").right
} repl.clipboard.write(input.deepMerge(toAdd).toString)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment