I hereby claim:
- I am chrismurrph on github.
- I am cjmurphy (https://keybase.io/cjmurphy) on keybase.
- I have a public key ASAKxuvtgC_nSO_Q9zXv4JzCe2pTIMq7Ege5DQ4lczb1Wgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| (defn identities-and-stages-hof | |
| "The data doesn't have a player-year so we create it now. Also the games need to be | |
| unique on their own, as they are stored in their own table. | |
| Also the simplification of the lines for stage :improved is handled here. | |
| The work for :nyt stage can be done always as :naive doesn't use those keys." | |
| [desired-labels {:keys [stage]}] | |
| (fn [idx {:keys [pname year games max] :as player-year}] | |
| (let [player-year-id (make-player-year-id pname year) | |
| label {:pname pname :year year} | |
| make-simple (fn [games n] |
| (let [st @state | |
| desired-player-idents (->> (get st :player-year/by-id) | |
| vals | |
| (filter :ui/desired?) | |
| (map :player-year-id) | |
| (mapv (fn [id] [:player-year/by-id id])))] | |
| (swap! state assoc-in [:desired-labels/by-id :singleton :items] desired-player-idents)) |
| (ns general.replace | |
| (:require [clojure.string :as s] | |
| [clojure.java.io :as io] | |
| [clojure.pprint :as pp])) | |
| (defn indexes-of [in-str find-str] | |
| (loop [idx 0 | |
| indexes []] | |
| (let [found-idx (s/index-of in-str find-str idx)] | |
| (if found-idx |
| ;;-> In fh ns | |
| ;; | |
| ;; Can be used in a mutation to assoc-in new options | |
| ;; | |
| (defn input-options [[table-name id :as ident] field] | |
| [table-name id ::f/form :elements/by-name field :input/options]) | |
| (defn input-default-value [[table-name id :as ident] field] | |
| [table-name id ::f/form :elements/by-name field :input/default-value]) | |
| (defn options-generator [data->list-fn item->option-fn list->selected-fn] |
| (ns training.component-factory | |
| (:require-macros [re-com.core :refer [handler-fn]]) | |
| (:require [training.utils :as u] | |
| [re-com.util :refer [deref-or-value px]])) | |
| ;; | |
| ;; A row is a {}. Each key of this {} will have a control as its value. Then also have an :id which we are going to | |
| ;; make the row number. The control when created will look like []. See my-checkbox below which is the actual control. | |
| ;; | |
| (defn gen-table-row [create-control-fn column-keys row] |
| <html> | |
| <head> | |
| <script src="out/goog/base.js" type="text/javascript"></script> | |
| <script src="hello_world.js" type="text/javascript"></script> | |
| <script type="text/javascript">goog.require("hello_world.core");</script> | |
| </head> | |
| <body> | |
| </body> | |
| <script type="text/javascript">hello_world.core.run()</script> | |
| </html> |
| (ns training.views | |
| (:require [re-frame.core :as re-frame] | |
| [re-com.core :as re-com] | |
| [reforms.reagent :include-macros true :as f] | |
| [training.utils :as u])) | |
| (def h-box re-com/h-box) | |
| (def v-box re-com/v-box) | |
| (def box re-com/box) | |
| (def gap re-com/gap) |