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 AutoLocalizingRoute : Route | |
{ | |
public AutoLocalizingRoute(string url, object defaults, object constraints) | |
: base(url, new RouteValueDictionary(defaults), new RouteValueDictionary(constraints), new MvcRouteHandler()) { } | |
public override VirtualPathData GetVirtualPath(RequestContext requestContext, RouteValueDictionary values) | |
{ | |
// only set the culture if it's not present in the values dictionary yet | |
// this check ensures that we can link to a specific language when we need to (fe: when picking your language) | |
if (!values.ContainsKey("language")) |
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 MyNameSpace = MyNameSpace || {}; | |
MyNameSpace.jsondateformatter = (function () { | |
var that = this; | |
var toDate = function (jsonDateString) { | |
var time = jsonDateString.replace(/\/Date\(([0-9]*)\)\//, '$1'); | |
var date = new Date(); | |
date.setTime(time); | |
return 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
public static class IEStaticInstanceHelper | |
{ | |
// TODO: move this to a config file | |
public const string ROOT_URL = "http://localhost:13834/"; | |
private static IE _ie; | |
private static int _previouslyKnownIeThreadHashCode; | |
private static string _ieHwnd; | |
public static void Initialize() |
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
@Html.LabelFor(m => m.SomeProperty) |
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 abstract class ViewTest<TBrowser> where TBrowser : Browser, new() | |
{ | |
[TestFixtureSetUp] | |
public void FixtureSetUp() | |
{ | |
Browser = new TBrowser(); | |
Browser.GoTo(RootUrl); | |
} | |
[TestFixtureTearDown] |
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 MembaseCache : ICache | |
{ | |
private readonly MembaseClient membaseClient; | |
public MembaseCache(string region = null) | |
{ | |
// this implementation assumes password-less buckets | |
membaseClient = new MembaseClient(region, null); | |
} | |
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
[GridAction(EnableCustomBinding = true)] | |
public ActionResult GetModels(GridCommand gridCommand) |
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 NameModel | |
{ | |
[Display(Name = "First name")] | |
[Required] | |
public string FirstName { get; set; } | |
[Display(Name = "Last name")] | |
[Required] | |
public string LastName { get; set; } | |
} |
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 Dependency | |
def do_something_with(some_object) | |
p some_object | |
end | |
end | |
class SomeClass | |
def work_your_magic_on(something) | |
Dependency.new.do_something_with something | |
end |
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
require 'forwardable' | |
class Model | |
extend Forwardable | |
def initialize | |
@entities = [] | |
end | |
def add_entity(entity) |