Setting up a Jekyll workflow on windows

Static site generators are in at the moment, and for good reason. They remove a whole bunch of complexity from deploying and maintaining a site by creating a static representation of it, which you just upload to a web server. For sites that are read heavy but get updated quite infrequently (like a blog, or marketing site) a static site is ideal. Personally I love GitHub pages, it provides first class support for Jekyll which builds all your markdown content, templates, and other site assets into a static website. [Read More]

How to add JSON Patch support to ASP.NET Web API

In this post we’ll look at how to introduce support for the JSON Patch content type (RFC 6902) to ASP.NET Web API. There’s an unlimited number of ways to introduce HTTP Patch support into your API as there’s no single specification on how to represent the set of changes to make to a resource. The PATCH method requests that a set of changes described in the request entity be applied to the resource identified by the Request- URI. [Read More]

Should I use www or not?

It’s common convention to prefix the letter double-u three times on the front of every domain to represent the web host. It’s pretty funny that we managed to pick the most awkward, visually dominating letter for this job. Is it still required? Or can we just use the naked domain? What’s the difference? For most websites it doesn’t matter if you enter www or not, you’re going to end up at the website. [Read More]

Setting up an elasticsearch cluster in azure

One of the best things about Azure is that you can set up most of your favourite software on it regardless of its roots. In this blog post we’ll investigate how to set up an elasticsearch cluster on Windows Azure. Elasticsearch is a powerful open source search engine that makes data easy to explore. To be honest, it’s unfortunate it has search in its name because it’s capable of so much more. [Read More]
azure  guide 

The great confusion about HTTP Patch

PATCH is a relatively new addition to the set of HTTP verbs. Proposed about 4 years ago in RFC 5789 it’s designed to allow an API to support partial updates. A new method is necessary to improve interoperability and prevent errors. The PUT method is already defined to overwrite a resource with a complete new body, and cannot be reused to do partial changes. Otherwise, proxies and caches, and even clients and servers, may get confused as to the result of the operation. [Read More]

Dependency injection for ASP.NET Web API action filters in 3 easy steps

This post looks at performing dependency injection on a WebAPI ActionFilter using Unity. Since we’re looking at WebAPI we’ll be looking at classes which implement the ActionFilterAttribute base class under the System.Web.Http.Filters namespace. We will be using the Unity Application Block (Unity) to do most of the heavy lifting. It’s a lightweight dependency injection container created by the Microsoft Patterns and Practices team. 1) The ActionFilter First you need to implement your shiny new ActionFilter that requires a dependency to be injected. [Read More]

Automatically marking required labels in ASP.NET MVC

A common requirement with any sort of form is marking the required fields. A common convention is to append an asterisk (*) to the label of all required fields. Normally I’d manually add the asterisk directly in the HTML, or add the [display] attribute to the model so that the @Html.LabelFor picks it up automatically. public class SomeModel { [Required, Display(Name = "Email*")] public string Email { get; set; } public string Subject { get; set; } } I prefer to get the HTML Helpers to add it as I’m less likely to forget to mark any of the fields. [Read More]

Implementing XML-RPC services in ASP.NET MVC

Earlier this month I moved my blog to a brand new design to improve the readability of the posts. The admin section was also in desperate need of an upgrade but it would have taken a lot of development effort to create something decent. I ended up just nuking it in favour of using a desktop blogging client. To support various 3rd party blogging clients we just need to implement the MetaWeblog API. [Read More]

Malaysia: The road to Borneo

Borneo is the third largest island in the world, home to one of the oldest rainforests on the planet, and contains an assortment of endemic species. We only had 2 weeks here so we spent most of our time at two national parks, Bako and Mulu. Bako National Park Bako may be one of the smallest national parks in Sarawak but it is host to an incredible range of wildlife and almost all plants native to Borneo. [Read More]
travel 

Nepal: The trek to Everest Base Camp

I’ve hiked to Everest Base Camp and I’m not going to lie; it’s easier than everyone makes it out to be. Don’t get me wrong, it’s not a walk in the park either but you’re rewarded with some of the most spectacular scenery on the planet. Most tours complete the trek in about 12 days and even though this is manageable there is no room for unforeseen circumstances such as sickness or weather. [Read More]
travel