Skip to content

Instantly share code, notes, and snippets.

@apostolou
apostolou / request_full_screen.cljs
Created June 26, 2019 20:48
clojuscript version of requestFullscreen inspired from js code https://www.w3schools.com/jsref/met_element_requestfullscreen.asp
(ns open-full-screen.core
(:require[goog.object :as gobj]))
(defn open-full-screen
"`element-id` is the string of the html element id of
the element to be displayed in fullscreen"
[element-id]
(let [e (.getElementById js/document element-id)]
(cond
(gobj/get e "requestFullscreen") (.requestFullscreen e)
@apostolou
apostolou / dropdown_example.cljs
Created June 19, 2019 11:53
clojurescript simple example dropdown / reactstrap baking-soda
(ns dropdown-example.core
(:require [reagent.core :as reagent]
[baking-soda.core :as b]))
(defn dropdown-example []
(let [is-open? (reagent/atom false)]
(fn []
[b/Dropdown
{:toggle #(swap! is-open? not)
:is-open @is-open?}
@apostolou
apostolou / react_select.cljs
Last active June 5, 2019 13:03
example of usage of cljsjs.react-select
(ns react-select.core
(:require [re-frame.core :as re-frame]
[reagent.core :as r]
[cljsjs.react-select]))
(def payment-modes ["Amex" "Visa" "Cash" "Paypal"])
(def payment-options
(mapv zipmap (repeat [:label :value]) (mapv vector payment-modes (range 10))))