I am maintaining this blog to document things that I have done and would like to remember or perhaps could help other people who are facing the same issues.
### Use case: Working on 2 dev branches and merging one into the other and want to revert git checkout dev_branch git merge my_new_feature // merging my branch into develop Ooops, now I realized `my_new_feature` has something wrong git revert -m 1 <sha of merged commit> OR git revert HEAD -m 1 means we keep the parent side of merge ( dev_branch branch) ### Fetch their new commits and merge to your branch git fetch protected_repo Committed but not pushed to remote. Want to get rid of latest commit git reset --hard HEAD~1 Get a branch from a forked repo to your own repo (or to your own forked repo) git reset HEAD~1 Get a branch from a forked repo to your own repo (or to your own forked repo) git fetch git@github . com : theirusername / reponame . git theirbranch : ournameforbranch Associate your local copy to the upstream branch git remote add repo_name https://github.com/theirusername/their_repo.git Fetch their new commits and merge to your branch git
This blog post title is pretty confusing - but if you get to read this blog post by Google, it actually makes sense. It's actually pretty cool. Not that I don't like callbacks or promises, but I can see this being useful in more complex examples. async function fetchDogPics(url) { try { //this looks synchronous but it isn't... const response = await fetch(url); await response.text(); } catch (err) { console.log('failed', err); } }
This links highlights what's new in Chrome 56: https://developers.google.com/web/updates/2017/01/nic56?utm_source=frontendfocus&utm_medium=email One cool thing amongst others (bluetooth access is also cool but this one css feature is something I wish we had a while back) is position:sticky . It's available in Chrome 56 (stable as of Jan 2017) and to summarize, it allows to fix an element into the viewport when it's within a threshold. .header { // Element will be "fixed" when it is 10px from the top of the viewport position:sticky; top: 10px } You could set top : 0; to make it stick directly to the top of the viewport. Have to be conscious that this positioning might not be available in other browsers as of yet. There's this site I use to check what's available: http://caniuse.com/#search=sticky As of now, it's not available in IE (not very surprising...)
Comments