快樂的小成就
Quite interesting idea. The article suggest us to enjoy every little small progress. It is ok to be confident, even the how small the achievements are.
21 May 2018
Small task,small win其實係一個好common嘅productivity skill。
反思「過早最佳化是萬惡的根源」
Early optimization is root of evil
is reasonable on performance optimization. If we put this idea into architecture and system design, it would bring some problems. Because other team mate will follow the pattern of the system. The bad design and pattern will be reproduced if we don’t fix it in early stage. Therefore, architecture and system design have to be well planned and design as soon as possible.
22 Dec 2018
關鍵點係喺成本最低嘅時候做optimization
- 你知道有需要又識做,做左先嘅成本係最低
- 你唔識做,就留返遲D時機適合先做,唔好花太多時間磨
JavaScript Type and Code Coverage Profiling
原來safari inspector 有 type 同 code coverage profiling
21 May 2018
Can re-read the JIT compilation infrastructure section.
Interesting history of CAPTCAH
- The text image is generated by machine from normal text.
- Distorting text and adding background
- There are audio version for blinds
- Background noise is added
- The second generation of Captcha ask user to recognizing image
- Easier than recognizing distorted text
- Mobile friendly
- More difficult question for machine
- new reCaptcha analysis browser history
- Fallback to image / text recognition if cannot determine
21 May 2018
CAPTCHA 同 ReCAPTCHA 可以防DOS同BOT
文中有仔細講ReCAPTCHA點auto detect係咪human,文章最尾仲有一set關於CAPTCHA 同 ReCAPTCHA嘅文。
有需要可以重讀。
以下無需重讀
混合型的 Javascript
Generate javascript code from server side. The use case in example is generating database connect function. It is a quite interesting idea, but I cannot come up with any use cases.
真正的「矽谷精神」是讓年輕人不需要賭身家,就有資源實現自己的技術和理想
金句:
- 新創公司就是要突破傳統,要選擇最激進的路。拿自己的錢出來,玩自己的公司,容易考慮太保守,失敗的機率就很大
- 矽谷的精髓不在這些新創的技術,而是這樣一個良好的生態圈。如果我們的新創公司,需要年輕人傾家蕩產,把所有的東西和人脈一次賭出去,做決策的時候一定綁手綁腳,無法做出正確的決定。
21 May 2018
我拿我自己的錢,或是跟學長這些親戚朋友拿的錢,出來開公司,承擔的壓力是難以想像。所以要做決策選擇的時候,因為種種這些考量,一定是走最保守的路,所以百分之百會失敗。知道一定會失敗的事情,幹嘛要出來做?
Don’t need to re-read
11 Ways to Invoke a Function
- What is
Reflect
?- https://www.keithcirkel.co.uk/metaprogramming-in-es6-part-2-reflect/
- A collection of js internal method.
- Easy to extend
- Better backward compatibility
- What is
require('vm').Script
- Node.js lib
21 May 2018
Don’t need to re-read
But need to study the concept of reflection
Runtime Coverage using Chrome DevTools
Can use code coverage as a indicator for network optimization. If the percentage of unused bytes in the code is high, it suggests that the end user is having to download a lot more than is necessary to run the app.
21 May 2018
Don’t need to re-read
Scalable Design: Beyond Responsive Design
vh
and vw
units make zoom function fail (as the view port does not change)
The article introduce a library to solve responsive font problem: https://github.com/julienetie/mimetic
Seems the requirement is to use rem
for fonts.
21 May 2018
This article explain why they have to build a scalable fonts and zoom detection library.
Don’t need to re-read
CSS Custom Properties - The Basics
CSS Custom value is variable in CSS. Use CSS selector to define scope. :root
means global.
Can use with calc()
Note: it is not support by most popular version of browsers.
Can use with JS: styles.getPropertyValue(property)
and styles.setProperty()
21 May 2018
Don’t need to re-read, unless need to know the feature of CSS custom properties.
Window, Window: Measuring Screen Sizes with JavaScript
- The viewport is the display area of the browser
- It does not include the URL bar and browser UI.
document.documentElement.clientWidth
not included scroll bar, butwindow.innerWidth
include.- So is height
- Better to take max of these two value.
- The screen is the current display the browser is in
- note that many devices can have more than one screen.
- Need to recalculate screen size when
resize
andorientationchange
fired
21 May 2018
Don’t need to re-read, unless need to implement screen size detection function