Skip to content

Instantly share code, notes, and snippets.

@davidvhill
davidvhill / core.clj
Last active February 20, 2020 18:12
Clojure yield-on-cost report
(ns compound.core
(:gen-class))
;; items is :label, dividend rate, dividend growth rate
(def items [[:abbv 0.0504 0.209]
[:mo 0.07 0.10]
[:pru 0.0472 0.13]
[:abc 0.0178 0.10]
[:amp 0.0219 0.11]
[:cm 0.0521 0.036]
@davidvhill
davidvhill / gist:c71ec05730994e5f1fb1f39b2dd57dd6
Last active September 21, 2020 14:45
Function with Retry
;; Returns a function with retries.
;; retries: num of retries
;; delay: delay between retries in milliseconds
;; f: function to apply
;; ef: error function, determines if f should be retried
;; f and ef should not throw Exceptions
(defn with-retry
[retries delay f ef]
(fn [& args]
@davidvhill
davidvhill / decisionmodel.md
Last active April 18, 2021 15:24
Decision Model

My Decision Model

Goals

  1. Eliminate Decision Fatigue
  2. Increase Productivity

Strategies

  1. Offload routine decisions onto habits
  2. Offload non-routine decisions onto if/then rules
  3. Offload unclear decisions onto a timebox