Skip to content

Instantly share code, notes, and snippets.

View hieuhani's full-sized avatar
🎯
The beginning is the end and the end is the beginning

Hieu Tran hieuhani

🎯
The beginning is the end and the end is the beginning
View GitHub Profile
// Nhan ket qua la 1 array
return state.set('menus', fromJS(payload.menus));
// Them phan tu
return state.set('menus', state.get('menus').push(fromJS(payload.menu)));
// Update 1 phan tu
return state
.set('sets', state.get('sets').map((setItem) => {
if (setItem.get('id') === payload.set.id) {
import { createSelector } from 'reselect';
const selectMenusDomain = () => (state) => state.get('menus');
const selectRestaurantMenus = () => createSelector(
selectMenusDomain(),
(menusState) => menusState.get('menus')
);
const selectActiveMenu = () => createSelector(
import { fromJS, List } from 'immutable';
import camelize from 'camelize';
import {
GET_RESTAURANT_MENUS_REQUEST,
GET_RESTAURANT_MENUS_SUCCESS,
GET_RESTAURANT_MENUS_ERROR,
SET_ACTIVE_MENU_CONTAINER_ID,
SET_ACTIVE_MENU_ITEM_ID,
PUT_UPDATE_MENU_CONTAINER_REQUEST,
PUT_UPDATE_MENU_CONTAINER_SUCCESS,
import { fromJS } from 'immutable';
import {
SIGN_IN_BY_EMAIL_REQUEST,
SIGN_IN_BY_EMAIL_SUCCESS,
SIGN_IN_BY_EMAIL_ERROR,
} from './constants';
const initialState = fromJS({
error: null,
user: null,
@hieuhani
hieuhani / PG::Error: ERROR: new encoding (UTF8) is incompatible
Created February 26, 2017 04:38 — forked from amolkhanorkar/PG::Error: ERROR: new encoding (UTF8) is incompatible
Postgres PG::Error: ERROR: new encoding (UTF8) is incompatible
======= Prolbem =================================================================================================================
I have installed : ruby-2.0.0,postgres-9.2 , now in rails app when I execute:
rake db:create , command I get:
PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
HINT: Use the same encoding as in the template database, or use template0 as template.
: CREATE DATABASE "my_db_name" ENCODING = 'unicode'.......
bin/rake:16:in `load'