menu

Chinese Web Fonts

date_range 07/06/2017 11:07

Recently I had to design a multilingual website which involves Chinese. Unlike English (or any Latin script based language), each Chinese character has its own meaning, which means a large character set is required. This causes Chinese fonts to be about 3-7 MB per font weight, which would greatly increase the load time. Therefore while Latin script languages have a plethora of web fonts that can be applied, the selection of Chinese fonts is rather limited.

Jekyll Pagination in Other Pages

date_range 27/05/2017 22:44

There will often be use cases where you decide to use your root directory to serve a static home page (e.g. app landing page) and then a different page to list your blog posts. Jekyll’s pagination plugin applies pagination to your root index.html by default and will spit warnings if you enabled it but no index.html file is found.

Android Multilanguage Support for Local HTML

date_range 22/05/2017 15:17

If your application only supports Android Lollipop and above, then the method is relatively straightforward. Just place your HTML files in res/raw, categorised with language identifiers.

Embedding Python Snippets in Bash Scripts

date_range 21/05/2017 00:27

In my opinion, certain operations are better performed using certain scripting languages. Taking Python and Bash as context, file deletion, moving or processing (zip, tar etc.) is easily achieved using Bash. Not to say that it cannot be done using Python, but to do so requires quite some documentation lookup and usage of various modules. On the other hand, string operations such as splitting, joining and formatting can be accomplished more naturally (and easily? String slicing in Bash is rather confusing IMHO) in Python.

Python List Call by Reference

date_range 17/04/2017 22:08

I was writing a class in Python and there was a class variable that was supposed to be a copy of a global predefined list.