Skip to content

Instantly share code, notes, and snippets.

View kyawzaymoore's full-sized avatar
:electron:

Kyaw Zay Moore kyawzaymoore

:electron:
View GitHub Profile
@kyawzaymoore
kyawzaymoore / ECR Docker build tag push command
Created May 8, 2022 09:26
ECR Docker build tag push command
$ ECR Login
aws ecr get-login-password --region ap-southeast-1 | docker login --username AWS --password-stdin {{Your_ECR_Url}}
# example
aws ecr get-login-password --region ap-southeast-1 | docker login --username AWS --password-stdin 084965179264.dkr.ecr.ap-southeast-1.amazonaws.com
# Docker Build
docker build -t helloworld:v1 .
#example
docker build -t {{image_name}}:{{version}} .
@kyawzaymoore
kyawzaymoore / dockerfile
Created May 8, 2022 09:19
dotnet docker file
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
WORKDIR /app
# Copy everything
COPY . ./
# Restore as distinct layers
RUN dotnet restore
# Build and publish a release
RUN dotnet publish -c Release -o out
@kyawzaymoore
kyawzaymoore / LinqBetweenTwoDates.cs
Last active October 1, 2021 09:35
Linq Between two dates
using System;
using System.Collections.Generic;
public class Program
{
public static void Main()
{
DateTime assignDateStart = DateTime.Now.AddDays(5).Date;
DateTime assignDateEnd = DateTime.Now.AddDays(6).Date;
@kyawzaymoore
kyawzaymoore / IsValidEmail.cs
Created June 16, 2021 16:40
Check Valid Email
public static bool IsValidEmail(string email)
{
if (string.IsNullOrWhiteSpace(email))
return false;
try
{
// Normalize the domain
email = Regex.Replace(email, @"(@)(.+)$", DomainMapper,
RegexOptions.None, TimeSpan.FromMilliseconds(200));