git clone https://github.com/shabeeb/react-starter-kit
once it cloned we have to move to that directorycd react-starter-kit
Then we have to install all depentency modules. dont worry below commands will do it.npm install
Now our sample reactjs project is ready,
We can run development server using below commandnpm run dev

Now go to the editor and change something in src/components/home.js and see the browser again, react-hot-loader will reload the page.

To run production buildnpm run build
it will minify all the js/jsx code and save to build/bundle.js filenpm start or npm run start
will start server with production version.

if any conflict happened, it will show conflict, we have to do modification and commit again.

Delete a branch

git branch -d <brach name>

this will delete if all the changes are merged, if you want to use force delete , even not merged,

git branch -D <branch name>

Upload branch into server at setting head for push

git push --set-upstream origin <branch name>

Stash all local changes

git stash

Take back stashed changes – This will take aback all the changes you stashed

git stash pop

Discard changes on one file

git checkout filename

Remove local commit and reset to server head – it will delete all the local changes

git reset --hard origin/branch name

List all the branches push/pull remote origin.

This will show all the remote and local branches and where it is pointing into

git remote show origin

Fetch and push origin list

git remote -v

View uncommitted changes made

git diff

To see all the logs

git log

To see log with difference

git log -p

Git log for a single file

git log -p file/path
-p will give changes also

Other options with git log

git log --stat //this will show only number of files changed and number of changes
git log --pretty=oneline //show all the changes in one line with head and comment
git log --pretty=format:"%h - %an, %ar : %s" //show with name time and commit message
git log --author=username //show only one user commit

What is lazy scrolling?

lazy-scroll is an angularjs directive for infinite scrolling. Instead of click pagination links or going to next page , this will help to load data on scrolling like you see in Facebook. lazy-scroll will work even without jquery .

promises

Promise is just a way of writing asynchronous code in a more synchronous fashion.
ie, When you call promises, it will return a promise value and the calling code will wait until the promise is full filled, before executing next.

angularjs promises example:

var promise = asyncGreet('Robin Hood');
promise.then(function(greeting) {
alert('Success: ' + greeting);
}, function(reason) {
alert('Failed: ' + reason);
});
//then(successCallback, errorCallback, notifyCallback)
We can pass three parameters for ".then" function, of which one is on success,
another one on failure and last one is notifyCallback .notifyCallback can be
called more than one time to the show progress and it is an optional parameter.

Some differences between call back promises

Call back can be called once or more than once (depends on how it is written).

Promises will be called only once

Call back can throw errors and exceptions (have to write more call back for errors)

Promises have error handling

then(fulfilledHandler, errorHandler, progressHandler)

No states in call back

May have one of 3 states: unfulfilled, fulfilled and failed or only move from unfulfilled to either fulfilled or failed

In call back we can call N function in N levels

Can write a sequence of N async calls without N levels of indentation

These are some of my view points, if you have any suggestions or addons, you comments are welcome.

Sometime we have to request files from different host using ajax, and it may create problem because of CORS polices.

CORS means Cross-Origin Resource Sharing (CORS).

Cross domain request will be block by most of the browsers due to same-origin security policy. so we have to enable CORS on our server.we can do this by settingAccess-Control-Allow-Origin in a PHP with changing server.

if we need to allow a request from a perticular domain we can restrict as below