Skip to content

Instantly share code, notes, and snippets.

@mfikes
Last active May 30, 2018 09:31
Show Gist options
  • Save mfikes/e600e965da916699a703c9b1f1ff6d3b to your computer and use it in GitHub Desktop.
Save mfikes/e600e965da916699a703c9b1f1ff6d3b to your computer and use it in GitHub Desktop.
Try running this in your terminal: clojure -Sdeps '{:deps {github-mfikes/e600e965da916699a703c9b1f1ff6d3b {:git/url "https://gist.github.com/mfikes/e600e965da916699a703c9b1f1ff6d3b" :sha "aa946e43d193fa719544057b0561b03ce2a72977"}}}' -m cljs.main -m hello-clojure
{:paths ["."]
:deps {org.clojure/clojurescript
{:git/url "https://github.com/clojure/clojurescript"
:sha "08beee84b05f911a6bb0eff0dd1235c201b26c70"}}}
(ns hello-clojure
(:require
[clojure.string :as string]
[resources]))
(def styles
{\b "\u001b[38;44m \u001b[m"
\g "\u001b[38;42m \u001b[m"
\w "\u001b[38;47m \u001b[m"
\- " "})
(defn colorize-line [line]
(->> line
(map #(string/escape % styles))
(apply str)))
(defn -main []
(run! #(println (colorize-line %)) (string/split-lines resources/logo)))
(ns resources)
(def logo "-----------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-------------")
@4mitch
Copy link

4mitch commented Feb 24, 2018

Excuse me! But how can I run this with lein but not clojure itself?

@metacritical
Copy link

@4mitch it has deps.edn instead of project.clj so you dont need lein.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment