Posts by Year

2023

Resolve git SSL certificate problem on windows

less than 1 minute read

While trying to push my project to Azure DevOps on my corporate windows machine, I got this error message when I am trying to push my code - SSL certificate ...

Getting started with Spring and GraphQl

7 minute read

The most common way of creating APIs is using REST (Representational State Transfer), of which we make use of the http verbs (POST, GET, PUT, DELETE) to stat...

Why I choose gradle over maven

1 minute read

Ever since coming across gradle as the build tool for java while working in Zuhlke, I have never looked back to using Maven. The immediate difference is obvi...

Getting started with NestJS

6 minute read

NestJS is a nodejs framework for building backend applications, that is secure and scaleable. Following the SOLID principle, and having a modular architectur...

Installing MariaDB on MacOS with Homebrew

1 minute read

MariaDB is a community-driven fork of the then open sourced MySql which was acquired by Oracle, and it is created by the original developers of MySql, and is...

OpenID Connect login with Spring Boot

4 minute read

OpenID Connect (OIDC) is an identity authentication protocol, using the mechanism of OAuth2, to allow applications to delegate their login function to identi...

How to squash commits

2 minute read

Why do we need to squash commits Sometimes when we are working on a feature, we might forget to run all the tests before we commit, and we could get test fa...

How to create custom validation annotation

2 minute read

When we have an application that collects inputs from users, we usually need to have some validation checks to ensure user inputs are within what is expected...

How to exempt lombok generated code from Jacoco

1 minute read

Lombok makes life easier for java developers by generating the mundane code (e.g. getters and setters) automatically, but if you are running code coverage, y...

Integrate code quality review with SonarQube

3 minute read

In today’s environment, when we are having tons of dependencies in our application project, as developers we need to take care not just of the business logic...

How to test Spring Data repository

2 minute read

Usually we do not need to write tests for the functionalities provided by the framework, but we can do so when certain functionalities we use from the framew...

Deploying multi-container application to Docker

4 minute read

In my last post - Getting started Spring Boot Application, I demonstrated how to create a sample forum application with Spring Boot using MariaDB as the data...

Getting started Spring Boot Application

12 minute read

Frameworks have made developing backend applications much easier compared to doing everything manually. For example, we no longer need to deal with the http ...

Back to Top ↑

2022

Upgrade SpringDoc dependencies for Spring 3.0

less than 1 minute read

In my previous article on how to add Swagger on Spring with Kotlin, the examples were built on Spring 2. With the introduction of Spring 3, there are some up...

Git detect dubious ownership in repository

2 minute read

When working in the corporate environment, we usually have a designated user space for each authenticated user on our computer. For example, in Windows, if...

Fix for filename too long in Git for Windows

less than 1 minute read

If you are running git on windows, with a deeply nested folder structure in your code, you might get the error message - “Filename too long”. That is because...

Testing MatOptionHarness in MatSelectHarness

less than 1 minute read

Reminder to self: When trying to get the options in the MatSelectHarness in Angular Material, you need to simulate a click on the MatSelectHarness - await se...

How to pass data from angular to css

1 minute read

I am creating an angular template whereby I can create forms from a data file automatically, such as a json or yaml. For displaying on the monitor screen, ...

Observables Explained

1 minute read

We all know what is a function. It takes some or no inputs and produce just 1 output. function doSomething(input1, input2){ return input1 + input2; } Wh...

Java HashMap Explained

4 minute read

The implementation details of the java hashmap is a very common interview question for java developers, though I’m strongly against asking such question fo...

How to use router-store in NgRx

2 minute read

What is the purpose of the router-store in NgRx? As explained in my previous article on NgRx, the purpose of NgRx is to separate the data management part ...

Defining your own theme in Angular Material

6 minute read

Having your own theme in your web application is essential to make it look professional. Imagine using the default color themes provided from the framework y...

Simulating Rubik Cube Actions with Java

12 minute read

Let’s work on something fun today, simulating a rubik’s cube. This is the precursor to my next topic to provide the solution to solve rubik’s cube. Modell...

How to test NgRx

2 minute read

Ngrx is a framework for angular that helps to separate the backend logic from the frontend, making the code easier cleaner. To know more about how it works...

Java Arrays Lists & Streams Reference

less than 1 minute read

// Initialize Arrays Integer[] integerArray = {1, 2, 3, 4, 5}; System.out.println(Arrays.toString(integerArray)); // Initialize List List<Integer> int...

NgRx Explained

8 minute read

Often times, when our angular applications grows, our code become quite messy to follow. We have multiple components, referencing a myriad number of servic...

How to test HttpClient in Angular

1 minute read

This is a simple method to call http using the HttpClientModule. getBooks(): Observable<Book[]>{ return this.http.get<Book[]>(BooksService.b...

How to use environment variable in Angular

1 minute read

Angular automatically creates 2 files - environment.ts and environment.prod.ts, in the environment folder when the project is first created. Both of them has...

How to do navigation in Angular

1 minute read

When you create a new angular app using ng new <application name>, the first question you get asked is ? Would you like to add Angular routing? (y/N). ...

Escaping the {{ }} in markdown for Jekyll

less than 1 minute read

I just realised that in one of my previous posts, the code I had for ${{ secrets.GH_TOKEN }} became just $. After a bit of research, I found out that it is ...

Using Semantic Release with Github Actions

3 minute read

The purpose of having Semantic-Release is so that we can release workable versions to our users frequently. So we shouldn’t be releasing non-workable version...

How to rename a remote branch in Git

less than 1 minute read

While working in a team, there are usually some naming conventions for the branches, like prefixing the branch with “feat/” for feature branch, or “fix/” for...

Getting started with Angular

9 minute read

What is Angular? In my opinion, Angular is the platform and framework for building your own customized html tags. While html has a fixed set of tags (e.g. &...

Containerizing with Docker explained

4 minute read

After you have created your application, it is always nice to have it containerized so that it can be readily used whenever you need it, without having to cl...

Algrebra, XOR, and its applications

2 minute read

Recently, I chanced upon this neat solution to a rather simple interview question, that exploits the special property of the binary XOR operation. It leads m...

Homebrew explained

5 minute read

What is Homebrew Homebrew is the missing package manager for macOS. What does that mean? In layman terms, it is like the Appstore, but for opensource softwa...

How to get external configuration in Spring

1 minute read

Sometimes we have some configuration data that we need in our code, that can be changed periodically, like mail server information, proxy server, etc. We can...

Enable accented characters on Mac OSX

less than 1 minute read

I used to be able to type accented characters on Mac OSX by long pressing the character I want to accent. But this functionality was somehow gone after an OS...

Adding Swagger to Kotlin Spring

1 minute read

Spring makes it extremely easy to create REST api, but as a consumer of APIs, we need documentations to know what is available and how to use it. That’s wher...

Upgrade Angular project from v11 to v13

less than 1 minute read

I’m slow…. It’s been a while since I last touched my Angular repository, that was created in early 2020, running on Angular 11. When I just went back to it y...

How to create generic JPA repository

1 minute read

Generics makes it possible to reuse code, which is great. But when it needs to apply on a JPA repository, it can get messy. As any small mistake is going to ...

Dependency Injection

3 minute read

Dependency Injection is like a job matching service for variables in your code. You specify the job description, in the form of interface, or in a less ideal...

The SOLID Principle in internet lingo

1 minute read

The SOLID principle is one of the most common acronym to describe the principles of object-oriented programming, which is subset of the many principles intro...

Back to Top ↑

2021

No tests found when running Cucumber JUnit

less than 1 minute read

Sometimes it can be pretty frustrating when the error message doesn’t show the root cause of the problem, usually that’s because it is not straightforward wh...

Basic guide to Semantic Release

7 minute read

When it comes to releasing software projects to production, versioning can be a topic that is easily overlooked as something that is too trivial and done man...

Cucumber testing on Spring Boot

2 minute read

Cucumber is a great way for users to automate acceptance testing, as it allows using somewhat natural language to define the test cases. With a little learni...

Stashing local configurations

1 minute read

In the project I’m working on, there are some local configurations (typically database connection strings) that I do not push to the git remote. This causes ...

Mutation testing with Pitest

1 minute read

Beyond just ensuring every line of code is executed with Code Coverage test, there is another way to ensure the test cases written are adequate, and that is ...

Code coverage for Java - Jacoco

2 minute read

Testing is a very important process in software engineering to ensure the quality of the code we write, and we can ensure testing is adequate by doing code c...

Using Lombok in Intelli J

1 minute read

Lombok is a pretty neat tool when coding in Java, allowing me to save time writing repetitive codes. But when you are installing it in a new project or in a ...

Machine Learning in a nutshell

2 minute read

A simple explanation of the use of machine learning, is the prediction of result based on past data. In order to do that, you’ll need a lot of data, because ...

My ingredient list for good code

less than 1 minute read

My ingredient list for good code Ample documentation Automated testing with good coverage Clean, legible and side-effect free Second opinion (code ...

How to publish Angular component to NPM

1 minute read

There are some requirements that a module needs to fullfil before it can be published to npm. For example, you’ll need a main field in your package.json http...

Adding a catalog of Maven Archetypes in Intelli J

less than 1 minute read

Archetypes make it easy to scaffold a project, but remembering all the archetypes available and using the command line to activate it can be challenging to r...

A little primer to start off with Angular

5 minute read

Angular is a javascript framework for creating websites. Instead of using regular html tags (like div, span, form, input), Angular lets you define new html t...

How to remove accidental commits in git

1 minute read

This happens when I forgot to create the .gitignore file, resulting in the target folder containing the class files got uploaded to git. Solution git rm -r...

The fatal refusing to merge unrelated history

less than 1 minute read

It occurs to me a few times when I have written my code, then I want to create a git repository to store it. Then I selected the option to create a README fi...

Code coverage in Angular

1 minute read

Unit testing has been the quintessential way to ensure whatever code we add to our program doesn’t break anything, but how do we tell if the unit tests are a...

Back to Top ↑

2020

Back to Top ↑