Featured

Problem with time and timezone

You may think to yourself, Oh I understand timezone, I fly a lot and timezone is easy to me. Try to think deeper and answer the question that no one can answer: What is time Time is not a thing, it is actually an imaginary system we create to keep track things and collaborate. In…

Featured

Daylight Saving and how computer handles it

When working with date, time and timezone, things often seems easy at the beginning. However, the truth is, it is a lot more complicated. Daylight saving is an interesting topic and even more interesting when you have to design software with this in mind. Take Australia as an example. According to Business Victoria: The 2017-2018…

Featured

Functional Programming

When building any web apps, mobile apps or general software, you will write a lot of functions. Side effects Functions should be pure and simple, with no side effects. Which means a functions should only work with its parameters and modify nothing outside, not even the parameters. The first example is a function with no…

2024 OVO 21th July lowest Electricity rate for new customer. Changing your plan is super easy! Use the refer link to get $120 credit

After a bit of research. OVO is the lowest rate electricity retailer at 2024 July for new customer making the switch. Haven’t see any lower rate than 23c/kw. And switching is super easy. They even have a plan to let you use electricity free for 3 hours every day! Use the refer link to get…

SOILD Principles

Single-Responsibility Principle A class should have one and only one reason to change, meaning that a class should have only one job. Open-Closed Principle Objects or entities should be open for extension but closed for modification. Liskov Substitution Principle Let q(x) be a property provable about objects of x of type T. Then q(y) should…

React Hooks – More than just syntax sugar?

React hooks decouples state management from class based react component and allow it to be consumed in functional way. However the overwhelming limitation of “Don’t call Hooks inside loops, conditions, or nested functions” brings a lot of headache to developers.   There are 5 most useful hooks. const [state, setState] = useState(initialState); useState is a…

Flux, Observer, Factory pattern and Redux

Redux is an implementation of Flux pattern which aims to solve the state management issue in large scale complex react app.   Flux pattern at its core is pipe line: An action dispatches an event. Event is send at data store and triggers an mutation of the data. Then the data mutation triggers the view…

Super useful Arrow Function in React

To avoid the annoying function binding in react components classes constructor(props) {  super(props);  this.myFuncInClass = this.myFuncInClass.bind(this); } Install the following plugin via npm and enable it babel-plugin-transform-class-properties Then you can write arrow function and void the binding. myFuncInClass = () => { // code } Be aware about the difference between Arrow function expression and Traditional function…