Skip to content

Instantly share code, notes, and snippets.

View ducmeit1's full-sized avatar
:octocat:
Simple is best! Always do every simple!

David Ho ducmeit1

:octocat:
Simple is best! Always do every simple!
View GitHub Profile
using System;
using System.Threading.Tasks;
using Customer.Domain.Commands;
using Customer.Domain.Dtos;
using Customer.Domain.Queries;
using MediatR;
using Microsoft.AspNetCore.Mvc;
namespace Customer.API.Controllers
{
"ConnectionStrings": {
"DefaultConnection": "Data Source=localhost;Initial Catalog=CustomerDB;User Id=sa;Password=Demo123456@;"
}
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build-env
WORKDIR /app
COPY . ./
RUN dotnet restore
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2
WORKDIR /app
COPY --from=build-env /app/Customer.API/out .
version: '2'
services:
customer-api:
container_name: customer-api
build:
context: .
dockerfile: Dockerfile
depends_on:
- mssql
package cmd
import (
"fmt"
"github.com/spf13/cobra"
"os"
)
var rootCmd = &cobra.Command{
Use: "zmp3",
package main
import "github.com/ducmeit1/zmp3/cmd"
func main() {
cmd.Execute()
}
package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
var downloadSongCmd = &cobra.Command{
Use: "song",
Short: "Download MP3 song from Zing MP3",
package pkg
import (
"github.com/ducmeit1/zmp3/pkg/common"
"github.com/ducmeit1/zmp3/pkg/zingmp3"
"github.com/mitchellh/go-homedir"
"github.com/spf13/viper"
"os"
"path"
)
package common
import (
"github.com/manifoldco/promptui"
"strconv"
)
func PromptString(name string) (string, error) {
prompt := promptui.Prompt{
Label: name,
func setNewConfig() error {
cfg, err := promptSetNewConfig()
if err != nil {
return err
}
err = pkg.WriteConfigFile(cfg)
if err != nil {
return err
}