Software Engineer, somewhere between irritated and annoyed.

Using Umbraco Content Service outside of Umbraco context/control in Umbraco 6

In order to make user of IContentService outside of Umbraco Controllers/Views/etc you're going to need to expose it. Much in the same way you'd setup NHibernate to create a session factory on application start we grab IContentService and make it accessible. In this case via UmbracoApplication.UmbContentService UmbracoApplication.cs namespace XXX.UI { using System.Web.Http; using System.Web.Mvc; using System.Web.Routing; using Umbraco.Core; using Umbraco.Core.Services; public class UmbracoApplication…

Magento Export Customers with Address

Simple way to export your customers from Magento with their address. In the ADMIN on the menu select System -> Import/Export -> Dataflow Profiles. Select customer on the dropdown then go to the run profile tab and click go. It'll save it on your server in the /var/exports/ folder. By default this will come out with their billing address. Yep, that simple.…

Creating URL Slugs / Permalinks in C# (csharp)

Bit of a code dump but what the hey it will have to do. In wordpress we have a wonderful set of functions that takes your title and converts it to a URL friendly version in the slug or permalink area. This also handles foreign characters converting them to their standard ASCII equivalent. I generally use two string extensions in C# to perform this task; its incredibly simple and pretty darn clean (I hope). Feel free…

Good Sir, Before you UnLoad – cross-browser JavaScript headaches

Sometimes when working with Booking processes and long forms you come across the need to slap that old cross-browser tart, the before-onunload event to warn the user that they appear to be trying to exit the page in a dramatic way (close tab, browse elsewhere) which contradicts the purpose or intentions of the page they’re browsing. So what can we do to assist our user without being a pest; the old beforeunload dialogue event handler…

CSS3 Recipes for Internet Explorer 6, 7 and 8

Recently as a quick fix to a headache I resorted to adding ‘behaviour’ css modifiers to my IE scripts to add CSS3 style behaviours for IE6/7/8; its a quick and easy thing to do simply refer to http://css3pie.com/ , but before you wonder off test one thing for me. Grab the file from that site and upload it to your server, then reference it in a page (nick the source of that webpage…

Fix Magento 1.4.1 @domain.biz Checkout issue

Updated in Magento Trunk Kids >> http://twitter.com/YoavMagento/status/12243446220 @chrismckee fixed in trunk thx for the report— Yoav Kutner (@YoavKutner) April 15, 2010 Nothing makes my week like another bloody issue. Magento as of 1.4.1 will not allow a customer to move on in the shopping journey if theyre using a .biz domain name. This is a simple bug to fix and simply an omission in the original code and someone…

Validating UK Credit & Debit Cards With LUHN to Type

Note: The regex here is pretty worthless; bin's are listed as ranges and should be handled as such, at the time of writing the ranges were relatively limited and this LUCKILY didn't cause any issues Credit Card validation is a Pain in the Arse *Updated April 2010 But its not going anywhere fast. So I’ve combined two of the scripts I’ve found to meet my needs, added UK credit card data (Maestro/VisaDebit etal)…

Install CouchDB on Ubuntu/Debian with Lighttpd

Depending on your version of Ubuntu ~ Debian, you may be able to install the latest version of CouchDB via APTITUDE; chances are though, you wont. As its really not that difficult to install it from scratch we may as well do it from source. Here we'll cover the installation; basic configuration and how to proxy a sub-domain to your CouchDB. I'll stick the commands below in order of sequence (how the bloody hell else would you…

ASP.net MVC Compiled Views

Big old pain in the arse when you get a runtime error from a view, more so if its then in the build server; Simple solution though; pop open your UI/Web project (csproj) file in an editor of your choice. Check if it already contains an false tag (if it has set it to true) If your missing it; add it as follows… Find the That contains the following entries… <RootNamespace>Project.UI.…

Curl HTTP 417 – Expectation Failed

WordPress XML RPC – HTTP/1.1 417 Expectation Failed I was nocking up a client script to drag down a news-feed and post it to a WordPress blog; the script ran fine, no posts appeared and no errors occurred… irritating. So I figured I’d share this pain in the arse issue fix to the “HTTP/1.1 417 Expectation Failed Error” HTTP/1.1 417 Expectation Failed $title="Test"; $body="<b>Test<…

Setting up ASP.Net MVC 2 on IIS6 with IISRewrite

This will also work in ASP.net MVC, as in the first one. It’s a somewhat well known fact, (by somewhat I mean for amongst web devs, my mum wouldn’t understand any of that), that IIS6 is the IE6 of Servers, its slow, dim-witted, annoying, crap and here to stay. So to make life a little more bearable and to save the rest of the web-society from a life of .net 2 webform’s,…

Converting a Date to MySql Formatted Date

[REPUBLISHED FROM OLD SITE] This is a php coded function provided to allow people to convert dates from standard input format to mysql storage format. /** * function dateconvert * * dateconvert is a handy function to take one of the aches and pains out of mysql * by converting data from a variable (posted from a form or just stored) * into a format mysql will be able to store and converting the * database date back into the british standard of…

How to Solve: "Delayed Write Error"

[Republished from old blog] With many large hard-drives on Windows XP, attached via SATA, people have started to encounter issues where the disk drive starts to display problems displayed in the windows information bubble listing that drive X:(your drive name) has encountered a "Delayed Write Error", usually followed by some file name your probably not even accessing. Now as disconcerting as this may seem never fear; this is mostly apparent in Windows XP and occasionally…