Skip to content

Instantly share code, notes, and snippets.

View edchapel's full-sized avatar

Ed Chapel edchapel

  • Zalando SE
  • Berlin, Germany
  • 03:09 (UTC +02:00)
View GitHub Profile
@edchapel
edchapel / gist:5541932
Created May 8, 2013 17:09
Bad recruiter email...
From: Vishal xxxxxxx <Vishal.xxxxxxx@catstaffing-us.com>
Subject: Uregnt Need, !!!! .Net Developer !!! Portland, OR !!! 6+ months Contract
Date: Wed, 8 May 2013 22:29:51 +0530
Hi ,
Hope you are doing well !!!
I have a good position for you with my client; This point of time I don't know whether you are looking for new job or not.But just thought if I can share the details and then confirm from you about your interest level for the opportunity.if you are interested and available send me your most updated resumes in word format and contact details.
Position: .Net Developer
Location: Portland, OR
@edchapel
edchapel / gist:1901972
Created February 24, 2012 16:49
User with bug
public partial class User : UserBase
{
private AuthorizationRoleEnum _securityRole;
public User()
{
_securityRole = AuthorizationRoleEnum.NotAuthorized;
}
public string FriendlyName { get; set; }
@edchapel
edchapel / gist:1898017
Created February 24, 2012 05:29
Example of PartialMock
// A test that relies on PartialMock
[Test]
public void GetBasePaymentAmount_FacilityFeeIsNotNull()
{
var dateOfService = DateTime.Now;
const string procedureCode = "12345";
var feeScheduleRepository = Substitute.For<IFeeScheduleRepository>();
feeScheduleRepository.GetFeeSchedule(procedureCode, ModifierFlag.NoMod, dateOfService).Returns(new FeeSchedule(null, 100));
@edchapel
edchapel / gist:1894288
Created February 23, 2012 18:45
An example of our Ninject config
public class WebServerConfigurationModule : NinjectModule
{
public override void Load()
{
Bind<IAdminService>().To<AdminServiceClient>();
Bind<IWorkDriverDbContext>().To<WorkDriverDbContext>();
// If you want a generic IDbContext, you get a new one every request
Bind<IDbContext>().To<WorkDriverDbContext>().InTransientScope();
public partial class ConvictionHistory
{
[RegularExpression(@"^\d*$", ErrorMessage = "Felonies must be a number.")]
public string FeloniesText
{
get { return this.GetNumberAsString(_ => _.Felonies); }
set { this.SetIntProperty(_ => _.Felonies, value, number => Felonies = number); }
}
[RegularExpression(@"^\d*$", ErrorMessage = "Misdemeanors must be a number.")]
@edchapel
edchapel / gist:817445
Created February 8, 2011 22:42
Good Module
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" preCondition="managedHandler" />
@edchapel
edchapel / gist:817360
Created February 8, 2011 22:00
Bad Module
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web , Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" preCondition="managedHandler" />
private void SaveCompleteSomeDTO(SubmitOperation submitOperation)
{
...
UpdateErrors(submitOperation.EntitiesInError);
}
private void ApplicationStartup(object sender, StartupEventArgs e)
{
var mainPage = new MainPage();
ServiceLocator.Initialize(exception => new ErrorWindow(exception).Show(), () => VerifyAuthorization(mainPage), new ClientConfigurationModule(mainPage.ContentFrame));
}
/// <summary>
/// Use a sample WCF RIA call to demonstrate that we are authorized
/// </summary>
/// <param name="mainPage"></param>