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
int[] numbers = {12, 37, 5, 42, 8, 3}; | |
var evenNumbers = numbers.Where(n => n%2 == 0); | |
var oddNumbers = numbers.Where(n => n%2 != 0); |
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
//You need to add this line in CreateKernel method of NinjectWebCommon.cs | |
//GlobalConfiguration.Configuration.DependencyResolver = new NinjectDependencyResolver(kernel); | |
//Entire class: | |
using System.Web.Http; | |
using gazprom.uk.Services; | |
using Ninject.Web.WebApi; |
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
SyntaxNode syntax = SyntaxFactory.UsingStatement(SyntaxFactory.Block() /* the code inside the using block */) | |
.WithDeclaration(SyntaxFactory | |
.VariableDeclaration(SyntaxFactory.IdentifierName("var")) | |
.WithVariables(SyntaxFactory.SingletonSeparatedList(SyntaxFactory | |
.VariableDeclarator(SyntaxFactory.Identifier(variableName)) | |
.WithInitializer(SyntaxFactory.EqualsValueClause(SyntaxFactory | |
.ObjectCreationExpression(SyntaxFactory.IdentifierName(typeName)) | |
.WithArgumentList(SyntaxFactory.ArgumentList())))))); |
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
$primaryColor: #eeffcc; | |
body { | |
$primaryColor: #ccc !global; | |
background: $primaryColor; | |
} | |
p { | |
color: $primaryColor; | |
} |
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
//Installing a package that also updates package.json | |
//gulp-less example, navigate to project folder to where package.json is located | |
npm install gulp-less --save |
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
DECLARE @Date1 DATE, @Date2 DATE | |
SET @Date1 = '20101130' | |
SET @Date2 = '20160301' | |
DECLARE @DateSpine TABLE ( | |
date DATE | |
) | |
INSERT INTO @DateSpine | |
SELECT DATEADD(DAY,number+1,@Date1) [Date] |
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 System.Threading; | |
using System.Threading.Tasks; | |
using FakeItEasy.Examples; | |
using Moq.Examples; | |
using NSubstitute.Examples; | |
using RhinoMocks.Examples; | |
namespace MockComparisonExamples | |
{ |
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
<NotepadPlus> | |
<InternalCommands /> | |
<Macros> | |
<Macro name="Trim Trailing and save" Ctrl="no" Alt="yes" Shift="yes" Key="83"> | |
<Action type="2" message="0" wParam="42024" lParam="0" sParam="" /> | |
<Action type="2" message="0" wParam="41006" lParam="0" sParam="" /> | |
</Macro> | |
<Macro name="EndLineCommas" Ctrl="yes" Alt="no" Shift="yes" Key="188"> | |
<Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> | |
<Action type="3" message="1601" wParam="0" lParam="0" sParam="$" /> |
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
Get-ChildItem "C:\Users\matt\Desktop\CShell Install" |foreach {"<Component Id=`"" + $_.name + "`" Guid=`"" +[guid]::NewGuid() + "`">`r`n<File Id=`"" + $_.name + "`" Source=`"`$(var.CShell.TargetDir)\" + $_.name + "`">`r`n</File>`r`n</Component>"} | clip |
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
var i = new List<string>(); | |
i.Add("Hello"); | |
i.Add("Hello2"); | |
i.Add("Hello3"); | |
i.Add("Hello4"); | |
i.Add("Hello5"); | |
i.ForEach(Console.WriteLine); //Action<T> instead of Func<T> | |
Console.WriteLine(i.Count(x => x == "Hello").ToString()); //Count in here |
NewerOlder