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
(with-out-str | |
(->> 'com.fulcrologic.fulcro.dom-server | |
ns-publics | |
(filter #(re-find #"DOM" (or (get (meta (last %)) :doc) ""))) | |
(map first) | |
(map #(list (str "dom/" %) (list (list "inner" 0)))) | |
;; (take 3) | |
(clojure.pprint/pprint))) | |
;; outputs: |
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
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
//CSS | |
material-ui allows for customizing CSS via a higher-order component called withStyles
. Like many higher-order components which expect render props
, the purpose of withStyles
is to accept some parameters, and then introduce a new variable into the scope of the component tree.
One succinct and simple way to translate the concept of scope into Clojure is via a custom let
macro. Usage of such a macro is demonstrated here:
(:require [material-ui.styles :as m])
(m/let [{:keys [leftPad]} {:leftPad
{:paddingLeft 8}}]
;; `leftPad` is now the _className_ associated with {:paddingLeft 8}
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
// Simple problems to solve using the native .reduce and .map array methods. Each of these problems can be solved in many | |
// different ways, but try to solve them using the requested higher order function. | |
// MAP | |
// Write a function capitalize that takes a string and uses .map to return the same string in all caps. | |
// ex. capitalize('whoop') // => 'WHOOP' | |
// ex. capitalize('oh hey gurl') // => "OH HEY GURL" | |
var capitalize = function(string){ | |
// code code code! |
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
lsof -i :3000 | |
#COMMAND PID ... | |
#node 20638 ... | |
#node 20638 ... | |
sudo kill -9 20638 |
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 user | |
(:require [clojure.java.classpath] | |
[clojure.tools.namespace] | |
[clojure.repl :refer :all] | |
[clojure.pprint :refer [pprint]] | |
[lucid.mind :refer [.? .* .%> .%]]) | |
(:import [java.util.jar.JarFile])) | |
;Read more on lucid.mind http://docs.caudate.me/lucidity/lucid-mind.html | |
;(.%> clojure.lang.PersistentVector) |
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
;/* | |
;const result = { | |
; usd: [10000, 30000], | |
; gbp: [9000, 0], | |
; eur: [0, 7000], | |
; uah: [10000, 0],} | |
; | |
;*/ | |
(def transations [[:usd :buy 10000] |
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
const transactions = [ | |
['usd', 'buy', 10000], | |
['usd', 'sell', 5000], | |
['gbp', 'buy', 9000], | |
['eur', 'sell', 7000], | |
['uah', 'buy', 10000], | |
['usd', 'sell', 25000], | |
]; | |
/* |
NewerOlder