This is the example that comes with the reagent template converted to use HTML5 based history. This means there are no # in the urls.
I just got this working, so there might be better approaches
The changes are
- use
goog.history.Html5historyinstead ofgoog.History - listen to clicks on the page, extract the path from them, and push them onto the history
- listen to history changes, and have secretary do its thing in response
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "os/exec" | |
| "syscall" | |
| ) | |
| func main() { |
| sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9.jdk/ | |
| sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin | |
| sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane | |
A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.
How to use:
- The link in the table of content jumps at the copy of the answer on this page.
- The link on the answer itself points back at the original post.
Ethereum tutorials all advise downloading the Mist wallet and beginning dev. The only problem is that the testnet and real blockchain are huge and take hours to download. What follows is a recipe for quickly setting up a small blockchain and pre-mining it with some test ethereum
The following is done in Linux but will work in MacOS and should have equivalent command line options in Windows. Where I don't give detailed instructions, it's because a quick google search will fill in the blanks.
Install geth https://github.com/ethereum/go-ethereum/wiki/geth
install Mist https://github.com/ethereum/mist/releases
First start up the REPL by issuing this command:
clj -Sdeps '{:deps {github-mfikes/e00202b2de7cc2352fedcf92b1fe60dc {:git/url "https://gist.github.com/mfikes/e00202b2de7cc2352fedcf92b1fe60dc" :sha "68ef581813e08a92bd52e7beeea1535ab7b3337f"}}}' -m cljs.main -i @index.cljs -r
Once the REPL is waiting for the browser to connect, if it doesn't automatically, open http://localhost:9000 in your browser.
You will now be running Bocko. The following forms evaluated in the REPL will draw an American flag.
ClojureScript master now has cljs.core/eval. This delegates to cljs.core/*eval* which, by default throws, but you can bind it to any implementation that can compile and evaluate ClojureScript forms.
If you require the cljs.js namespace (which is the main support namespace for self-hosted ClojureScript), then cljs.core/*eval* is set to an implementation that uses self-hosted ClojureScript for this capability. This means that all self-hosted ClojureScript environments will now have a first-class eval implementation that just works. For example, Planck master:
$ planck -q
cljs.user=> (eval '(+ 2 3))
5