Material Design has nothing like Bootstrap's button dropdowns - until now.
This file contains hidden or 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
// hard won knowledge from http://stackoverflow.com/questions/20035615/using-raw-image-data-from-ajax-request-for-data-uri | |
var xmlHTTP = xhr.XMLHttpRequest(); | |
xmlHTTP.open('GET', url, true); | |
xmlHTTP.responseType = 'arraybuffer'; | |
xmlHTTP.onload = function(e) { | |
var arr = new Uint8Array(this.response); | |
var raw = String.fromCharCode.apply(null,arr); | |
var b64 = base64.encode(raw); | |
var dataURL="data:image/png;base64," + b64; | |
}; |
This file contains hidden or 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
(require '[clj-http.client :as http]) | |
(require '[clojure.core.async :as a]) | |
(require '[clojure.string :as string]) | |
(require '[clojure.java.io :as io]) | |
(import '[java.io InputStream]) | |
(def event-mask (re-pattern (str "(?s).+?\r\n\r\n"))) | |
(defn- parse-event [raw-event] | |
(->> (re-seq #"(.*): (.*)\n?" raw-event) |
This file contains hidden or 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 model | |
(:require [re-frame.core :as re-frame])) | |
(re-frame/def-event ::toggle-sort-direction [] | |
(fn [db _] | |
(update db :sort-asc? not))) | |
(re-frame/def-sub ::sort-asc? | |
(fn [db _] | |
(get db :sort-asc? true))) |
This file contains hidden or 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 comp->> | |
"Like comp but multiple arguments are passed to all functions like partial, except the last which is threaded like ->>" | |
[f & fs] | |
(fn [& args] | |
(reduce (fn [r f'] | |
(apply f' (conj (into [] (butlast args)) r))) | |
(apply f args) | |
fs))) | |
(defn comp-> |
This file contains hidden or 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
(require '[re-frame.core :as re-frame]) | |
(require '[reagent.ratom :as reagent]) | |
(require '[re-graph.core :as re-graph]) | |
(require '[martian.re-frame :as martian]) | |
;; handler for storing things when they arrive | |
(re-frame/reg-event-db | |
::on-things | |
(fn [db [_ things]] | |
(assoc db ::raw-things things))) |
This file contains hidden or 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
(import '[java.util Timer TimerTask]) | |
(defn debounce | |
([f] (debounce f 1000)) | |
([f timeout] | |
(let [timer (Timer.) | |
task (atom nil)] | |
(with-meta | |
(fn [& args] | |
(when-let [t ^TimerTask @task] |
I hereby claim:
- I am oliyh on github.
- I am oliyh (https://keybase.io/oliyh) on keybase.
- I have a public key ASBqyXdQrYvjtU8IfcLNJC61cKYjatjbrLgEHYEarpwVvgo
To claim this, I am signing this object:
OlderNewer