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
public static class ListDiff | |
{ | |
public static List<ListDiffItem<T>> GetDiff<T>(List<T> oldList, List<T> newList, Func<T, T, bool> equalsFunction = null) | |
{ | |
var combined = new List<ListDiffItem<T>>(); | |
foreach(var i in newList) | |
{ | |
var diff = new ListDiffItem<T>(); | |
diff.Item = i; |
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
public static class Hierarchyize | |
{ | |
public static List<Nested<T>> Transform<T>(IEnumerable<T> items, Func<T, T, bool> isParentFunction, Func<T, bool> isRootFunction) | |
{ | |
Action<Nested<T>> setChildren = null; | |
setChildren = parent => | |
{ | |
parent.Children = items | |
.Where(childItem => isParentFunction(childItem, parent.Item)) |
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 () { | |
var scriptName = "embed.js"; //name of this script, used to get reference to own tag | |
var jQuery; //noconflict reference to jquery | |
var jqueryPath = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"; | |
var jqueryVersion = "1.8.3"; | |
var scriptTag; //reference to the html script tag | |
/******** Get reference to self (scriptTag) *********/ | |
var allScripts = document.getElementsByTagName('script'); |
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 ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/> | |
<PropertyGroup> | |
<DeployFiles>$(MSBuildStartupDirectory)\DeployFiles.msbuild</DeployFiles> | |
<VersionMajor>1</VersionMajor> | |
<VersionMinor>0</VersionMinor> | |
<VersionPatch>0</VersionPatch> | |
<ChangesetNumber>0</ChangesetNumber> | |
<NugetFileShare>\\itsmanv01\Releases</NugetFileShare> |
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
Write-Host "Looking for " $OctopusPackageDirectoryPath "app_offline*.htm*" | |
if(Test-Path $OctopusPackageDirectoryPath\app_offline*.htm*) | |
{ | |
ren $OctopusPackageDirectoryPath\app_offline*.htm* app_offline.htm | |
} |
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 ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/> | |
<PropertyGroup> | |
<VersionMajor>1</VersionMajor> | |
<VersionMinor>0</VersionMinor> | |
<VersionPatch>0</VersionPatch> | |
<ChangesetNumber>0</ChangesetNumber> | |
<NugetFileShare>\\itsmanv01\Releases</NugetFileShare> | |
<SolutionPath>RequisitioningSolution.sln</SolutionPath> |
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
CREATE PROCEDURE spNextStudySequence | |
@StudyID int | |
AS | |
DECLARE @temp table | |
( | |
ID bigint | |
); | |
UPDATE tStudy_Sequences | |
SET Sequence = Sequence + 1 |
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
public class Program | |
{ | |
/// <summary> | |
/// Entry point. | |
/// </summary> | |
/// <param name="args">The args.</param> | |
/// <returns></returns> | |
static int Main(string[] args) | |
{ | |
var rawConnectionString = ConfigurationManager.ConnectionStrings["db"].ConnectionString; |
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
/// <summary> | |
/// Adds template to email from embedded resource | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
/// <param name="path">Path the the embedded resource eg [YourAssembly].[YourResourceFolder].[YourFilename.txt]</param> | |
/// <param name="model">Model for the template</param> | |
/// <param name="isHtml">True if Body is HTML, false for plain text (Optional)</param> | |
/// <param name="assembly">The assembly your resource is in. Defaults to calling assembly.</param> | |
/// <returns></returns> |
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
public class DataMockHelpers | |
{ | |
public Mock<IQeraUnit> GetMockUnit() | |
{ | |
var unit = new Mock<IQeraUnit>(); | |
return unit; | |
} | |
public Mock<TRepo> MockRepo<TRepo, TEntity>(List<TEntity> seedData = null, bool callBase = false, MockBehavior behavior = MockBehavior.Default) | |
where TRepo : class, IRepo<TEntity> |