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" |
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
icacls d:\SiteData\%1 /grant "IIS APPPOOL\%1":(OI)(CI)(F) |
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 LambdaExpressionFactory | |
{ | |
// With member type | |
public static Expression<Func<T, TProperty>> Lambda<T, TProperty>(string memberName) | |
{ | |
var parameterExpression = Expression.Parameter(typeof(T), "x"); | |
var memberExpression = Expression.PropertyOrField(parameterExpression, memberName); | |
var result = (Expression<Func<T, TProperty>>)Expression.Lambda(memberExpression, parameterExpression); | |
return result; | |
} |
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.IO; | |
using Lucene.Net.Analysis; | |
using Lucene.Net.Analysis.Standard; | |
using Lucene.Net.Documents; | |
using Lucene.Net.Index; | |
using Lucene.Net.QueryParsers; | |
using Lucene.Net.Search; | |
using Lucene.Net.Store; | |
using NUnit.Framework; |
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
class FizzBuzz | |
{ | |
static void Main() | |
{ | |
for (var i = 1; i < 101; i++) | |
System.Console.WriteLine(i % 15 == 0 ? "FizzBuzz" : i % 3 == 0 ? "Fizz" : i % 5 == 0 ? "Buzz" : "" + i); | |
} | |
} |
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
#import <CoreLocation/CoreLocation.h> | |
#import <MapKit/MapKit.h> | |
#import "AnnotationCoordinateUtility.h" | |
@implementation AnnotationCoordinateUtility { | |
} | |
+ (void)mutateCoordinatesOfClashingAnnotations:(NSArray *)annotations { |
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
self.mapView.layer.borderColor = [UIColor redColor].CGColor; | |
self.mapView.layer.borderWidth = 3.0f; |