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
#!/bin/bash | |
# $1 bucket-name | |
# $2 env | |
PACKAGE_VERSION=$(cat package.json \ | |
| grep version \ | |
| head -1 \ | |
| awk -F: '{ print $2 }' \ | |
| sed 's/[",]//g' \ |
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
const { checkSchema } = require('express-validator/check'); | |
exports.validateCalculate = [ | |
checkSchema({ | |
product: { | |
in: ['query'], | |
errorMessage: 'product must be an integer', | |
exists: true, | |
isInt: { options: { min: 0 } }, | |
toInt: true |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>videojs-contrib-hls embed</title> | |
<!-- | |
Uses the latest versions of video.js and videojs-contrib-hls. |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>videojs-contrib-hls embed</title> | |
<!-- | |
Uses the latest versions of video.js and videojs-contrib-hls. |
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 from 'react'; | |
import { reduxForm, Field } from 'redux-form'; | |
import { ScrollView, Text, TouchableOpacity } from 'react-native'; | |
import moment from 'moment'; | |
import MyTextInput from './MyTextInput'; | |
/** | |
* Automatically adds the dashes required by the specified phone format and limits the input to ten characters | |
*/ |
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
export default reduxForm({ | |
form: 'signIn', | |
asyncValidate: (values) => { | |
return new Promise((resolve, reject) => { | |
// simulate request | |
setTimeout(() => { | |
if (values.email.indexOf('@wolox.com') === -1) { | |
reject({ email: 'Only mails at wolox are allowed' }); | |
} else { | |
resolve(); |
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
<Field | |
name={'password'} | |
component={MyTextInput} | |
validate={[ | |
(val) => val ? undefined : 'Password field is required', | |
(val) => val && val.length >= 8 ? undefined : 'Password must be at least 8 characters long' | |
]} | |
/> |
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
export default reduxForm({ | |
form: 'signIn', | |
validate: (values) => { | |
const errors = {}; | |
errors.email = !values.email | |
? 'Email field is required' | |
: !emailRegex.test(values.email) | |
? 'Email format is invalid' | |
: undefined; |
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 from 'react'; | |
import { TextInput, View, Text } from 'react-native'; | |
/** | |
* to be wrapped with redux-form Field component | |
*/ | |
export default function MyTextInput(props) { | |
const { input, meta, ...inputProps } = props; | |
const formStates = ['active', 'autofilled', 'asyncValidating', 'dirty', 'invalid', 'pristine', |
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 from 'react'; | |
import { reduxForm, Field } from 'redux-form'; | |
import { ScrollView, Text, TouchableOpacity } from 'react-native'; | |
import MyTextInput from './MyTextInput' | |
function MyForm(props) { | |
const formStates = ['asyncValidating', 'dirty', 'pristine', 'valid', 'invalid', 'submitting', | |
'submitSucceeded', 'submitFailed']; |
NewerOlder