Distinct with a custom equality comparer

The other day a colleague of mine was trying to get distinct values out of a list of doubles. He wanted two doubles to be considered equal if the difference between them was less than 0.1.

The complete guide to running PhoneGap on Ubuntu

PhoneGap is a great technology that’s a lot of fun to use, but getting started with it can be daunting. Here I outline the entire process, beginning to end, of getting a basic PhoneGap setup running on Ubuntu, complete with an Android emulator.

Recover lost Git commits

Have you ever done a git reset --hard without thinking it all the way through and found yourself having lost work that you might have been better off keeping? Well, Git actually provides an easy way to recover lost commits. Say that we have a repository with a history that looks like this.

StyleCop type members layout for ReSharper

Resharper’s code cleanup (CTRL+E,CTRL+C) has a handy option which reorders your type members for you. However the predefined reordering rules might not suit your needs. If you like StyleCop’s stricter ruleset, then this is your lucky day. Go to RESHARPER -> OPTIONS, and then CODE EDITING -> C# -> TYPE MEMBERS LAYOUT. Select the “Custom layout” radio button and paste in the following XML.