A fancy Clojure REPL, to get it yourself, do the following:
In your .clojure/deps.edn
add the following alias:
:aliases {:repl {:extra-deps {com.bhauman/rebel-readline {:mvn/version "RELEASE"}
com.gfredericks/user.clj {:mvn/version "RELEASE"}
org.clojure/core.async {:mvn/version "RELEASE"}
org.clojure/core.logic {:mvn/version "RELEASE"}
org.clojure/test.check {:mvn/version "RELEASE"}
com.clojure-goes-fast/clj-java-decompiler {:mvn/version "RELEASE"}
com.clojure-goes-fast/clj-memory-meter {:mvn/version "RELEASE"}
com.clojure-goes-fast/clj-async-profiler {:mvn/version "RELEASE"}
com.clojure-goes-fast/jvm-alloc-rate-meter {:mvn/version "RELEASE"}
com.clojure-goes-fast/jvm-hiccup-meter {:mvn/version "RELEASE"}
io.aviso/pretty {:mvn/version "RELEASE"}
mvxcvi/puget {:mvn/version "RELEASE"}
com.hypirion/clj-xchart {:mvn/version "RELEASE"}
org.clojure/clojure {:mvn/version "RELEASE"}
generateme/fastmath {:mvn/version "RELEASE"}
clj-commons/pomegranate {:mvn/version "RELEASE"}}
:main-opts ["-m" "rebel-readline.main"]}
And in .clojure/user.clj
add the following: https://gist.github.com/didibus/b88a0d458601e06d63d0ca430962ff42
Finally, in your .zshrc
or .bashrc
file add:
function clj() {
if [[ -z $@ ]]
then
command clojure -A:repl
else
command clj $@
fi
}
So now when you type clj
you get a super fancy repl with colorized output, friendly error messages, auto-complete, doc showing, multi-line support and the most common namespaces pre-required as well as useful functions you can use with (req-...)
to lazy require more useful namespaces. There is one called (req-deps)
which requires pomegranate and defines add-lein-deps
that can then be used to dynamically bring in more dependencies to the REPL as well.
Share this recording
Link
Append ?t=30
to start the playback at 30s, ?t=3:20
to start the playback at 3m 20s.
Embed image link
Use snippets below to display a screenshot linking to this recording.
Useful in places where scripts are not allowed (e.g. in a project's README file).
HTML:
Markdown:
Embed the player
If you're embedding on your own page or on a site which permits script tags, you can use the full player widget:
Paste the above script tag where you want the player to be displayed on your page.
See embedding docs for additional options.
Download this recording
You can download this recording in asciicast v2 format, as a .cast file.
DownloadReplay in terminal
You can replay the downloaded recording in your terminal using the
asciinema play
command:
asciinema play 296507.cast
If you don't have asciinema CLI installed then see installation instructions.
Use with stand-alone player on your website
Download asciinema player from
the releases page
(you only need .js
and .css
file), then use it like this:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="asciinema-player.css" />
</head>
<body>
<div id="player"></div>
<script src="asciinema-player.min.js"></script>
<script>
AsciinemaPlayer.create(
'/assets/296507.cast',
document.getElementById('player'),
{ cols: 113, rows: 28 }
);
</script>
</body>
</html>
See asciinema player quick-start guide for full usage instructions.
Generate GIF from this recording
While this site doesn't provide GIF conversion at the moment, you can still do it yourself with the help of asciinema GIF generator utility - agg.
Once you have it installed, generate a GIF with the following command:
agg https://asciinema.org/a/296507 demo.gif
Or, if you already downloaded the recording file:
agg demo.cast demo.gif
Check agg --help
for all available options. You can change font
family and size, select color theme, adjust speed and more.
See agg manual for full usage instructions.