Posts

Showing posts from January, 2019

Mastering Git

Image
What to focus on?     Today is a scary day. Today is the day of admitting one's faults and learning what I was supposed to long ago. So let's dig into learning curve all together by looking at a couple of Git  functions I personally have never used before, which though, for some of you, might already be very familiar, so I will try to bring more interesting information about them to peak everyone's interest.     What are the two functions that we will be looking at? Shall it be git fetch  and git tag . Let's play Fetch     The purpose of git fetch is to download commits, files, etc. from a remote repo into user's local one (from here , and here ). How is it different from git pull  then? Well, git fetch  does not necessary merge the content with the user's repo, but git pull does. The way to imagine it would be  git pull  =  git fetch  +  git merge .     Here is a graphical representation of the above: Source     There are quite a few ways to

FilerJS experience

Image
Release 0.1     Today, I would like to tell you about my so far best amateur usage of Git as a part of " Open Source Development " class assignment submission, and I what knowledge I have acquired from it. Well, let's start from the beginning.     The task was to provide a fix to one of the JS files in Filer project files. The "fix" was introduced to all class attendees as a mere move from using "var" (function-scope) upon variable declaration, to "let and "const" (block-scope), which were introduced in ES6 . The main idea of the assignment was to practice with such incredibly needful in programmers' lives Git commands and try (only try) to master them.     The file fs.watch.prec.js  had been randomly chosen as my personal firing field and the issue report/assignment request has been submitted via GitHub. After a prompt response with notification from my professor that I had just gotten assigned to issue #666, the

Node.js: fs.open()

    Today, I would like to take a look at one of the widely used functions of Node.js ' fs  library -  open() , and its synchronous version -  openSync() .     The function's purpose is to open a file, specified by a path (the first mandatory parameter of the function). The code of the function is following ( source ): function open(path, flags, mode, callback) {   path = toPathIfFileURL(path);   validatePath(path);   if (arguments.length < 3) {     callback = flags;     flags = 'r';     mode = 0o666;   } else if (typeof mode === 'function') {     callback = mode;     mode = 0o666;   }   const flagsNumber = stringToFlags(flags);   if (arguments.length >= 4) {     mode = validateMode(mode, 'mode', 0o666);   }   callback = makeCallback(callback);   const req = new FSReqCallback();   req.oncomplete = callback;   binding.open(pathModule.toNamespacedPath(path),                flagsNumber,                mode,                re