My learning diary

Push vs Pull CDN

It was only recently that I realised that there was more than one way to update the content that your CDN hosts. Since, to the best of my knowledge, Cloudflare was the closest thing to a CDN, I thought all CDN would work like that. Couldn’t be more wrong. I like that Cloudflare is so hassle-free to set up. It caches my site upon request + nothing in cache. There is no need to push any content to Cloudflare by myself.

Continue reading "Push vs Pull CDN"

react-hook-form validations

Feeling a little abashed about leaving a bug unresolved for the day, but I want a break and keep the team posted. And I also want to share what I have learnt. However, if you know what’s the problem with my commit, please do not hesitate to reach out! Back to the main learning point I am trying to share: In the pull request above, look at the first screenshot. The first screenshot was supposed to depict a form field that has gone through the validation function despite being untouched.

Continue reading "react-hook-form validations"

Read Sheets in Java

If you need to programmatically read a Google spreadsheet in Java, the quickstart guide describes a class that does configuration, scoping and reading all in one. However, if you use Spring Boot, you would want to split it into configuration and service layers: // build.gradle ... dependencies { ... compile ('com.google.api-client:google-api-client') compile ('com.google.apis:google-api-services-sheets') ... } ... // Spring Boot // Your config layer should contain the Sheets bean: // Copied from: https://stackoverflow.

Continue reading "Read Sheets in Java"

Reuse Stories When Testing

My volunteering experience at an open source project led me to appreciate Storybook. Developing frontend components in isolation makes me happy. Unexpected behaviour is localised, and you are appropriately enticed to write your components better. By better, I meant modular. Modularity encourages simplicity (think SRP), and this makes code more reusable and self-documenting. There’s no greater joy than not having to explain your code. But wait, there’s more: If you think writing stories is exclusive to your Storybook instance and thus a pain to write, think again.

Continue reading "Reuse Stories When Testing"

react-hook-form

It’s been a while since I last had the chance to assess several libraries to solve parts of a problem. My most recent project required me to evaluate JavaScript libraries which make form management a breeze. The “me” in the past would have jumped at any first possibility, like how a chick imprints on the first living thing they see. Not anymore. My ex-company taught me to set up decision tables and make recommendations according to concrete criteria and their priorities.

Continue reading "react-hook-form"