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.Collections.Generic; | |
using System.Linq; | |
namespace jmcd | |
{ | |
public class MoveOperation<T> | |
{ | |
private readonly Func<T, int> _positionOf; | |
private readonly Action<T, int> _reposition; |
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.Diagnostics; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; | |
using Microsoft.Web.Administration; | |
namespace WtfApp | |
{ | |
internal class Program |
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
@model gts.Web.Models.AddressFields | |
<ul> | |
<li> | |
@Html.HumanLabelFor(x => x.Line1) | |
@Html.TextBoxFor(x => x.Line1) | |
@Html.ValidationMessageFor(x => x.Line1) | |
</li> | |
<li> | |
@Html.HumanLabelFor(x => x.Line2) |
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 scheduleDateAlias = default(ScheduleDate); | |
return session.QueryOver(() => scheduleDateAlias) | |
.WithSubquery.WhereNotExists( | |
QueryOver.Of<CommunityGrantApplicationChequeRequest>() | |
.Where(x => x.ScheduleDate.Id == scheduleDateAlias.Id) | |
.Select(x => x.ScheduleDate) | |
) | |
.OrderBy(scheduleDate => scheduleDate.Rank).Asc | |
.List<ScheduleDate>(); |
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
public class ComboMaskFactory | |
{ | |
private int _current; | |
private readonly int _lim; | |
public ComboMaskFactory(int maxNumberOfBitsInMask, int numberOfOneBits) | |
{ | |
if (maxNumberOfBitsInMask > 32) throw new Exception("ComboMaskFactory can only be used with maxNumberOfBitsInMask up to 32."); | |
_current = GetLowestValueUsingSuppliedNumberOfOneBits(numberOfOneBits); | |
_lim = 1 + _current << maxNumberOfBitsInMask - numberOfOneBits; |
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
public static class IntExtensions | |
{ | |
public static string GetOrdinalSuffix(this int @this) | |
{ | |
switch (@this % 100) | |
{ | |
case 11: | |
case 12: | |
case 13: | |
return "th"; |
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 funcExp = (MyThing x) => x.MyMethod(foo); | |
var actExp = Expression.Lambda<Action<MyThing>>(funcExp.Body, funcExp.Parameters); |
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 viewEngine = (RazorViewEngine)ViewEngines.Engines.Single(ve => ve is RazorViewEngine); | |
viewEngine.PartialViewLocationFormats = new List<string>(viewEngine.PartialViewLocationFormats) | |
{ | |
"~/Views/Shared/Fields/{0}.cshtml", | |
"~/Views/Shared/ReadOnlyModels/{0}.cshtml", | |
}.ToArray(); |
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
public static class ResolveUrlExtension | |
{ | |
public static MemberConfigurationExpressionWrapper<TSource> ResolveUrl<TSource>(this IMemberConfigurationExpression<TSource> opt) | |
{ | |
return new MemberConfigurationExpressionWrapper<TSource>(opt); | |
} | |
public class MemberConfigurationExpressionWrapper<TSource> | |
{ | |
private readonly IMemberConfigurationExpression<TSource> _opt; |
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
for /d /r . %d in (bin,obj) do @if exist "%d" rd /s/q "%d" |