I hereby claim:
- I am sheastrickland on github.
- I am sheastrickland (https://keybase.io/sheastrickland) on keybase.
- I have a public key ASApvPSJ9wDH_OUFjH-fHuFNrpKzZupGlVjZ55vXEUmwhwo
To claim this, I am signing this object:
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
I hereby claim:
To claim this, I am signing this object:
<Target Name="AfterBuild"> | |
<Message Text="@(Content)" Importance="high" Condition="%(Content.Extension) == '.sql'" /> | |
<Error Condition="%(Content.Extension) == '.sql'" Text="Nothing should be marked as Content, check your scripts are marked as Embedded Resource" /> | |
</Target> |
Script EnableIpSecurityOverride | |
{ | |
#Allows override for system.webserver.security.ipSecurity in applicationHost.config | |
DependsOn = "[Script]PreviousStepGoesHere" | |
SetScript = { | |
$current = Get-WebConfiguration /system.webServer/security/ipSecurity -Metadata | select -ExpandProperty metadata | select -ExpandProperty effectiveOverrideMode | |
$expected = "Allow" | |
$incorrect = $current -ne $expected | |
if ($incorrect) { | |
try |
using System; | |
using System.Runtime.InteropServices; | |
namespace Things | |
{ | |
public static class LandLordExtensions | |
{ | |
public static LandLord<TWrapped> AsDisposable<TWrapped>(this TWrapped tenant) | |
{ | |
return new LandLord<TWrapped>(tenant); |
function Get-TargetResource | |
{ | |
[OutputType([Hashtable])] | |
param ( | |
[ValidateSet("Present", "Absent")] | |
[string]$Ensure = "Present", | |
[Parameter(Mandatory)] | |
[ValidateNotNullOrEmpty()] | |
[string]$Name, |
Lesson Learnt, Streaming Producer / Consumer issue using:
BlockingCollection<T>
and Parallel.ForEach(_blockingCollection.GetConsumingEnumerable
Beware default Partitioner algo, which is chunking and buffering.
The GetConsumingPartitioner
heading covers it, and also the first comment from Stephen Toub totally nails it. We implemented similar to what commenter Hernan pointed out.
Stephen Toub Blog
My absolute saviour, NoBuffering
in:
[Fact] | |
void Main() | |
{ | |
var cb = new ContainerBuilder(); | |
cb.RegisterModule(new LoggingModule<log4net.ILog>(log4net.LogManager.GetLogger)); | |
cb.RegisterModule(new LoggingModule<Serilog.ILogger>(Serilog.Log.ForContext)); | |
cb.RegisterType<HasLogProperty>(); | |
cb.RegisterType<HasLogCtor>(); | |
# Load IIS module: | |
Import-Module WebAdministration | |
# Set a name of the site we want to change | |
$webSiteName = $OctopusParameters['OctopusWebSiteName'] | |
# Get web site object | |
$webSite = Get-Item "IIS:\Sites\$webSiteName" | |
Write-Output "Setting IIS web site $webSiteName serverAutoStart to true" |
Package UrlRewrite | |
{ | |
#Install URL Rewrite module for IIS | |
DependsOn = "[WindowsFeaturesWebServer]windowsFeatures" | |
Ensure = "Present" | |
Name = "IIS URL Rewrite Module 2" | |
Path = "http://download.microsoft.com/download/6/7/D/67D80164-7DD0-48AF-86E3-DE7A182D6815/rewrite_2.0_rtw_x64.msi" | |
Arguments = "/quiet" |