Skip to content

Instantly share code, notes, and snippets.

@Sean-Wynn
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sean-Wynn/a2d2cffa030b2e34cd6b to your computer and use it in GitHub Desktop.
Save Sean-Wynn/a2d2cffa030b2e34cd6b to your computer and use it in GitHub Desktop.
Picture viewer in Om
(ns pic-viewer2.base
(:require [om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]
[dommy.core :refer [insert-after!]])
(:use enchilada :only [canvas ctx])
(:use-macros [dommy.macros :only [sel1 node]]))
@rm-hull
Copy link

rm-hull commented Jan 22, 2015

Hey - saw you'd tried this out on programming-enchilada's, but it doesn't compile - it may be because the version of Om / react on the site haven't been updated in a quite while. I'll look at bumping the versions up to latest.

Also, it isn't documented anywhere (yet) but there is a local sandbox you can use, to make development much less painful. If you clone the git repo, and:

$ cd programming-enchiladas/local-sandbox
$ lein figwheel

You then need to create your .cljs file in local-sandbox/src, and add a reference to local-sandbox/src/bootstrapper.cljs as per the comments.

The figwheel stuff will auto-compile and deploy your changes, which should then be visible on http://localhost:3449

Crafting the code locally is much quicker (and much less painful than trying it on the site), purely just down to the fact that the compiler has to generate lots of stuff. This might now be fixed with the :cache-analysis that David Nolen added recently (http://swannodette.github.io/2014/12/22/waitin/).

In the meantime, the workflow I normally do to add gists, is to work on them in the local sandbox, and when happy with the result, copy/paste into a gist, at which point they should compile up on the site without any errors.

In other news, there is an 'in-progress' (ahem) code editor that mostly works here: http://programming-enchiladas.destructuring-bind.org/_create - again not documented nor complete.

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