Every step in this tutorial is required for making terminal look as the image below.
sudo apt-get install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"| [user] | |
| name = Patrick Santos | |
| email = [email protected] | |
| [credential] | |
| helper = store | |
| [push] | |
| default = simple | |
| [alias] | |
| set-upstream = !git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD` | |
| [core] |
Based off of: http://docs.sequelizejs.com/en/1.7.0/articles/express/
Create and initialize your a directory for your Express application.
$ mkdir sequelize-demo| import removeAccents from 'remove-accents'; | |
| /** | |
| * Filter list based on certain attribute by some text | |
| * @param {array} list | |
| * @param {string} searchText | |
| * @param {string} attribute | |
| * @returns {array} new filtered list | |
| */ | |
| export function filterList(list, searchText, attribute) { |
| /** | |
| * Get cultures name into a new array | |
| * Immutable, pure | |
| * @param {Array} cultures | |
| * @returns {Array<String>} | |
| */ | |
| const getNames = cultures => cultures.map(item => item.cultureName); | |
| /** | |
| * Get cultures quantity summed into |
| const cultures = [ | |
| { | |
| cultureName: 'Soybean', | |
| quantity: 1500.50, | |
| calories: 446, | |
| energy: { | |
| quantity: 0, | |
| unit: 'g' | |
| } | |
| }, |
| const names = cultures.map(item => item.cultureName) | |
| // ['Soybean', 'Maize', 'Wheat'] | |
| const energies = cultures | |
| .reduce((acc, nextObject) => { | |
| const nextValue = nextObject.energy.quantity; | |
| const currentValue = acc[nextObject.energy.unit] | |
| ? acc[nextObject.energy.unit].quantity | |
| : 0; | |
| acc[nextObject.energy.unit] = { |
| /** | |
| * Pure javascript responsability: | |
| * http to get cultures then add it to | |
| * 'cultures' variable and then reuse | |
| * the transformers we wrote | |
| */ | |
| // Vue.js | |
| <ul> | |
| <li v-for="item in getNames(cultures)">{{ item }}</li> |
| /** | |
| * Redux action to store cultures | |
| * @param {Array<Object>} arr | |
| * @returns {Object} | |
| */ | |
| export const reduxAction = arr => ({ | |
| type: 'ADD_CULTURES', | |
| cultures: arr | |
| }); |
| /** | |
| * React | |
| */ | |
| import React from 'react'; | |
| import PropTypes from 'prop-types'; | |
| /** | |
| * Generic | |
| */ | |
| import areIntlLocalesSupported from 'intl-locales-supported'; |