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
$ErrorActionPreference = "Stop" | |
Set-ExecutionPolicy RemoteSigned | |
ECHO "Installing PsGet and PS plugins" | |
iex ((new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1")) | |
Install-Module pscx | |
Install-Module psake | |
ECHO "FINISHED - Installing PsGet and PS plugins - FINISHED" |
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="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<!-- pervious msbuild project cruft clipped this is just a .csproj--> | |
<ItemGroup> | |
<Content Include="..\OtherProject\libs\**\*.dll"> | |
<Link>libs\%(RecursiveDir)%(Filename)%(Extension)</Link> | |
<!-- copy after the build so i can have the dlls in a linked lib folder in the project bt in the root in bin --> | |
<CopyToOutputDirectory>Never</CopyToOutputDirectory> |
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 Xunit; | |
public class IgnoreUntilFactAttribute : FactAttribute | |
{ | |
public int Year { get; set; } | |
public int Month { get; set; } | |
public int Day { get; set; } | |
public override string Skip | |
{ |
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
void Main() | |
{ | |
new MyObject().Dispatch(new Bar()); | |
/* OUTPUT: | |
Easy more specific target | |
Hitting the Bar | |
Fooing it up | |
Easy 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
function Get-AzureEmulatorErrors | |
{ | |
$LocalApplicationDataPath = [Environment]::GetFolderPath([System.Environment+SpecialFolder]::LocalApplicationData) | |
$AzureResourceRoot = "$LocalApplicationDataPath\dftmp\Resources" | |
Write-Host "Local Azure Resource Root: $AzureResourceRoot" | |
pushd "$AzureResourceRoot" | |
$logs = (dir -Recurse *\directory\LoggingStorage\*.log) | |
$ErrorAndWarnLines = $logs | Select-String -pattern "\[ERROR\]|\[WARN \]" | |
$entries = $ErrorAndWarnLines | select LineNumber, ` | |
Line, ` |
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
Example usages: | |
public class MyControllerFixture : IUseFixture<ControllerFixtureInit> | |
{ | |
private readonly MyController _sut; | |
private ControllerTestContext _controllerTestContext; | |
private readonly IMyDependency _dependency; | |
public MyControllerFixture() | |
{ |
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 ConfigureContainer() | |
{ | |
var containerBuilder = new ContainerBuilder(); | |
var assembly = Assembly.GetExecutingAssembly(); | |
containerBuilder.RegisterControllers(assembly); | |
containerBuilder.RegisterType<Mediator>().As<IMediator>(); | |
containerBuilder.RegisterAssemblyTypes(typeof(CustomerService).Assembly) | |
.AsImplementedInterfaces();//Will regiter the |
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
void Main() | |
{ | |
var accounts = new Dictionary<string,string>{ | |
{"accountname", "accountkey"}, | |
}; | |
var latestLogsByAppName = GetLatestLogsByAppName(accounts); | |
latestLogsByAppName//.Where (l => !l.ApplicationName.Contains("WebRole") ) | |
//.Where(l => l.LastModified < DateTime.UtcNow.AddDays(-1)) | |
.OrderBy (l => l.LastModified) |
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
void Main() | |
{ | |
//turn response codes into enum values | |
var things = GetData().Select (x =>{ | |
var id = GetNumberFromStart(x); | |
var name = ConvertToVariable(x.Replace(id.ToString(),string.Empty)); | |
return string.Format("{0} = {1},",id,name); | |
} ); | |
things.Dump(); | |
} |
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
function Select-UniqueChildrenWithStringPattern { | |
param($path, $pattern) | |
Get-ChildItem $path -Recurse -exclude *.exe,*.dll,*.pdb,*.jpg,*.png,*.gif,*.mst,*.msi,*.msm,*.gitignore,*.idx,*.pack,*.suo,*.ico,*.nupkg,*.zip,*.7z | | |
Select-String -Pattern $pattern | | |
Where-Object { $_ -ne $null } | | |
Select-Object Path -Unique | |
} | |
function String-ReplaceRecursive { | |
param($path, $pattern, $replaceValue) |