Author | Logan

  1. Read Lines from stdin in Node.js

    It is easy to write a hello world program in Node.js:

    console.log("Hello world!")
    

    However, due to the asynchronous nature of Javascript, reading inputs and writing outputs are less straight-forward. We have to pass the callback functions or register event listeners.

    First Attempt

    For example, to read some …

    More

  2. Browserify

    It is common to organize the code in several modules when we are developing Javascript applications. In Node.js ecosystem, we can import a module with the require() function and export symbols by adding them to the module.exports object. On the other hand, ES2015 adds import statements and export …

    More

  3. Bash Signal Handler and Traps

    I would like to launch ssh-agent and add my private key at the beginning of my shell script and stop it before leaving the shell script. How do I guarantee that ssh-agent will be shutted down properly? What will happen if the user press Ctrl-C or even kill the shell …

    More

  4. Fix Nautilus Video Thumbnails

    I have a clean Ubuntu 15.10 installation these days. However, I noticed that video thumbnails (or previews) do not show up in Gnome Nautilus:

    Nautilus without video preview thumbnails

    I prefer thumbnails to icons. Besides, I remember that Nautilus will generate a thumbnail for each video in Ubuntu 14.04. Thus, I took some …

    More

  5. Discourse Installation Notes

    Discourse is a new generation discussion forum. I found that Discourse is very suitable for personal note taking. One notable feature of Discourse is that the users can focus on conversations. Besides, it supports Markdown as the message markup language. This is the reason why I like it very much …

    More

  6. Global Git Ignore File

    There are some files that shouldn't be tracked by Git at all. For example, the temporary files created by the text editors, the Python bytecode, and etc.

    How could we ignore those files? In the previous post, I have mentioned that we can create a .gitignore file and list the …

    More

  7. Comparison and Sorting in Python3

    Although I have written Python for several years, I am still not very familiar with its idioms. In particular, I don't quite understand how to compare and sort the objects in Python. That's the reason why I am writing this article.

    The rest of this article consists of following sections …

    More

« Prev Page 3 / 7 Next »