- Install-Package netfx-Guard
- Install-Package NSubstitute (or Moq)
- Install-Package xUnit
- Install-Package AutoFixture
- Install-Package AutoMapper
- Install-Package SimpleInjector
- Install-Package FluentMigrator
- Install-Package GitVersion
This file contains hidden or 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
$script:IsWindows = (-not (Get-Variable -Name IsWindows -ErrorAction Ignore)) -or $IsWindows | |
$script:IsLinux = (Get-Variable -Name IsLinux -ErrorAction Ignore) -and $IsLinux | |
$script:IsOSX = (Get-Variable -Name IsOSX -ErrorAction Ignore) -and $IsOSX | |
$script:IsCoreCLR = (Get-Variable -Name IsCoreCLR -ErrorAction Ignore) -and $IsCoreCLR | |
$script:IsNanoServer = $null -ne ('System.Runtime.Loader.AssemblyLoadContext' -as [Type]) | |
$script:IsInbox = $PSHOME.EndsWith('\WindowsPowerShell\v1.0', [System.StringComparison]::OrdinalIgnoreCase) |
This file contains hidden or 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
/*********************************************************** | |
TSQL to do a quick and dirty look at single-use plans in | |
the execution plan cache of a SQL Server. | |
************************************************************/ | |
/* Size of single use adhoc plans in execution plan cache */ | |
SELECT | |
objtype, | |
cacheobjtype, | |
SUM(size_in_bytes)/1024./1024. as [MB] |
This file contains hidden or 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 a($f) {& $f} | |
function main() { | |
$f = {write-host 'success'} | |
a {& $f} # stack-overflow | |
a {& $f}.getnewclosure() # okay | |
} | |
[void] (main) |
This file contains hidden or 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
set-strictmode -version 'latest' | |
$erroractionpreference = 'stop' | |
function main() { | |
$a = 'foo' | |
$f = { | |
$g = {$a}.getnewclosure() | |
& $g # "variable '$a' cannot be retrieved because it has not been set." | |
}.getnewclosure() | |
& $f |
This file contains hidden or 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 Org.BouncyCastle.Crypto; | |
using Org.BouncyCastle.Crypto.Parameters; | |
using Org.BouncyCastle.OpenSsl; | |
using Org.BouncyCastle.Security; | |
using System; | |
using System.IO; | |
using System.Security.Cryptography; | |
namespace MyProject.Data.Encryption | |
{ |
This file contains hidden or 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
<Project> | |
<Target Name="NpmInstall" Condition="Exists('package.json')"> | |
<Exec Command="npm install" /> | |
</Target> | |
<Target Name="NpmCiTest" Condition="Exists('package.json')"> | |
<Exec Command="npm run ci-test" /> | |
<ItemGroup Condition="'$(TestResultsOutputPath)' != ''"> | |
<TestResultFiles Include="obj\karma-testresults\**" /> |
This file contains hidden or 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 FSharp.Data; | |
using FSharp.Data.Runtime; | |
using FSharp.Data.Runtime.StructuralTypes; | |
using Microsoft.FSharp.Collections; | |
using System; | |
using System.Globalization; | |
using System.Linq; | |
class Program | |
{ |
This file contains hidden or 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.CodeDom.Compiler; | |
using System.Reflection; | |
using System.Threading.Tasks; | |
/* | |
To execute, run | |
string code = "your code here"; | |
if (!code.Contains("return")) code = "return " + code; | |
code = code.Trim().TrimEnd(';') + ";"; |