Skip to content

Instantly share code, notes, and snippets.

Router : https://github.com/aksonov/react-native-router-flux
via : https://medium.com/differential/react-native-basics-using-react-native-router-flux-f11e5128aff9#.3dfpm2p7l
TabView : https://github.com/react-native-community/react-native-tab-view
via : https://medium.com/@satya164/how-i-built-react-native-tab-view-7adfb2570af6#.86wxw1saf
Redux-persist :
https://github.com/rt2zz/redux-persist
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
cd android && ./gradlew assembleRelease
@padupuy
padupuy / MockRequest.js
Last active May 9, 2017 10:02
use kakapo to mock data
import {Server, Router, Database} from 'kakapo';
import {isDevMode} from './env';
import * as URL from './constants';
import authFixture from './auth.fixture.js';
import profileFixture from './profile.fixture.js';
const singleton = Symbol();
const singletonEnforcer = Symbol();
@padupuy
padupuy / Input.js
Created May 16, 2017 11:52
RN Picker
import React, {Component} from 'react';
import {
View,
TextInput,
StyleSheet,
Platform,
} from 'react-native';
export default (props) => {
const {styleWrapper, style, ...rest} = {...props};
@padupuy
padupuy / DummyScreen.js
Created May 30, 2017 16:29
Android zIndex bug
import React, {Component} from 'react';
import {
StyleSheet,
View,
Text,
} from 'react-native';
export default class DummyScreen extends Component {
render() {
return (
@padupuy
padupuy / DummyScreen.js
Created May 30, 2017 16:54
Android zIndex OK
import React, {Component} from 'react';
import {
StyleSheet,
View,
Text,
} from 'react-native';
export default class DummyScreen extends Component {
render() {
return (
@padupuy
padupuy / help.sh
Created September 1, 2017 08:25
Launch specific iOS simulator
#installation
gem install xcode-install
xcversion simulators --install='iOS 9.3'
#list de tous les devices utilisables qui permettent de récupérer l'udid
xcrun simctl list
#lancement du simulateur
/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator -CurrentDeviceUDID <UDID>
@padupuy
padupuy / record.sh
Last active September 13, 2017 09:06
Record devices from cli
# Use the command line interface
# For ios https://developer.apple.com/library/content/documentation/IDEs/Conceptual/iOS_Simulator_Guide/InteractingwiththeiOSSimulator/InteractingwiththeiOSSimulator.html
xcrun simctl io booted recordVideo appvideo.mov
# For android https://developer.android.com/studio/command-line/adb.html#screenrecord
adb shell screenrecord --verbose /sdcard/appvideo.mp4
adb pull /sdcard/appvideo.mp4 /Users/project/destination
@padupuy
padupuy / zip.sh
Created September 20, 2017 10:57
Zip
#compress
tar -zcvf archive_name.tar.gz folder_to_compress
#extract
tar -zxvf archive_name.tar.gz