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 immutable-v-list | |
"Example of React Native VirtualizedList from Om.next" | |
(:require [om.next :as om :refer-macros [defui]])) | |
(set! js/window.React (js/require "react")) | |
(set! js/window.ReactNative (js/require "react-native")) | |
(def ^js/window.ReactNative ReactNative js/window.ReactNative) | |
(defn create-element-no-auto-js |
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
{ | |
"name": "Soleil v2 Comfort Fun", | |
"categories": [ | |
"womens", | |
"shoes", | |
"sneakers-&-athletic-shoes" | |
], | |
"brand": "Puma", | |
"description": "Dance-inspired sneaker, Synthetic leather uppers, Lightly padded tongue and collar", | |
"external-product-id": "Either Globally Unique Identifier or Unique Identifier of the Product in Your System", |
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
{ | |
"name": "RB3183 Sunglasses 63 mm", | |
"categories": [ | |
"unisex", | |
"eyewear" | |
], | |
"brand": "Ray Ban", | |
"description": "Made in US,Ray-Ban sizes refer to the width of one lens in millimeters,Lenses are prescription-ready (Rx-able)", | |
"external-product-id": "Either Globally Unique Identifier or Unique Identifier of the Product in Your System", | |
"original-price": 12750, |
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 no-bugs [{:keys [] :as data} owner {:keys []}] | |
(reify | |
om/IInitState | |
(init-state [_] | |
{:comm-ch (chan) | |
:obstacle {:x 50 :width 50 :height 50} | |
:animated {:x 10}}) | |
om/IDidMount | |
(did-mount [_] | |
(let [{:keys [comm-ch]} (om/get-state owner) |
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 my-project.cljs-animate | |
(:require-macros [cljs.core.async.macros :refer [go]]) | |
(:require [cljs.core.async :refer [offer! put! promise-chan chan <! >! timeout alts! chan timeout dropping-buffer sliding-buffer]])) | |
;THIS IS A COPY/PASTE of https://github.com/gstamp/tween-clj | |
;TODO make tween-clj a ClojureScript lib (easy) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;; Transition types | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
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
(let [{elkn :extremely-long-key-name} {:extremely-long-key-name 42}] | |
(println elkn)) | |
;=> 42 |
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 cloud-monkey.env | |
(:require [environ.core :as environ])) | |
(defonce env environ/env) | |
(defn merge-with-env! [a-map] | |
(alter-var-root #'env (fn [x] (merge x a-map)))) |
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
;add (:require [clojure.core.async :refer [chan close! go >! <! <!! >!! go-loop put! thread alts! alts!! timeout pipeline pipeline-blocking pipeline-async]]) | |
;chans | |
(def to-ch (chan)) | |
(def from-ch (chan)) | |
;data looks like {url some-data, etc} | |
(def my-map (atom {})) | |
(defn fetch-from-url [{:keys [url]}] |
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 my-project.test-core-async | |
(:require [clojure.core.async :refer [chan thread sliding-buffer timeout go <! <!! >!! >! go-loop put! thread alts!! alts! dropping-buffer pipeline-blocking]])) | |
(def events-ch (chan 1000)) | |
;alternatively, try a sliding buffer if events can't be processed fast enough | |
;in GUI one **usually** cares about latest instead of *all* events | |
;Defaults to buffer size to 1000, that can be tuned based on use case | |
;(def events-ch (chan (sliding-buffer 1000))) | |
(defn start-go-loop |
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
;looking to transform: | |
(def x ([14227624954630003 3] [14227624954630004 4] [14227624954630005 5] [14227624954630006 6])) | |
;... into: | |
[[14227624954630003 14227624954630004 14227624954630005 14227624954630006] [3 4 5 6]] | |
;anything more idiomatic than: | |
(reduce (fn [result new] | |
[(conj (nth result 0) (nth new 0)) | |
(conj (nth result 1) (nth new 1))]) [[] []] x) | |
;? |