Skip to content

Instantly share code, notes, and snippets.

View thangchung's full-sized avatar
:electron:
Sharing is caring

Thang Chung thangchung

:electron:
Sharing is caring
View GitHub Profile
@thangchung
thangchung / dotnetlayout.md
Created March 21, 2017 10:56 — forked from davidfowl/dotnetlayout.md
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@thangchung
thangchung / Post.cs
Created October 16, 2017 08:38
Applying clean architecture on web application with modular patterns
using BlogCore.Core;
using BlogCore.Core.Extensions;
using BlogCore.Core.Helpers;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
namespace BlogCore.PostContext.Core.Domain
{
@thangchung
thangchung / BlogEfRepository.cs
Last active October 16, 2017 08:42
Applying clean architecture on web application with modular patterns
public class BlogEfRepository<TEntity> : EfRepository<PostDbContext, TEntity>
where TEntity : EntityBase
{
public BlogEfRepository(PostDbContext dbContext)
: base(dbContext)
{
}
}
@thangchung
thangchung / PostDbContext.cs
Last active October 16, 2017 08:44
Applying clean architecture on web application with modular patterns
using BlogCore.Infrastructure.EfCore;
using BlogCore.PostContext.Core.Domain;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
namespace BlogCore.PostContext.Infrastructure
{
public class PostDbContext : DbContext
{
@thangchung
thangchung / ListOutPostByBlogInteractor.cs
Created October 16, 2017 08:46
Applying clean architecture on web application with modular patterns
using BlogCore.Core;
using BlogCore.Infrastructure.EfCore;
using BlogCore.Infrastructure.UseCase;
using BlogCore.PostContext.Core.Domain;
using BlogCore.PostContext.Infrastructure;
using Microsoft.Extensions.Options;
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Reactive.Linq;
@thangchung
thangchung / ListOutPostByBlogPresenter.cs
Created October 16, 2017 08:50
Applying clean architecture on web application with modular patterns
using BlogCore.AccessControlContext.Core.Domain;
using BlogCore.Core;
using BlogCore.PostContext.UseCases.ListOutPostByBlog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using System.Threading.Tasks;
namespace BlogCore.Api.Features.Posts.ListOutPostByBlog
using BlogCore.Api.Features.Posts.ListOutPostByBlog;
using BlogCore.Core;
using BlogCore.Core.Helpers;
using BlogCore.PostContext.Core.Domain;
using BlogCore.PostContext.UseCases.ListOutPostByBlog;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Threading.Tasks;
@thangchung
thangchung / PostUseCaseModule.cs
Created October 16, 2017 09:56
Applying clean architecture on web application with modular patterns
using Autofac;
using BlogCore.Api.Features.Posts.ListOutPostByBlog;
using BlogCore.Infrastructure.EfCore;
using BlogCore.PostContext.Infrastructure;
using BlogCore.PostContext.UseCases.ListOutPostByBlog;
namespace BlogCore.PostContext
{
public class PostUseCaseModule : Module
{
@thangchung
thangchung / remove-docker-containers.md
Created April 26, 2018 04:58 — forked from ngpestelos/remove-docker-containers.md
How to remove unused Docker containers and images
  1. Delete all containers

     $ docker ps -q -a | xargs docker rm
    

-q prints only the container IDs -a prints all containers

Notice that it uses xargs to issue a remove container command for each container ID

  1. Delete all untagged images
@thangchung
thangchung / nginx-ingress.yaml
Last active August 27, 2018 16:54
The old nginx-ingress configuration for coolstore project
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
name: coolstore-ingress
namespace: default
spec:
backend:
serviceName: spa-service