Skip to content

Instantly share code, notes, and snippets.

View vovanvu's full-sized avatar
🎯
Focusing

Vu Vo vovanvu

🎯
Focusing
  • Ho Chi Minh City
View GitHub Profile
@tungvn
tungvn / regex-vietnamese-phone-number-updated-2018.js
Last active June 26, 2024 09:54
Vietnamese phone number Regex validation
/*
Before Septemper 15 2018, Vietnam has phone number start with 09*, 01(2|6|8|9).
After that, the phone number can start with 03, 05, 07 or 08.
So this function provide a way to validate the input number is a Vietnamese phone number
*/
function isVietnamesePhoneNumber(number) {
return /(03|05|07|08|09|01[2|6|8|9])+([0-9]{8})\b/.test(number);
}
Java based Configuration :
The official Spring documentation refers to configuring your beans using a Java class annotated with @Configuration
and containing @Bean methods as 'Java Configuration'. This allows you to be absolutely free of all XML in your
application (at least as far as Spring goes). This support was added in Spring 3.0, and has gotten more powerful.
Annotation based Configuration:
Starting from Spring 2.5 it became possible to configure the dependency injection using annotations.
So instead of using XML to describe a bean wiring, you can move the bean configuration into the component
class itself by using annotations on the relevant class, method, or field declaration.
@raymondchua
raymondchua / AstarSearchAlgo
Last active June 28, 2024 02:00
A Star Search Algorithm, Java Implementation
import java.util.PriorityQueue;
import java.util.HashSet;
import java.util.Set;
import java.util.List;
import java.util.Comparator;
import java.util.ArrayList;
import java.util.Collections;
public class AstarSearchAlgo{