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
(transduce | |
(comp | |
(map-indexed (fn [idx item] [idx item])) | |
(map (fn [[idx item]] | |
(println "sending to space" idx) | |
[idx item]))) | |
(fn | |
;;completing arity | |
([accum] accum) | |
;;reduce arity |
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
import React, {useImperativeHandle, useRef, forwardRef} from 'react'; | |
import Animated, { | |
useSharedValue, | |
useAnimatedStyle, | |
withTiming, | |
withSpring | |
} from 'react-native-reanimated'; | |
function Box(props, ref) { | |
const aRef = useRef(); |
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 ss.experimental.comment-line-count | |
(:require [net.cgrand.xforms :as x])) | |
(defn count-comment-lines [] | |
(let [source (slurp "/Users/raspasov/cpp") | |
lines (line-seq | |
(java.io.BufferedReader. | |
(java.io.StringReader. source)))] | |
(transduce |
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
(def sections | |
;convert to Clojure data | |
(js->clj | |
#js [ | |
#js { | |
"title" "Getting started", | |
"reset_lesson_position" false, | |
"lessons" [ | |
{"name" "Welcome"}, | |
{"name" "Installation"} |
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 scratch | |
(:require [clojure.core.async :as a] | |
[taoensso.timbre :as timbre])) | |
(def core-async-agent-state (atom 0)) | |
(def core-async-agent-ch (a/chan 1)) |
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
(comment | |
;This takes at most ~2000 ms to execute | |
(let [process-seq-of-channels | |
(fn [chans] | |
(a/go | |
(loop [chans chans] | |
(if-not (empty? chans) | |
(let [ch (first chans) | |
resp (a/<! ch)] | |
(println resp) |
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
import React, {PropTypes, Component, useImperativeHandle, useRef, forwardRef} from 'react'; | |
import Animated, {useSharedValue, useAnimatedStyle, withTiming, withSpring} from 'react-native-reanimated'; | |
function Box(props, ref) { | |
const aRef = useRef(); | |
useImperativeHandle(ref, function () { | |
return { | |
moveBox: function (globalY) { |
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
;USAGE | |
;1. get https://github.com/planck-repl/planck | |
;2. run it from the project folder like this: | |
;plk patch-metro-worker.cljs | |
(require '[planck.core :refer [spit slurp]]) | |
;Works with ReactNative 0.62 | |
(def my-production-index-js-file-name "index.prod.js") |
NewerOlder