{:deps {gist-uwo/osxclip {:git/url "https://gist.github.com/uwo/23b7a81fd97818368400bb7c02086562"
:sha "ceee392df6d3f7607bd5e80f0eb80aafcdcda348"}}}
Last active
September 17, 2018 17:06
-
-
Save uwo/23b7a81fd97818368400bb7c02086562 to your computer and use it in GitHub Desktop.
osxclip
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
.cpcache | |
.nrepl-port |
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
{:paths ["."] | |
:deps {gist-uwo/pformat {:git/url "https://gist.github.com/uwo/c5ca5aa57e156364dd687cb0538836c6" | |
:sha "69f2d31ff4a89175e17bab0dcfe5f7db429ffebe"}}} |
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
(ns osxclip | |
(:require [clojure.java.shell :refer [sh]] | |
[clojure.edn :as edn] | |
[pformat :refer [pformat]])) | |
(defn pbspit* | |
"Spit to paste buffer" | |
[in] | |
(sh "pbcopy" :in in)) | |
(defn pbslurp | |
"Slurp from paste buffer" | |
[] | |
(:out (sh "pbpaste"))) | |
(defn pbslurpe | |
"Slurp from paste buffer and read as edn" | |
([] | |
(pbslurpe {:readers *data-readers*})) | |
([{:keys [readers]}] | |
(edn/read-string {:readers readers} (pbslurp)))) | |
(defn pbspit | |
"Spit to paste buffer in pretty format" | |
[in] | |
(pbspit* (pformat in))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment