1. Keep learning forward

    To be updated ...
  2. #TIL : String Format Unicode params

    unicode_thing = u"Xin chào mọi người"
    a = '{}'.format(unicode_thing)

    will cause the error UnicodeEncodeError: 'ascii' codec can't encode character u'\xe0' in position 6: ordinal not in range(128)

    The solution is add u prefix the pattern (it means using unicode pattern) :

    unicode_thing = u"Xin chào mọi người"
    a = u'{}'.format(unicode_thing)
  3. #TIL : Index is useless when use function on indexed field

    Reality, if using function on indexed field, you will broke indexing by accident.
    Eg:

    WHERE MONTH(`date`) = 11 AND YEAR(`date`) = 2015

    Solution is transform the query to comparison query, like this :

    WHERE `date` >= '2015-11-01' AND `date` < '2015-12-01'
  4. #TIL : Shortcut keyboard improve productivity

    • Open the preference of any Application by Cmd + ,.
    • Press Cmd + ~ to go previous App when switching App on Cmd + Tab
    • Copy screenshot to clipboard by Cmd + Ctl + Shift + 3
    • Press Option when click to notification center is putting it on “Do no disturb” mode.
  5. #TIL : Debugging Chrome extension

    • To open directly the Console Dev Tools, press Cmd + Opt + J in MacOSX.
    • To debug easily the any files of extension, open the url chrome-extension://<extension-id>/<file-name> in address bar.