View gist:576c3b7511e5045c5974627f88f7d802
export const updateLocale = createAction('@@common/updateLocale', ({ locale = window.Project.locale, cb = () => {} }) => (dispatch) => {
return getStatic({ url: `locales/${locale}.json` })
.then((res) => {
const translationsObject = {
[locale]: res,
};
dispatch(setLocale(locale));
dispatch(loadTranslations(translationsObject));
})
.then(cb);
View temp.json
{
"unload": {
"warning": "Are you sure want to navigate away from this page?"
},
"common": {
"not_permitted_warning": "You have no permission to ${0}. You may ask ${1} ${2} to give you permission to ${3}.",
"assignAction": "assign this item"
}
}
View git-workflow.sh
# Create a feature branch
# Typically, branch from the current develop branch:
git fetch
git checkout develop.xx
git pull origin develop.xx
git checkout -b <BRANCH_NAME>
# Make atomic commits
git add .
View gist:7f0909fe51de6bc3c7f8fe1ccbe17991
import webpack from 'webpack';
import cssnano from 'cssnano';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
import globalVars from 'postcss-global-scss-vars';
import hiTaskTheme from '../src/styles/material_theme/hitask';
import config from '../config';
import _debug from 'debug';
const debug = _debug('app:webpack:config');
View gist:91da08b8625e6e45856ccb2caaf69366
const requiredFields = { teamMembers: ['email'] };
const PopoverForm = reduxForm({
form: 'PopoverAddContact',
validate: (values) => {
return { ...validate({ values, requiredFields }) };
},
initialValues: {
teamMembers: [
{},
{},
View gist:a296aec3be310e92567008c222ea2247
import validator from 'validator';
const verifiers = {
email: (value) => {
return !validator.isEmail(value) && 'Invalid email address';
},
fullName: (value) => {
}
};
View gist:b4b341b29b0f0b01cd8f2116eb0ee26c
import React, { Component, PropTypes } from 'react';
import { Link } from 'react-router';
import { ListItem } from 'material-ui/List';
export class ListLink extends Component {
static propTypes = {
path: PropTypes.string.isRequired,
push: PropTypes.string.isRequired,
}
View gist:068feacd323136c0c566
'use strict';
let string = 'login validation failed: data.data.id should NOT be shorter than 6 characters, data.data.id should match format email, data.data.attributes.password should NOT be shorter than 6 characters';
console.log(string.substring(string.indexOf(':') + 2));
var formattedString = string.substring(string.indexOf(':') + 2).split(', ').map((eTitle) => {
const regEx = /.*\.([^.]*)/;
console.log(regEx.exec(eTitle));
return regEx.exec(eTitle)[1];
}).join(', ');
View gist:ee3c20bad3c3343ada8d
http-in | 23:11:46.072Z DEBUG cappasity-core: handle react router: /paypal-subscription-return (req_id=33dffd1a-2f29-49af-967e-4f5ca954ce25, namespace=config)
ms-payments | '{"Authorization":"Bearer A101.qf5G020OAG48PFTzccpqYXK7mWtHbyILkajzgQZRKDX7oDrVG_DFVQtqRPwTjRXZ.Z7ZcGWMzlHClvbnYjuiZuZYwxkS","Content-Length":2,"Accept":"application/json","Content-Type":"application/json","PayPal-Request-Id":"2ee0d5e2-e3c9-4623-bdb9-b03148e6622f","User-Agent":"PayPalSDK/PayPal-node-SDK 1.6.8 (node v5.3.0-x64-linux; OpenSSL 1.0.2e)"}'
ms-payments | '{}'
ms-payments | paypal-debug-id: c171614ec4c93, c171614ec4c93
ms-payments | '{"date":"Wed, 30 Dec 2015 23:11:46 GMT","server":"Apache","proxy_server_info":"host=slcsbplatformapiserv3002.slc.paypal.com;threadId=21060","paypal-debug-id":"c171614ec4c93, c171614ec4c93","correlation-id":"c171614ec4c93","content-language":"*","content-length":"243","vary":"Authorization","content-type":"application/json","set-cookie":["X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D88
View gist:ccb90ac342bbf27a78b2
fetchUsers: (input, state, next) => {
_fetch('/api/users', 'get', state)
.then(function(response){
return response.json();
})
.then(function(response){
console.log('Fetched users:', response);
// Debug loading screen
// setTimeout(function(){
// next.success(response);