Skip to content

Instantly share code, notes, and snippets.

@sadikaya
sadikaya / rename-git-branch-local-remote.sh
Created June 12, 2017 11:16
Rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@sadikaya
sadikaya / react-lifecycles.md
Created December 15, 2016 06:03
react component lifecycles

React Component Lifecycle

  • getInitialState
  • getDefaultProps
  • componentWillMount
  • componentDidMount
  • shouldComponentUpdate (Update only)
  • componentWillUpdate (Update only)
  • componentWillReceiveProps (Update only)
  • render
  • componentDidUpdate (Update only)
@sadikaya
sadikaya / git-mirror.md
Created November 20, 2016 10:47
Mirror git repository, good for backup or migration
git clone --mirror <url_of_old_repo>
cd <name_of_old_repo>
git remote add new-origin <url_of_new_repo>
git push new-origin --mirror
@sadikaya
sadikaya / package.json
Last active November 18, 2016 13:31
use npm-scripts to deploy build folder to gh-pages.
{
"scripts": {
"deploy": "git push origin :gh-pages && git subtree push --prefix [build-folder] origin gh-pages"
}
}
@sadikaya
sadikaya / npm-global-check.md
Created November 11, 2016 12:24
check globally installed npm packages
npm list -g --depth=0
$ npm list -g --depth=0
C:\Users\skay\AppData\Roaming\npm
+-- colorguard@1.2.0
+-- create-react-app@0.6.0
+-- node-gyp@3.4.0