Skip to content

Instantly share code, notes, and snippets.

View agarwalparas's full-sized avatar

Paras Agarwal agarwalparas

View GitHub Profile
# REACT + REDUX
## TERMS
### Store & State
The state is the data, and the store is where it’s kept.
redux gives you a store, and lets you keep state in it, and get state out, and respond when the state changes. But that’s all it does.
react-redux lets you connect pieces of the state to React components.
### Reducer
It takes the current state, and an action, and returns the newState
Reducer Rule #1: Never return undefined from a reducer.
Reducer Rule #2: Reducers must be pure functions.
# Setup Github and Bitbucket on a Computer :
https://gist.github.com/rosswd/e1afd2b0b0d515517eac
@agarwalparas
agarwalparas / gist:d355a950148702cc7ba82abc4d1943bf
Created November 3, 2017 04:06
Recover Force Push on Github
# First, you must get the previous commit sha, the one before the forced push:
## Hit through terminal
curl -u <username> https://api.github.com/repos/:owner/:repo/events
# Then you can create a branch from this sha:
## Hit through terminal
curl -u <github-username> -X POST -d '{"ref":"refs/heads/<new-branch-name>", "sha":"<sha-from-step-1>"}' https://api.github.com/repos/:owner/:repo/git/refs