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 class BackgroundServiceOnObservableSchedule : BackgroundService | |
{ | |
private static readonly ILogger Logger = Log.ForContext<BackgroundServiceOnObservableSchedule>(); | |
private readonly IObservable<Unit> workerSequence; | |
private IDisposable workerSubscription; | |
public BackgroundServiceOnObservableSchedule() | |
{ | |
workerSequence = Observable |
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
[Test] | |
public void EquivalentCollection() | |
{ | |
var c1 = new[] { 1, 2, 3 }; | |
var c2 = new[] { 1, 2, 3 }; | |
Assert.That(c1, Is.EquivalentTo(c2).Using<int, int>((first, second) => | |
{ | |
Assert.That(first, Is.EqualTo(second)); | |
return true; |
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
// Required nuget packages: | |
// - NLog | |
// - BenchmarkDotNet | |
namespace BenchmarkNlogTimeSources | |
{ | |
public class TimeSourceBenchmark | |
{ | |
private readonly TimeSource _fastLocalTimeSource = new FastLocalTimeSource(); | |
private readonly TimeSource _fastUtcTimeSource = new FastUtcTimeSource(); | |
private readonly TimeSource _accurateLocalTimeSource = new AccurateLocalTimeSource(); |
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
$scriptPath = $MyInvocation.MyCommand.Path | |
$scriptDir = Split-Path $scriptPath | |
Get-Module psake | Remove-Module | |
Import-Module ("C:\Dev\Tools\psake.4.6.0\tools\psake.psm1") | |
$envProperties = @{ | |
"starterParam1"="start param value" | |
"starterParam2"= |
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 static class Ex { | |
public static IObservable<T> TakeUntilIdleFor<T>(this IObservable<T> source, TimeSpan idleTime) | |
{ | |
return Observable.Create<T>(o => | |
{ | |
var published = source.Publish(); | |
var idle = published.Select(_ => Observable.Timer(idleTime)).Switch(); | |
return new CompositeDisposable(published.Connect(), published.TakeUntil(idle).Subscribe(o)); | |
}); | |
} |
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"?> | |
<Project ToolsVersion="4.0" DefaultTargets="TransformConfig" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<UsingTask TaskName="TransformXml" | |
AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll"/> | |
<Target Name="TransformConfig"> | |
<TransformXml Source="$(SourcePath)\Web.config" | |
Transform="$(SourcePath)\Web.$(Configuration).config" | |
Destination="Web.config"/> | |
</Target> |
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
// Configuring | |
// Open Query Properties (F4) for My Extensions | |
// 1. Additional References: add NLog package from nuget | |
// 2. Additional Namespace Imports: add NLog.Config & NLog | |
public static class NLogExtensions | |
{ | |
public static void LogToResults(string loggerName = "*", string minLevel="Trace") | |
{ | |
var nlogConfig = @" |
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
/** | |
* For more information on using the Spreadsheet API, see | |
* https://developers.google.com/apps-script/service_spreadsheet | |
*/ | |
function uploadTracksToTrello() { | |
// Security settings | |
// Requesting token: https://trello.com/1/authorize?key=your app key&name=softshake+upload&expiration=never&response_type=token&scope=read,write | |
ScriptProperties.setProperty("appKey", "your app key"); | |
ScriptProperties.setProperty("token", "your token"); |
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
// Code is throwing exception: | |
// FileHelpers.BadUsageException : This engine works with record of type Country and you use records of type Country | |
// at FileHelpers.FileHelperEngine`1.WriteStream(TextWriter writer, IEnumerable`1 records, Int32 maxRecords) in FileHelperEngine.cs: line 558 | |
// at FileHelpers.FileHelperEngine`1.WriteString(IEnumerable`1 records, Int32 maxRecords) in FileHelperEngine.cs: line 600 | |
// at FileHelpers.FileHelperEngine`1.WriteString(IEnumerable`1 records) in FileHelperEngine.cs: line 591 | |
// at FileHelpers.Tests.RunTimeClassesExtra.RuntimeClasses() in RunTimeClassExtra.cs: line 168 | |
[Test] | |
public void RuntimeClasses() | |
{ |
NewerOlder