Last active
March 22, 2023 20:00
-
-
Save srenatus/5a112cb9732a144addb200f0a69b5e64 to your computer and use it in GitHub Desktop.
This file contains 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
{:deps {djblue/portal {:mvn/version "0.37.1"}}} |
This file contains 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
package portal | |
import ( | |
"bytes" | |
"encoding/json" | |
"os/exec" | |
) | |
func Tap(x any) { | |
payload, err := json.Marshal(x) | |
if err != nil { | |
panic(err) | |
} | |
tap(payload) | |
} | |
func tap(x []byte) { | |
t := exec.Command("tap") | |
t.Stdin = bytes.NewReader(x) | |
if _, err := t.Output(); err != nil { | |
panic(err) | |
} | |
} |
This file contains 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
bb -cp `clj -Spath -Sdeps '{:deps {djblue/portal {:mvn/version "0.35.1"}}}'` | |
Babashka v1.1.173 REPL. | |
Use :repl/quit or :repl/exit to quit the REPL. | |
Clojure rocks, Bash reaches. | |
user=> (require '[portal.api :as p]) | |
nil | |
user=> (def p (p/open {:launcher :vs-code :port 5678})) | |
#'user/p | |
user=> |
This file contains 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
#!/usr/bin/env -S bb --config /users/stephan/Scratch/clojure/portal/bb.edn | |
(require '[portal.client.jvm :as p]) | |
(def submit (partial p/submit {:port 5678})) | |
(-> (json/parse-stream *in* true) | |
submit) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment