Skip to content

Instantly share code, notes, and snippets.

@pfcoperez
Created May 20, 2019 12:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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