This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // -- updated in 2020/04/19 covering the issues in the comments to this point | |
| // -- remember you also have things like `ensureDirSync` from https://github.com/jprichardson/node-fs-extra/blob/master/docs/ensureDir-sync.md | |
| const fs = require('fs') | |
| function writeFileSyncRecursive(filename, content, charset) { | |
| // -- normalize path separator to '/' instead of path.sep, | |
| // -- as / works in node for Windows as well, and mixed \\ and / can appear in the path | |
| let filepath = filename.replace(/\\/g,'/'); | |
| // -- preparation to allow absolute paths as well |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # good git book | |
| http://git-scm.com/book | |
| # Discard uncommitted changes in a specific file | |
| git checkout file_name | |
| # Clear everything not in repo | |
| git checkout -- . | |
| # A way to quickly move to the previous commit in a git branch. This also way for "deleting" last commit. |