Skip to content

Instantly share code, notes, and snippets.

View litichevskiydv's full-sized avatar
☄️
Working hard

Litichevskiy Dmitriy litichevskiydv

☄️
Working hard
View GitHub Profile
public interface IExpensesCalculator
{
double Calculate(PrintOrder order);
}
public class PrintOrder
{
public EditionType EditionType { get; }
public CoverType CoverType { get; }
public PageSize PageSize { get; }
public PaperType PaperType { get; }
public Illustration[] Illustrations { get; }
public int FontSize { get; }
public int CopiesCount { get; }
#!/usr/bin/env bash
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
TOOLS_DIR=$SCRIPT_DIR/tools
CLI_DIR=$SCRIPT_DIR/cli
DOTNET_PATH=$CLI_DIR/dotnet
TEMP_DIR=$SCRIPT_DIR/tmp
TEMP_PROJECT=$TEMP_DIR/tmp.csproj
SCRIPT="build.cake"
[CmdletBinding()]
Param(
[string]$Script = "build.cake",
[string]$Target = "Default",
[ValidateSet("Release", "Debug")]
[string]$Configuration = "Release",
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
[string]$Verbosity = "Verbose",
[Alias("DryRun","Noop")]
[switch]$WhatIf,
// Target - The task you want to start. Runs the Default task if not specified.
var target = Argument("Target", "Default");
// Configuration - The build configuration (Debug/Release) to use.
var configuration =
HasArgument("Configuration")
? Argument<string>("Configuration")
: EnvironmentVariable("Configuration") ?? "Release";
// The build number to use in the version number of the built NuGet packages.
// Target - The task you want to start. Runs the Default task if not specified.
var target = Argument("Target", "Default");
// Configuration - The build configuration (Debug/Release) to use.
var configuration =
HasArgument("Configuration")
? Argument<string>("Configuration")
: EnvironmentVariable("Configuration") ?? "Release";
// The build number to use in the version number of the built NuGet packages.
@litichevskiydv
litichevskiydv / BuildAndPack.cake
Last active October 7, 2017 13:00
Cake script for building solution and NuGet packages creation
// Target - The task you want to start. Runs the Default task if not specified.
var target = Argument("Target", "Default");
// Configuration - The build configuration (Debug/Release) to use.
var configuration =
HasArgument("Configuration")
? Argument<string>("Configuration")
: EnvironmentVariable("Configuration") ?? "Release";
// The build number to use in the version number of the built NuGet packages.
[HttpPost]
public async Task Post([FromBody] DockerRequest request)
{
var body = @"
{
""request"": {
""branch"":""<ImageValidatorBranch>"",
""config"": {
""env"": {
""IMAGE_TAG"": ""<ImageTag>""
language: csharp
env:
- IMAGE_TAG=latest
services:
- docker
mono: none
dotnet: 1.0.4
dist: trusty
branches:
only:
namespace ImageValidator
{
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading;
using Dapper;
using JetBrains.Annotations;
using Microsoft.Extensions.Configuration;