Skip to content

Instantly share code, notes, and snippets.

On vacation

abdennour abdennour

On vacation
View GitHub Profile
abdennour / calculate-dynamodb-read-throughput.js
Last active Jul 7, 2017
Calculate required read throughput for AWS DynamoDB
View calculate-dynamodb-read-throughput.js
* [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) {
abdennour /
Created Jul 29, 2017
Upgrade to React 15+
npm install --save prop-types;
npm update react react-dom enzyme;
abdennour /
Last active Aug 5, 2017
Sub/Pub pattern implementation between Mufa & Redux
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
abdennour / connect.js
Last active Jul 24, 2018
Array instead of mapStateToProps function in React-Redux connect
View connect.js
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);
abdennour /
Last active Dec 9, 2017
Display AMI role metedata associated to the running EC2 : access key, secret access key, token, last rotation, .. so on.
curl -s $ENDPOINT`curl -s $ENDPOINT`
abdennour / 01-lambda-exec-role.yaml
Last active Dec 20, 2017
Calculator of DynamoDB reserved capacity via CloudFormation
View 01-lambda-exec-role.yaml
# Should be deployed first as it exports "LambdaRoleExecutionARN" which is used by other stacks.
Type: AWS::IAM::Role
Version: "2012-10-17"
Effect: Allow
abdennour /
Created Feb 17, 2018
Open Python Jupyter Notebook ( jupyter is a prerequisite )
if [[ ! -d "$WS" ]]; then
git clone $WS;
cd $WS;
jupyter notebook;
abdennour /
Created Feb 20, 2018 — forked from PurpleBooth/
A template to make good

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.


abdennour /
Created Mar 8, 2018
Destroy all running Vagrant boxes after Confirmation
for i in `vagrant global-status | grep virtualbox | awk '{ print $1 }'` ; do vagrant destroy $i ; done
abdennour /
Last active Mar 8, 2018
Install AWS Auto Completer for ZSH
# Retrieve the version of AWS
AWS_VERSION=$(aws --version | cut -f1 -d" " | cut -f2 -d"/");
echo Your current AWS version is $AWS_VERSION;
You can’t perform that action at this time.