Last active
June 2, 2024 08:57
-
-
Save athos/b68b15b08efedffaf14d8c020b125202 to your computer and use it in GitHub Desktop.
Try on your terminal `clojure -Sdeps '{:deps {hello-clojure/hello-clojure {:git/url "https://gist.github.com/athos/b68b15b08efedffaf14d8c020b125202" :git/sha "099bdf7d565b2c35c1df601abf58514cc5276237"}}}' -M -m hello-clojure`
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 {clansi/clansi {:mvn/version "1.0.0"}}} |
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 hello-clojure | |
(:require clansi | |
[clojure.java.io :as io])) | |
(def styles | |
{\b :bg-blue | |
\g :bg-green | |
\w :bg-white}) | |
(defn colorize-line [line] | |
(->> line | |
(map #(clansi/style " " (get styles % :bg-default))) | |
(apply str))) | |
(defn -main [] | |
(with-open [r (io/reader (io/resource "logo.dat"))] | |
(run! #(println (colorize-line %)) (line-seq r)))) |
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
-----------wwwwwwwwww----------- | |
---------wwwwwbbbbwwwww--------- | |
-------wwwbbbbbbbbbbbwwww------- | |
------wwbbbbbbbbbbbbbbbwww------ | |
-----wwbbbbbbbbbbbbbbbbbbww----- | |
----wwbbbbbbbbbbbbbbbbbbbbww---- | |
---wwwwwwwwbbbbbbbbbbbbbbbbww--- | |
--wwwwwwwwwwwwwwwwwbbbbbbbbbww-- | |
--wwwwgggwwwwwbbbbwwwbbbbbbbww-- | |
-wwwwggggwwgwwbbbbbbwwbbbbbbbww- | |
-wwwgggggwwggwwbbbbbbwwbbbbbbww- | |
wwwgggggwwgggwwbbbbbbbwwbbbbbbw- | |
wwgggggwwgggggwwbbbbbbbwbbbbbbww | |
wwgggggwwgggggwwbbbbbbbwwbbbbbww | |
wggggggwgggggggwbbbbbbbwwbbbbbww | |
wggggggwgggggggwbbbbbbbbwbbbbbww | |
wggggggwggggggwwwbbbbbbbwbbbbbww | |
wggggggwgggggwwgwbbbbbbwwbbbbbww | |
wwgggggwwggggwggwwbbbbbwwbbbbbww | |
wwggggggwgggwwggwwbbbbbwbbbbbbw- | |
-wggggggwwggwggggwwbbbwwbbbbbww- | |
-wgggggggwwgwggggwwbbwwbbbbbwww- | |
-wwgggggggwwwgggggwwwwbbbbwwww-- | |
--wwgggggggwwwwggwwwwwwwwwwwww-- | |
--wwgggggggggwwwwwwgggwwwwggw--- | |
---wwggggggggggggggggggggggww--- | |
----wwggggggggggggggggggggww---- | |
-----wwggggggggggggggggggww----- | |
------wwwggggggggggggggwww------ | |
--------wwwggggggggggwww-------- | |
----------wwwwwwwwwwww---------- | |
-------------wwwwww------------- |
This is great, but after 5 years, some things have changed in Clojure tools, see the warnings:
$ clojure -Sdeps '{:deps {hello-clojure {:git/url "https://gist.github.com/athos/b68b15b08efedffaf14d8c020b125202" :sha "1c9a05106171f97f9b8e8ac8f58c7bd8dbe021f9"}}}' -m hello-clojure
DEPRECATED: Libs must be qualified, change hello-clojure => hello-clojure/hello-clojure
Cloning: https://gist.github.com/athos/b68b15b08efedffaf14d8c020b125202
Checking out: https://gist.github.com/athos/b68b15b08efedffaf14d8c020b125202 at 1c9a05106171f97f9b8e8ac8f58c7bd8dbe021f9
DEPRECATED: Libs must be qualified, change clansi => clansi/clansi (/Users/alex/.gitlibs/libs/hello-clojure/hello-clojure/1c9a05106171f97f9b8e8ac8f58c7bd8dbe021f9/deps.edn)
DEPRECATED: Libs must be qualified, change clansi => clansi/clansi (/Users/alex/.gitlibs/libs/hello-clojure/hello-clojure/1c9a05106171f97f9b8e8ac8f58c7bd8dbe021f9/deps.edn)
WARNING: Implicit use of clojure.main with options is deprecated, use -M
Those warnings are not a big deal, but I've added some updates to fix them.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very nice.