you.arenot.me


Interfaces – The Good and The Ugly

(there is no bad…just pros and cons)

I want to start off this with a positive spin. Interfaces are great. They help make your life much easier. Using interfaces is real easy too:

public interface IEntity
{
int Id {get;set;}
DateTime DateCreated {get;set;}
DateTime DateUpdated {get;set;}
string CreatedBy {get;set;}
string UpdatedBy {get;set;}
bool Enabled {get;set;}
int DisplayOrder {get;set;}
}

WordPress new install on Windows IIS 7 with 500 Internal Server Error

Wasted 3 hours of my night working on this.  I was asked by a friend to install WordPress for them so that they can do everything.  Sounds like very little work for me.  Sounds like money for old rope.  No problems I thought. BOOM!  500 Internal Server Error.


How long should I fast for?

If you’ve read my previous posts then you know am trying that 5:2 diet.  2 days of the week I fast.  But that’s meant to be a 24 hour fast?  Because if the last thing I eat the day before is 7pm (am trying not to snack) that means the next thing I have to eat “normally” is the day after the fast at around 6am.  That’s 33 hours fasting… Is that not a bit much?


Special VB String Escape Character like @’String’ in C#

Due to my sins (it would seem) I still have to work with VB.net from time to time.  But I am so used to doing this:


Low Facebook page views (or why have I done all this work for nothing?)

So Facebook seem to have a random algorithm for posting to peoples’ news feeds. I did a test over the last couple of days.  I posted 3 different types of posts to my Facebook page (not timeline, a company page and it only has 450 likes) to see what the number views would be – Facebook page owners get to see how many folks viewed a post.  I was quite shocked actually.  Here are the results to find out why you might have low page views.


Twitter bootstrap

Tonight I got a chance to play with the Twitter Boostrap.  I plugged it into my MVC4 testing app (more on that in another post maybe).  And I quite like it.


A long forgotten number (or why the 5:2 diet seems to work for me)

It’s now been a few weeks on this diet.  As I said, I tried it out last year, but this years intention was do keep it going weekly.  Yesterday was the first “fast” period of week 3.  I really shouldn’t be blogging about it now.  I should wait till the end but I couldn’t resist.


Tables not aligning center in some mail clients

Another one of those pesky email clients not working properly.  With the advent of MailChimp and cool CSS stuff, you kinda get lazy.  I did and forgot to add the old school version of layouts on tables.  I only added the style=’margin: 0 auto’ but Hotmail web based client actually stripped that out!

The Solution

Add align=’center’ as well as the style=’margin: 0 auto;’.  Another simple thing I know I will forget – hence adding it here.


Remove jQuery validation on specific button

So you’ve just built what is the best form ever! It has 1 set of fields, 3 buttons – save, delete, cancel. Pixel perfect styling as per the designers Photoshop file, and the CSS that anyone would dream of. And then it stops working! You click the cancel button! It validates the form!! NO! It’s a cancel button. It should stop what you are doing. Really simple fix, and am just writing it down here because I will forget.

The Solution

Add a css class of cancel on to your button. That’s it. Simple!


IIS, Trailing Slashes, and HTML extension

I hate URLs that don’t end in something.  I do.  I REALLY do.  That’s why most of the website I have built end in .html or for the MVC ones, a trailing slash.  But don’t you just hate it when a search engine or user somehow picks up a URL that doesn’t have the trailing slash? e.g. /my-lovely/url/without-a-slash ARGH!  I see it a lot on WordPress sites because of the amount of sharing going on.  I would have thought this would have come up more often, but it seems people don’t mind it.  I mind.  I think I have trailing slash and .html OCD.  I found this post on stackoverflow which was great but as always it didn’t work – too many blogs saying it does, when it does.  So for posterity here is what I did: