Mufa | Redux | |
---|---|---|
Publish | fire or pub |
dispatch |
Subscribe | on or sub |
subscribe |
Unsubscribe | off(subscribe_return) |
subscribe_return() |
Event | String identifies the event | Literal object that must has type property which identifies the event (action) |
Message | Argument for each message fire(event_name, msg1,..., msgn) |
Property for each message in the action {type: event_name, msg1, msg2,... msgn} |
NPM | npm install mufa |
npm install redux |
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
/** | |
* [calculate description] | |
* @method calculate | |
* @param {Number} itemsCount number of items to be read | |
* @param {Number} itemsRequiredTimeRead required time in seconds to read those items | |
* @param {Number} itemSize the size of each item in KB | |
* @param {Boolean} isStrongRead the consistency model of Read : Strong or eventual | |
* @return {Number} Read throughput | |
*/ | |
function calculate({itemsCount, itemsRequiredTimeRead, itemSize}, isStrongRead = 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
npm install --save prop-types; | |
npm update react react-dom enzyme; |
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 { connect } from 'react-redux'; | |
import _ from 'lodash'; | |
export default function(...args) { | |
return function(ComponentClass) { | |
const mapStateToProps = !Array.isArray(args[0]) | |
? args[0] | |
: state => _.pick(state, args[0]); | |
return connect(mapStateToProps, mapDispatchToProps)(ComponentClass); | |
}; |
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 | |
ENDPOINT=http://169.254.169.254/latest/meta-data/iam/security-credentials/; | |
curl -s $ENDPOINT`curl -s $ENDPOINT` |
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
# Should be deployed first as it exports "LambdaRoleExecutionARN" which is used by other stacks. | |
Resources: | |
LambdaRole: | |
Type: AWS::IAM::Role | |
Properties: | |
AssumeRolePolicyDocument: | |
Version: "2012-10-17" | |
Statement: | |
- | |
Effect: Allow |
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 | |
WS=/tmp/complete-python-bootcamp-notebook-udemy; | |
if [[ ! -d "$WS" ]]; then | |
git clone git@github.com:rathath-it/Complete-Python-Bootcamp.git $WS; | |
fi | |
cd $WS; | |
jupyter notebook; |
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 | |
for i in `vagrant global-status | grep virtualbox | awk '{ print $1 }'` ; do vagrant destroy $i ; done |
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 | |
# Retrieve the version of AWS | |
AWS_VERSION=$(aws --version | cut -f1 -d" " | cut -f2 -d"/"); | |
echo Your current AWS version is $AWS_VERSION; | |
REMOTE_PATH=https://raw.githubusercontent.com/aws/aws-cli/$AWS_VERSION/bin/aws_zsh_completer.sh | |
LOCAL_PATH=/usr/local/bin/aws_zsh_completer.sh; |
OlderNewer