This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'x | |
;x | |
''x | |
;(quote x) | |
'''x | |
;(quote (quote x)) | |
`x | |
;yaadapp.core/x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn ->kebab [s] | |
(str/join "-" (map str/lower-case (re-seq #"\w[a-z]+" s)))) | |
(def components '[Card | |
AppBar | |
LeftNav | |
CardTitle]) | |
(defn gen-wrapper [component] | |
`(defmacro ~(symbol (->kebab (str component))) [& args#] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def app-wrapper | |
(let [colors js/window.MaterialUI.Styles.Colors | |
yaad-theme #js {:getPalette (fn [] #js {:primary1Color (.-green800 colors) | |
:primary2Color (.-green700 colors) | |
:primary3Color (.-green600 colors)}) | |
:getComponentThemes (fn [_] #js {})} | |
theme-manager (js/window.MaterialUI.Styles.ThemeManager.)] | |
(js/React.createClass | |
#js {:childContextTypes #js {:muiTheme js/React.PropTypes.object} | |
:getChildContext (fn [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns yaadapp.material | |
(:require [clojure.string :as str] | |
[clojure.walk :as walk])) | |
(defn ->kebab [s] | |
(str/join "-" (map str/lower-case (re-seq #"\w[a-z]+" s)))) | |
(def components '[AppBar | |
Card | |
CardActions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def macro-state | |
(atom {:question "" | |
:answer ""})) | |
(defcc input-wrapper < rum/reactive [comp hint label ref] | |
(mui/text-field {:hintText hint | |
:multiLine true | |
:fullWidth true | |
:rows 2 | |
:value (rum/react ref) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn- average [coll] | |
(/ (reduce + coll) (count coll))) | |
(let [paid {:karan 900 | |
:chirag 50 | |
:jindi 400 | |
:harleen 200 | |
:sukh 100 | |
:raman 10} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn reset-components [db eid attr new-comps] | |
(let [current-comps (-> (d/pull db [attr] eid) attr) | |
;; First we do a value based comparison ignoring component entity ids. | |
current-comp-vals (into #{} (map #(dissoc % :db/id) current-comps)) | |
new-comp-vals (into #{} new-comps) | |
deletions (clojure.set/difference current-comp-vals new-comp-vals) | |
additions (clojure.set/difference new-comp-vals current-comp-vals) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns arc.router | |
(:require | |
[om.next :as om] | |
[bidi.bidi :as bidi])) | |
(extend-protocol bidi/PatternSegment | |
function | |
(segment-regex-group [this] | |
(condp = this | |
keyword "[A-Za-z]+[A-Za-z0-9\\*\\+\\!\\-\\_\\?\\.]*(?:%2F[A-Za-z]+[A-Za-z0-9\\*\\+\\!\\-\\_\\?\\.]*)?" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns ucv.semantic-ui.factories | |
(:require ["semantic-ui-react" :as semantic-ui] | |
goog.object)) | |
(defn factory-apply | |
[class] | |
(fn [props & children] | |
(apply js/React.createElement | |
class | |
(clj->js props) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns ucv.server.websocket-channel-listener | |
(:require | |
[fulcro.websockets.protocols :refer [WSListener add-listener remove-listener]] | |
[mount.core :refer [defstate args]] | |
[taoensso.timbre :as log] | |
[ucv.server.websockets :refer [websockets]])) | |
;;; Fulcro's component sticks the result of user-id-fn into the top level of | |
;;; env, for mutations to use. |
OlderNewer