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
| # Restore from Docker repo | |
| $ docker run mysql | |
| # Restore from Docker tarball | |
| $ docker load -i mysql.tar | |
| $ docker images # To confirm that it has been loaded locally | |
| $ docker run mysql |
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
| $ docker inspect containerid | |
| ... | |
| "Mounts": [ | |
| { | |
| "Type": "bind", | |
| "Source": "/var/mysql", | |
| "Destination": "/mysql_data", | |
| "Mode": "rw", | |
| "RW": true, | |
| "Propagation": "rprivate" |
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
| from datetime import datetime | |
| from datetime import date | |
| import numpy as np | |
| import pandas as pd | |
| data = { | |
| 'date': ['2014-05-01', '2014-05-01', '2014-05-02', '2014-05-02', '2014-05-02', '2014-05-03', '2014-05-03', '2014-05-04', '2014-05-04', '2014-05-08'], | |
| 'score': [34, 25, 26, 15, 15, 14, 26, 25, 62, 41] | |
| } |
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
| function mapStateToProps({ products }) { | |
| return { products }; | |
| } | |
| function mapDispatchToProps(dispatch) { | |
| return bindActionCreators({ fetchProducts }, dispatch); | |
| } | |
| export default connect(mapStateToProps, mapDispatchToProps)(ProductList); |
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
| class Signin extends Component { | |
| handleFormSubmit({ email, password }) { | |
| this.props.signinUser({ email, password }, () => { | |
| this.props.history.push('/feature'); | |
| }); | |
| } | |
| ... | |
| render() { |
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 axios from 'axios'; | |
| const ROOT_URL = 'http://localhost:3090'; | |
| export function signinUser({ email, password }, callback) { | |
| return function(dispatch) { | |
| axios.post(`${ROOT_URL}/signin`, { email, password }) | |
| // If request is good... | |
| .then(response => { |
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 const fetchUser = () => { | |
| return function(dispatch) { | |
| axios | |
| .get("/api/current_user") | |
| .then(res => dispatch({ type: FETCH_USER, payload: res })); | |
| }; | |
| }; |
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 const fetchUser = () => async dispatch => { | |
| const res = await axios.get("/api/current_user"); | |
| dispatch({ type: FETCH_USER, payload: res }); | |
| }; |
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 const fetchUser = () => async dispatch => | |
| dispatch({ type: FETCH_USER, payload: await axios.get("/api/current_user") }); |
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
| { | |
| "configurations" : [ | |
| { | |
| "zoo.cfg" : { | |
| "properties_attributes" : { }, | |
| "properties" : { | |
| "autopurge.purgeInterval" : "24", | |
| "dataDir" : "/hadoop/zookeeper", | |
| "autopurge.snapRetainCount" : "30", | |
| "clientPort" : "2181", |