Skip to content

Instantly share code, notes, and snippets.

geraldodev / helix-autocomplete.cljs
Last active Nov 27, 2020
Thin layer over mui autocomplete.
View helix-autocomplete.cljs
(ns app.helix_autocomplete
["@material-ui/lab/Autocomplete" :default Autocomplete]
["@material-ui/core/TextField" :default TextField]
["react" :as r]
[goog.object :as gobj]
(defnc AutocompleteHelix
geraldodev / mui-autocomplete.cljs
Created Nov 20, 2020
mui Autocomplete with helix. The render-input node needs to be created with plain react
View mui-autocomplete.cljs
(ns app.ui.contratualizacao.regra
["@material-ui/lab/Autocomplete" :default Autocomplete]
["@material-ui/core/TextField" :default TextField]
["react" :as r]
[goog.object :as gobj]
($ ^:native
geraldodev / hooks.cljs
Last active Oct 6, 2020
extracted from helix zulip chat from a message of wilkerlucio
View hooks.cljs
(ns app.util.hooks
["react" :refer [useState]]
(defn use-state
"A simple wrapper around React/useState. Returns a cljs vector for easy destructuring"
(into-array (useState initial-value)))
geraldodev / diff_excel_template.diff
Created Jun 16, 2020
;; dependencias de excel-templates joda-time/joda-time {:mvn/version "2.7"} org.clojure/ {:mvn/version "0.1.1"} org.apache.poi/ooxml-schemas {:mvn/version "1.4"} ;; era 1.1 org.apache.commons/commons-lang3 {:mvn/version "3.4"}
View diff_excel_template.diff
diff build.clj ~/projetos/api/src/main/excel_templates/build.clj
< [ Cell Row DateUtil WorkbookFactory]
> [ Cell Row Row$MissingCellPolicy DateUtil WorkbookFactory CellType]
< (= (.getCellType cell) Cell/CELL_TYPE_FORMULA))
> (= (.getCellType cell) CellType/FORMULA))
View material_ui_helix.cljs
(ns app.renderer.core
["@material-ui/core" :refer [AppBar Toolbar Badge Hidden IconButton]]
["@material-ui/core/Button" :default Button]
["@material-ui/core/styles" :refer [createMuiTheme makeStyles ThemeProvider]]
["react-dom" :as rdom]
[app.renderer.myhelix :refer [defnc]]
[helix.core :as hx :refer [$ <>]]
[helix.dom :as d]
geraldodev / denfc_input.clj
Created May 24, 2020
why defnc bean property is not interoperable with helix.dom ?
View denfc_input.clj
["react" :as r]
["react-dom" :as rdom]
["react-hook-form" :as rhf]
["react-router-dom" :as rr]
[app.myhelix :refer [defnc]]
[helix.core :as hx :refer [$ <>]]
[helix.dom :as d]
[helix.hooks :as hooks]
View wrap-enforce-roles.clj
(defn wrap-enforce-roles [handler]
(fn [{::keys [roles request-method] :as request}]
(let [required (some-> request (ring/get-match) :data request-method ::roles)]
(if (and (seq required) (not (set/subset? required roles)))
{:status 403, :body "forbidden"}
(handler request)))))
View malli_zipper.clj
(ns app.malli-teste
[ :as z]
[clojure.pprint :refer [pprint]]
[malli.core :as m]
[malli.util :as mu]
[malli.error :as me]
(defn make-malli-node
View hooks.cljs
(defnc App
(j/let [[state set-state] (hooks/use-state {} )
^:js {:keys [register
errors] :as obj} (rhf/useForm)]
; (.log js/console obj)
; (.log js/console (type state))
View into_com_transducer.clj
(ns into-com-transducer
[criterium.core :refer [bench]])
; coloque no deps.dn
; criterium {:mvn/version "0.4.5"}
(def campo-exemplo
#:columninfo{:remarks "COMPET�NCIA FINAL",
:is_autoincrement "NO",
:column_size 6,