# Set up AWS CLI
aws configure
# Create a Public ECR Repository
aws ecr-public create-repository --repository-name redis --region <region>
# Authenticate Docker to ECR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE IF EXISTS users; | |
CREATE TABLE "users" ( | |
"id" serial PRIMARY KEY, | |
"first_name" varchar(255) NOT NULL, | |
"last_name" varchar(255) NOT NULL, | |
"email" varchar(255) NOT NULL, | |
"password" varchar(255) NOT NULL, | |
"created_at" timestamp DEFAULT (now()) | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE authors_books; | |
DROP TABLE books; | |
DROP TABLE authors; | |
CREATE TABLe books ( | |
id SERIAL PRIMARY KEY , | |
isbn VARCHAR(20) NOT NULL UNIQUE, | |
name VARCHAR(100) NOT NULL | |
); |
Step 1: install ngrok
brew install --cask ngrok
Step 2: Register ngrok account, then find auth token in setup docs: https://dashboard.ngrok.com/get-started/setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"meta": { | |
"theme": "elegant" | |
}, | |
"basics": { | |
"name": "Anh Tran", | |
"label": "Backend Developer", | |
"image": "https://avatars0.githubusercontent.com/u/416209?s=460&u=38f220a2c9c658141804f881c334c594eb1642ac&v=4", | |
"summary": "I'm a motivated team player with good English communication skills seeking a challenging Back-end position in a fast-paced organization where critical thinking and creative thinking are valuable.", | |
"website": "https://thewriteratheart.com", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package common | |
/* | |
* @author Viet Tran <viettranx@gmail.com> | |
* @copyright 2019 Viet Tran <viettranx@gmail.com> | |
* @license Apache-2.0 | |
*/ | |
import ( | |
"database/sql/driver" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# always restart container if it stops. | |
# reference: https://docs.docker.com/config/containers/start-containers-automatically/ | |
docker update --restart always $(docker ps -q) | |
# check running containers | |
docker ps | |
# check all existed containers | |
docker ps -al |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. | |
var a = 1; | |
function doSomething() { | |
a = 2; | |
} | |
console.log(a); | |
A. 1 |