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
| var _ = require('lodash'); | |
| module.exports.arrayDiffToHtmlTable = function () { | |
| var occurrences = _.flatten(_.toArray(arguments)); | |
| var cache = {}; | |
| var results = occurrences.reduce(function (stack, item) { | |
| var rewrite = {}; | |
| var flatten = Object.assign(_.omit(item, ['meta']), item.meta); | |
| var data = rewrite[item._id] = flatten; | |
| cache[item._id] = (cache.hasOwnProperty(item._id) ? cache[item._id] : flatten); |
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
| const test = [[1, [2, [3]]], 4]; | |
| const dig = (stack, object) => | |
| Array.isArray(object) ? flatten(object, stack) : stack.concat(object); | |
| const flatten = (input, output = []) => input.reduce(dig, output); | |
| console.clear(); | |
| console.log(flatten(test)); // [1, 2, 3, 4] |
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
| /* | |
| Write a program in JavaScript that prints the numbers from 1 to 100. | |
| But for multiples of seven print "Sou" instead of the number and for | |
| the multiples of eleven print "Dev". For numbers which are multiples | |
| of both seven and eleven print "SouDev". | |
| (note: printing with console.log() is fine) | |
| */ | |
| console.clear() |
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 first from 'lodash/first'; | |
| import get from 'lodash/get'; | |
| import React from 'react'; | |
| import { isEmail } from 'validator'; | |
| import { TEXT, CHECKBOX } from 'constants/fields'; | |
| import { SUBMIT } from 'constants/controls'; | |
| import ValidationMessages from 'messages/validation'; | |
| import styles from './styles.css'; |
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 PropTypes from 'prop-types'; | |
| export const component = ({ title, description }) => ( | |
| <dl> | |
| <dt>{title}</dt> | |
| <dd>{description}</dd> | |
| </dl> | |
| ); | |
| export default Object.assign(component, { |
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 { pick } from 'ramda'; | |
| import { | |
| ALREADY_EXISTS, | |
| COMMUNICATION_ID_NOT_FOUND, | |
| GENERAL_SIGNUP_ERROR, | |
| } from 'constants/signUp'; | |
| import { | |
| ATTRACTION_ALREADY_ASSIGNED_TO_COMMUNICATION_ID as ALREADY_EXISTS_ERROR_CODE, | |
| COMMUNICATION_ID_NOT_FOUND as COMMUNICATION_ID_NOT_FOUND_ERROR_CODE, |
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
| const selectActivationStatus = createSelector( | |
| selectActivationInProgress, | |
| selectResendActivationInProgress, | |
| selectActivationError, | |
| selectResendActivationError, | |
| selectActivationSuccess, | |
| selectResendActivationSuccess, | |
| ( | |
| activateInProgress, | |
| resendInProgress, |
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 spacing($amount = 1){ | |
| @return ($amount * 2) + 'rem'; | |
| } | |
| /* after */ | |
| .my-module { | |
| padding: spacing(); | |
| margin: spacing(2); | |
| } |
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 React, { Component } from 'react'; | |
| import { intlShape } from 'react-intl'; | |
| import PropTypes from 'prop-types'; | |
| import { SettingsPropType } from 'common/propTypes'; | |
| import compose from './composition'; | |
| import Render from './render'; | |
| import ErrorNotification from './render/error-notification'; |
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 React, { Component } from 'react'; | |
| import { intlShape } from 'react-intl'; | |
| import PropTypes from 'prop-types'; | |
| import noop from 'lodash/noop'; | |
| import { forEach } from 'utils/rendering'; | |
| import Public from 'components/pages/public'; | |
| import Tab from 'components/Tab'; | |
| import Form from 'components/Form'; | |
| import GenericMessages from 'messages/generic'; |
OlderNewer