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
import React from 'react'; | |
import { reduxForm, Field } from 'redux-form'; | |
import { ScrollView, Text } from 'react-native'; | |
import MyTextInput from './MyTextInput'; | |
function MyForm() { | |
return ( | |
<ScrollView keyboardShouldPersistTaps={'handled'}> | |
<Text>Email</Text> |
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
import React from 'react'; | |
import { TextInput, View, Text } from 'react-native'; | |
/** | |
* to be wrapped with redux-form Field component | |
*/ | |
export default function MyTextInput(props) { | |
const { input, ...inputProps } = props; | |
return ( |
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
#!/bin/sh -e | |
sleep 2 | |
su - ubuntu -c /home/ubuntu/prerender_startup.sh | |
exit 0 |
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
#!/bin/bash | |
#Starts forever after boot through /etc/rc.local. Set the node version in the following script properly. | |
/home/<user>/.nvm/versions/node/<node version>/bin/forever start /home/<user>/<path to prerender>/server.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
server { | |
listen 80; | |
root /home/yourusername/www/mysite; | |
location / { | |
try_files $uri @prerender; | |
} | |
location @prerender { |
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
import gulp from 'gulp'; | |
import uglify from 'gulp-uglify'; | |
import eslint from 'gulp-eslint'; | |
import babel from 'gulp-babel'; | |
import concat from 'gulp-concat'; | |
import sourcemaps from 'gulp-sourcemaps'; | |
import gulpif from 'gulp-if'; | |
import globalConfig from './config'; | |
const taskOptions = globalConfig.getConfigKeys(); |
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
export default { | |
/** | |
* concat | |
* Enables/Disables source files concatenation | |
*/ | |
concat: true, | |
/** | |
* lint |
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
export default { | |
/** | |
* concat | |
* Enables/Disables source files concatenation | |
*/ | |
concat: false, | |
/** | |
* lint |
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
import { argv } from 'yargs'; | |
export default { | |
environment: argv.env || 'development', | |
getConfigKeys () { | |
let keys; | |
try { | |
keys = require(`./${this.environment}`); | |
} catch (e) { | |
throw new Error(`No config file found for environment ${this.environment}`); |
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
gulp.task('js', () => | |
gulp.src(localConfig.src) | |
.pipe(gulpif(globalConfig.development(), eslint())) | |
.pipe(gulpif(globalConfig.development(), eslint.format())) | |
.pipe(gulpif(globalConfig.development(), sourcemaps.init())) | |
.pipe(babel()) | |
.pipe(gulpif(globalConfig.production() || globalConfig.qa(), concat(localConfig.buildFileName))) | |
.pipe(gulpif(globalConfig.production(), uglify())) | |
.pipe(gulpif(globalConfig.development(), sourcemaps.write())) | |
.pipe(gulp.dest(localConfig.dest)) |