This file contains 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
WEBVTT | |
00:01.000 --> 00:04.000 | |
Description of why drinking liquid nitrogen is bad. | |
00:05.000 --> 00:09.000 | |
- It will perforate your stomach. | |
- You could die. |
This file contains 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
WEBVTT | |
00:01.000 --> 00:04.000 | |
Never drink liquid nitrogen. | |
00:05.000 --> 00:09.000 | |
- It will perforate your stomach. | |
- You could die. |
This file contains 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
public interface IEventBroker | |
{ | |
Task Publish(object e); | |
} | |
internal class EventBroker : IEventBroker | |
{ | |
private readonly IList<DomainEventHandler> _handlers; | |
public EventBroker(IList<DomainEventHandler> subscribers) | |
{ |
This file contains 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
// credit: https://stackoverflow.com/questions/35714547/c-sharp-console-application-run-for-loop-while-not-disturbing-rest-of-exec | |
class Program { | |
static void Main(string[] args){ | |
var tokenSource = new CancellationTokenSource(); | |
var cancellationToken = tokenSource.Token; | |
var backgroundTask = Task.Run(() => | |
{ | |
Console.WriteLine("Background task started"); | |
long count = 0; |
This file contains 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
using System; | |
using System.Collections.Generic; | |
namespace Fluent | |
{ | |
public class OrderBuilder | |
{ | |
private readonly Order _order; | |
private OrderLine _currentLine; | |
private int _currentLineNumber; |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<packages> | |
<package id="Autofac" version="4.2.1" targetFramework="net46" /> | |
<package id="Autofac.Mvc5" version="4.0.1" targetFramework="net46" /> | |
<package id="Autofac.Mvc5.Owin" version="4.0.1" targetFramework="net46" /> | |
<package id="Autofac.Owin" version="4.0.0" targetFramework="net46" /> | |
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net46" /> | |
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net46" /> | |
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net46" /> | |
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net46" /> |
This file contains 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
private static void ConfigureSwagger(HttpConfiguration config) | |
{ | |
config.EnableSwagger( | |
c => { | |
c.SingleApiVersion("all", "Some API"); | |
c.IncludeXmlComments(string.Format(@"{0}\bin\Your.Assembly.XmlComments.xml", | |
AppDomain.CurrentDomain.BaseDirectory)); | |
c.RootUrl(req => | |
req.RequestUri.GetLeftPart(UriPartial.Authority) + | |
req.GetRequestContext().VirtualPathRoot.TrimEnd('/')); |
This file contains 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
<Target Name="AfterBuild"> | |
<CallTarget Condition="$(IsAgentBuild)=='true'" Targets="TransformConfig" /> | |
<CallTarget Condition="!($(IsAgentBuild)=='true')" Targets="PreviewTransformedConfig" /> | |
</Target> | |
<Target Name="TransformConfig"> | |
<ItemGroup> | |
<DeleteAfterBuild Include="$(WebProjectOutputDir)\web.*.config"/> | |
</ItemGroup> | |
<TransformXml Source="web.config" Transform="$(ProjectConfigTransformFileName)" Destination="$(WebProjectOutputDir)\web.config" /> |
This file contains 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
param( | |
$nugetPath, # Specified in your build definition. Ex: \\someunc\somewhere\nuget.exe | |
$slnPath # Specified in your build definition. Ex: $(TF_BUILD_SOURCESDIRECTORY)\MySolutionName.sln | |
) | |
$exp = $nugetPath + " restore " + $slnPath | |
Invoke-Expression $exp |
This file contains 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
param( | |
$SourceFile, | |
$TokenStart = '__', | |
$TokenEnd = '__' | |
) | |
function Get-EnvironmentVariables | |
{ | |
$env = @{} |