CoffeeScript - the Sugar of JavaScript

JavaScript is the vital part of modern interactive web. However, JavaScript is not easy; it mixes the features of several languages. Some good, some bad. The syntax is Java-esque but the underlying concepts is totally different from Java. CoffeeScript is a mini-language that compiles into JavaScript. It brings an elegant Python or Ruby-like...
「點我閱讀更多」

Edit HTML in Emacs with web-mode

Emacs has a built-in html-mode for HTML files. It is common that HTML files comes with other lauguages like CSS, JavaScript, PHP and so on. The built-in html-mode cannot handle these non-HTML parts well. For example, the indent of these parts in html-mode doesn’t work well. If you need an alternative major-mode for HTML, you can consider web...
「點我閱讀更多」

Iterator and Generator in Perl

To generate a list of numbers, Perl provides the syntax .. (double dots). However, the syntax only provides ascending sequences with 1 increment. What can we do if we need more flexible sequences in Perl? In the following example, you can see that .. only generate an ascending sequence. # print out 1 2 3 ... 10 $ perl -le '$, = " "; print (1...
「點我閱讀更多」

Optimizing PDF with Kindle

I bought a new Kindle. When I tried to read some PDF files on Kindle, I found that the font size was too small to read. If you need to read PDF files on some small size devices like 4-inch smartphones or 6-inch e-book readers, you can optimize these PDF files for these gadgets with k2pdfopt. k2pdfopt is a command-line utility to optimize PDF/...
「點我閱讀更多」

Unix is Friend - Getting Help

Unix is like carpenters’ toolkits; you need to learn them before you really enjoy them. Self-help learning is rewarding and amusing, which also applies to the learning of Unix. Basically, there are three levels of sources to learn Unix: Books about Unix (or Linux). Online webpages, blogs, forums or other web resources System manuals. ...
「點我閱讀更多」