Skip to content

Instantly share code, notes, and snippets.

@borkdude
Forked from gfredericks/frobnicate.clj
Last active September 9, 2018 14:26
Show Gist options
  • Save borkdude/dade8f32ffdfa82dd7d9f28cc2b33848 to your computer and use it in GitHub Desktop.
Save borkdude/dade8f32ffdfa82dd7d9f28cc2b33848 to your computer and use it in GitHub Desktop.
Self-contained clojure file with deps
*.clj linguist-language=Clojure
*.cljs linguist-language=Clojure
#!/usr/bin/env bash
#! top-of-file comments can be written using more #! lines, which
#! is a valid comment in both clojure and bash
":";# alternately this works too
#! The construction below uses cross-language syntactic hackery to
#! specify the -Sdeps arg in a part of the file that's interpreted
#! by clojure as clojure syntax (i.e., not a line comment), so it
#! should get syntax highlighting and other editor support
":"; DEPS=\
'{:deps
{org.apache.commons/commons-compress {:mvn/version "1.17"}}}'
":"; exec clojure -Sdeps "$DEPS" "$0" "$@"
(ns frobnicate
(:import
(org.apache.commons.compress.archivers ArchiveStreamFactory)
(org.apache.commons.compress.archivers.tar TarArchiveEntry)))
;; put useful code here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment