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 Axios, { AxiosPromise, AxiosError, AxiosResponse, AxiosRequestConfig } from 'axios'; | |
interface callbackOptions { | |
successCb?: (params?: any) => void; | |
failureCb?: (params?: any) => void; | |
spinnerCb?: (on: boolean) => void; | |
}; | |
async function fetchFlow<RT>(apiClass: AxiosPromise<RT>, apiClassName: string, options?: callbackOptions) { | |
const { successCb, failureCb, spinnerCb } = options || {}; |
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
iOS: | |
react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios | |
android: | |
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/index.android.bundle --assets-dest android/app/src/main/res/ |
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
watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf $TMPDIR/metro* && rm -rf $TMPDIR/haste-* | |
cd node_modules/react-native/scripts && ./ios-install-third-party.sh && cd ../../../ | |
cd node_modules/react-native/third-party/glog-0.3.5/ && ../../scripts/ios-configure-glog.sh && cd ../../../../ | |
Also - If you want to build app for iOS 12 you have to switch path to the active developer directory: | |
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer |
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
geth \ | |
--rpc \ | |
--rpcapi "db,miner,net,txpool,network,eth,net,web3,personal" \ | |
--cache=1024 \ | |
--rpcport 8545 \ | |
--rpcaddr "{address}" \ | |
--rpccorsdomain "*" \ | |
--port 8546 \ | |
--networkid 42 \ | |
--datadir "xxx/ethereum_data" \ |
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, { PureComponent } from 'react' | |
import { TouchableOpacity, View, Text } from 'react-native' | |
import _debounce from 'lodash/debounce' | |
const DELAY = 400 | |
class HomeButton extends PureComponent { | |
onDebounce = _debounce(this.onPress, DELAY) |
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, { createRef } from 'react' | |
import { View, TextInput } from 'react-native' | |
const textInputRef = createRef() // ref 오브젝트. 사용되고 있는 SmapleSFC 스코프의 바깥쪽에 있어서 SampleSFC가 리렌더링 되어도 영향을 받지 않고 안의 current만 해당 노드(주로 RN Component)의 레퍼런스 정보로 업데이트 됩니다. 참조: (https://reactjs.org/docs/refs-and-the-dom.html#creating-refs) | |
const onChangeText = text => { // 파일 스코프의 onChangeText 함수, 인자는 text 를 가지며 이것은 TextInput에 타자를 칠때 생성되는 값을 의미합니다: 참조: (https://facebook.github.io/react-native/docs/textinput#onchangetext) | |
const { current } = textInputRef | |
if (current) { | |
current.setNativeProps({ text }) | |
} |
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
/** | |
* @see https://stackoverflow.com/questions/38651770/how-can-i-get-real-elment-by-node-id-react-native | |
*/ | |
import React, { PureComponent } from 'react'; | |
import { View, TextInput } from 'react-native'; | |
import ReactNativeComponentTree from 'react-native/Libraries/Renderer/shims/ReactNativeComponentTree'; | |
export default class TextHandler extends PureComponent { | |
state = { | |
username: '', |
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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |