
Frontend Engineer @hackerearth
- Tweets122
- Following125
- Followers29
- Likes936

ALT # filter-repo requires a fresh clone $ git clone [email protected]/smeijer/old-project.git ~/dev/old-project $ cd ~/dev/old-project # make history look like files were always in a /packages/subfolder $ git filter-repo --to-subdirectory-filter packages/old-project $ cd ~/dev/monorepo $ git remote add old-project ~/dev/old-project # tags can conflict with local tags, its possible to import & rename later $ git fetch --no-tags old-project $ git merge --allow-unrelated-histories old-project/main $ git remote remove old-project

ALT While all of these points are true, it would be a mistake to go to the other extreme and never write comments. Here are some rules to help you achieve a happy medium: Rule 1: Comments should not duplicate the code. Rule 2: Good comments do not excuse unclear code. Rule 3: If you can’t write a clear comment, there may be a problem with the code. Rule 4: Comments should dispel confusion, not cause it. Rule 5: Explain unidiomatic code in comments. Rule 6: Provide links to the original source of copied code. Rule 7: Include links to external references where they will be most helpful. Rule 8: Add comments when fixing bugs. Rule 9: Use comments to mark incomplete implementations. The rest of this article explains each of these rules, providing examples and explaining how and when to apply them.

ALT A website usually uses external resources like images, CSS, and JavaScript. Those files need to be loaded from network or cache. The main thread could request them one by one as they find them while parsing to build a DOM, but in order to speed up, "preload scanner" is run concurrently. If there are things like <img> or <link> in the HTML document, preload scanner peeks at tokens generated by HTML parser and sends requests to the network thread in the browser process.
























