Fork me on GitHub
#beginners
<
2015-09-17
>
tjg12:09:19

In bhauman’s Flappy Bird demo, I can’t get :onKeyPress to move the bird. Does anyone know what I’m doing wrong? https://github.com/tjg/flappy-bird-demo/commit/88f4106a6f4ccd30c666313e93bb52ce13046952

tjg12:09:24

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

dnolen13:09:00

@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.

mocker15:09:08

Given a list of items like this:

(def my-list {:web01 {:ip "192.168.0.1"
                      :tags ["web" "production"]}
              :db01 {:ip "192.168.0.2"
                      :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?

frank16:09:00

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)))