Skip to content

Instantly share code, notes, and snippets.

View BrianLitwin's full-sized avatar

Brian Litwin BrianLitwin

View GitHub Profile
1) don't allow a user to click out of the modal when with invalid text (on-click nil)
2) don't allow a user to finalize a doc w/ invalid input (on-click nil)
3) don't show a "please select an existing item" error when All Strategies selected (update spec (if optional .. ))
4) don't show 1 filter selected if user is typing ?
-> (if on-clear (on-clear) (on-click) ... but see below
5) don't show 1 filter selected or weirdness when you click outside the dropdown ...
-> what happens when you click outsided the dropdown? What's called?
update the :on-click methods and possibly the same for asset_tab's dropdown - rm on-clear

how to think about design? how to see design through implementation efficiently?

:start-screen choose list start session (disabled until list chosen)

:session-screen forward/ back buttons keep track of score - answer right/wrong keep track of number of cards answered out of total

(bem/defbem blend-card [{:keys [sleeves latest_customer journey_count] :as blend}]
(let [models (map #(->> % :strategy_id get-strat-model) sleeves)
pie-options
(make-pie-options
{:sleeves models :percents (map #(:percent %) sleeves)})]
[:*
[:*body {:on-click #(rf/dispatch [:account/select-blend blend blend])}
[blend-header blend]
[:*body-cols
[:*pie-area [Highcharts {:element {:class "blend-card__pie"} :options pie-options}]]

The way in which you’ve structured makeExporGraph is a wonderful example of how taking data dependencies rather than directly depending on global values can make your code easily testable in a natural way that does not require writing any mocks.

You are testing a pure function that operates on two interfaces: the IAnalysisAdapter interface and the Stdio interface. At test time, you provide a Stdio implementation that captures its output into memory, and an IAnalysisAdapter implementation that has some fixed success or failure behavior. At runtime, the Stdio interface is

;; A
(rf/reg-sub
:account/sleeve-min
(fn [_ [_ id]]
(let [sleeve @(rf/subscribe [:account/sleeve id])]
(:min-amount sleeve 1000))))
;; B
(sleeve-min [id]

Two types of destructuring: sequential and associative

Sequential Destructuring

Sequential destructuring represents a sequential data structure as a Clojure vector within a let binding. This type of destructuring can be used on any kind of data structure that can be traversed in linear time, including lists, vectors, and anything that can produce a sequence.

(def my-vector [1 2 3])

Literal Collections

'(1 2 3)     ; list
[1 2 3]      ; vector
#{1 2 3}     ; set
{:a 1, :b 2} ; map

Test your knowledge: 2. Rewrite the following algebraic expression as a Clojure expression: ( 7 + 3 * 4 + 5 ) / 10

const instance = new OdysseyInstance();
// teams
const teamOne = instance.addContribution(
"Team 1",
"Crowdfunding the commons"
);
const teamTwo = instance.addContribution("Team 2", "Momentum Voting");
const teamThree = instance.addContribution(
"Team 3",