Skip to content

Instantly share code, notes, and snippets.

@netpyoung
Last active May 30, 2017 03:57
Show Gist options
  • Select an option

  • Save netpyoung/2cd1225825ed45aba4cde01321aeaa8d to your computer and use it in GitHub Desktop.

Select an option

Save netpyoung/2cd1225825ed45aba4cde01321aeaa8d to your computer and use it in GitHub Desktop.
20170508_SUMMARY.md

20170508_SUMMARY.md

join gitter

https://gitter.im/clojure_tokyo

Environment

[]$ uname -a Darwin pyoungui-MacBook-Pro.local 16.5.0 Darwin Kernel Version 16.5.0: Fri Mar 3 16:52:33 PST 2017; root:xnu-3789.51.23/RELEASE_X86_64 x86_64

[~]$ java -version java version "1.8.0_102" Java(TM) SE Runtime Environment (build 1.8.0_102-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew update brew doctor

export PATH="/usr/local/bin:$PATH"

brew install node npm install -g re-ratal npm install -g react-native-cli

common

mkdir ~/tmp_clojure && cd ~/tmp_clojure re-natal init renatalStub -i reagent6

ios

$ react-native run-ios > /dev/null
$ re-natal use-figwheel
$ lein repl
(start-figwheel "ios")
(in-ns 'renatal-stub.ios.core)
(dispatch [:set-greeting "Hello Native World!"])

android

make sure need android sdk // path configuration // check android debug mode on // Warning: License for package Android SDK Build-Tools 23.0.1 not accepted.

$ re-natal use-android-device genymotion
$ re-natal use-figwheel
$ react-native run-android
$ lein repl
(start-figwheel "android")
(in-ns 'renatal-stub.android.core)
(dispatch [:set-greeting "Hello Native World!"])

coding

~/tmp_clojure/renatal-stub/src/renatal_stub/android/core.cljs

;; ref: https://reagent-project.github.io/
(dispatch [:set-greeting "changing greeting"])

;; https://facebook.github.io/react-native/docs/textinput.html
(def text-input (r/adapt-react-class (.-TextInput ReactNative)))


       [text-input {:style {:width 200 :height 60}
                    :placeholder "this placeholder"
                    :on-change (fn [e] (let [txt e.nativeEvent.text]
                                         (dispatch [:set-greeting txt])))}]

idea

<TextInput
        style={{height: 40, borderColor: 'gray', borderWidth: 1}}
        onChangeText={(text) => this.setState({text})}
        value={this.state.text}
      />
(defn useless-text-input []
  (let [init-text "init" state (r/atom {:text init-text})]
    (fn []
      [text-input
       {:style {:width 200 :height 60}
        :placeholder "this is placeholder"
        :value (:text @state)
        :on-change-text (fn [txt]
                          (reset! state :text txt)
                          (r/flush))
        }])))
         :handler #(dispatch [:quake-load-success %])
  • welcome contributing

REF

@0cjs
Copy link
Copy Markdown

0cjs commented May 30, 2017

There was also a suggestion about using tmate for pair programming. We never actually used it in this last session, but I can see it being very handy in future sessions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment