Skip to content

Instantly share code, notes, and snippets.

View japananh's full-sized avatar
🍀
My goal is to reach my highest potential

Anh Tran japananh

🍀
My goal is to reach my highest potential
View GitHub Profile
@japananh
japananh / bỏ dấu tiếng việt golang
Created October 31, 2022 06:56 — forked from vanleantking/bỏ dấu tiếng việt golang
bỏ dấu tiếng việt golang
func BoDau(province string) string {
var Regexp_A = `à|á|ạ|ã|ả|ă|ắ|ằ|ẳ|ẵ|ặ|â|ấ|ầ|ẩ|ẫ|ậ`
var Regexp_E = `è|ẻ|ẽ|é|ẹ|ê|ề|ể|ễ|ế|ệ`
var Regexp_I = `ì|ỉ|ĩ|í|ị`
var Regexp_U = `ù|ủ|ũ|ú|ụ|ư|ừ|ử|ữ|ứ|ự`
var Regexp_Y = `ỳ|ỷ|ỹ|ý|ỵ`
var Regexp_O = `ò|ỏ|õ|ó|ọ|ô|ồ|ổ|ỗ|ố|ộ|ơ|ờ|ở|ỡ|ớ|ợ`
var Regexp_D = `Đ|đ`
reg_a := regexp.MustCompile(Regexp_A)
reg_e := regexp.MustCompile(Regexp_E)
@japananh
japananh / 200lab_golang_training_food_delivery.sql
Created September 20, 2021 13:24 — forked from viettranx/200lab_golang_training_food_delivery.sql
This is an example DB schema for Food Delivery training project
DROP TABLE IF EXISTS `carts`;
CREATE TABLE `carts` (
`user_id` int NOT NULL,
`food_id` int NOT NULL,
`quantity` int NOT NULL,
`status` int NOT NULL DEFAULT '1',
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`user_id`,`food_id`),