Skip to content

Instantly share code, notes, and snippets.

Valeriu Caraulean vcaraulean

Block or report user

Report or block vcaraulean

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
vcaraulean / NunitEquivalentCollectionTests.cs
Created Sep 12, 2018
Nunit 3.10.1 and NUnit 3.9.0 have different results in asserting this scenario
View NunitEquivalentCollectionTests.cs
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;
vcaraulean / Program.cs
Last active Jul 11, 2016
Benchmarking NLog's TimeSource implementations
View Program.cs
// 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();
vcaraulean / starter.ps1
Created Jun 10, 2016
psake - passing in parameters
View starter.ps1
$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"
vcaraulean / rx.cs
Created Sep 18, 2015
View rx.cs
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));
View config_transform.msbuild
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="TransformConfig" xmlns="">
<UsingTask TaskName="TransformXml"
<Target Name="TransformConfig">
<TransformXml Source="$(SourcePath)\Web.config"
vcaraulean / MyExtensions.cs
Last active Feb 5, 2016
Capture logging in LINQPad
View MyExtensions.cs
// 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 = @"
vcaraulean / Spreadsheet-to-Trello
Last active Jun 26, 2017
This is a Google Apps Script Engine that imports data from Google Spreadsheet to Trello. This script was used to import SoftShake'13 conference submissions from the spreadsheets to Trello. So, it's highly specific for SoftShake and it's one-off thing. Still, may be used as a base for more complex things. The conference had 2 spreadsheets, for Fr…
View Spreadsheet-to-Trello
* For more information on using the Spreadsheet API, see
function uploadTracksToTrello() {
// Security settings
// Requesting token: app key&name=softshake+upload&expiration=never&response_type=token&scope=read,write
ScriptProperties.setProperty("appKey", "your app key");
ScriptProperties.setProperty("token", "your token");
vcaraulean / TestFixture.cs
Created May 9, 2011
Test case for BadUsageException
View TestFixture.cs
// 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
public void RuntimeClasses()
vcaraulean / FieldNullValueAttribute.cs
Created May 6, 2011
Path for for handling empty (not provided) Guid values
View FieldNullValueAttribute.cs
// Replace constructor in line 53 with this one
public FieldNullValueAttribute(Type type, string nullValue)
: this(TypeDescriptor.GetConverter(type).ConvertFromString(nullValue))
{ }
You can’t perform that action at this time.