Fork me on GitHub

In bhauman’s Flappy Bird demo, I can’t get :onKeyPress to move the bird. Does anyone know what I’m doing wrong?


Oh I see, it has to do with divs not being able to accept such events (unless you add tabindex and focus on it)...


@paulb: well transit-clj is a server thing so it needs to work on streams and bounded buffers. transit-cljs however cannot provide such knobs because JavaScript doesn’t widely provide similar abstractions.


Given a list of items like this:

(def my-list {:web01 {:ip ""
                      :tags ["web" "production"]}
              :db01 {:ip ""
                      :tags ["database" "production"]}})
I want to look up servers by tags. Is this a good structure for the data? How would I find db01 by looking for the tag database?


there's probably a much better way of doing this, but:

(defn get-server-by-tag [tag]
  (some #(when-not (empty? (filter #{tag} (:tags %))) %) (vals my-list)))