Author | Logan

  1. A Quick Guide to Grunt

    Grunt is a task runner for Javascript development. Grunt automates the process to bundle, transpile, uglify, and compress the Javascript source code. This post would like to give a quick guide to Grunt.

    Installation

    Our first step is to create a package.json. We will need a package.json to …

    More

  2. JavaScript Prototype and Object Oriented

    Javascript is a prototype-based object-oriented programming language. Unlike the conventional class-based object-oriented programming languages (e.g. C++ or Java), which ask programmers to write a class and then instantiate several similar objects from the class, Javascript adopts a different approach. In the world of Javascript, we have to craft a …

    More

  3. 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

  4. 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

  5. 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

  6. 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

  7. 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

Page 1 / 5 Next »