Diary of a ninja
A blog about Life, Code and Beating level 99 to brag to your mates...
Facebook Apps in 10 mins using Microsoft Facebook SDK
So It’s been about a year or so since I've written any Facebook applications for clients, and in that time quite a lot has changed in the space. There are quite a list of available libraries you can use to write Facebook applications in .Net with, so it can be sometime daunting to pick one as your favourite. This can be further complicated by the fact that for a lot of people, when they first go to write a Facebook application some of the jargon thrown around can be confusing when you know nothing about the Facebook API – what approach should you take? does having ASP.Net MVC or Silverlight support make the library a good one?

 

Google Analytics event tracking in native code – now in GaDotNet 1.2
So last week i released my new open source project GaDotNet, which allows you to track page views, events and soon to be supported, transactions, in your .net applications natively. I’ve had so much awesome feedback from the .net community, and have been busily adding features. Today i release the next version that supports events.

 

Track Remote/Facebook fan page views with GaDotNet
So yesterday i released my open source project GaDotNet and have received a lot of great feedback e-mails over the past day. There where also a few emails mentioning that they didn’t understand my comment about Facebook fan page tracking using the library. This post will show you how.

 

Release of Google Analytics Dot Net
So today is the day that a little side project I've been working on sees the days of light. GoogleAnalyticsDotNet allows you to log a page view to Google Analytics from code behind of a website or from within a web service or win forms project without needing to use the Google JavaScript code, or even use web browser at all.

 

IIS team lets slip of plans to release IIS Express
So today something happened that excited me somewhat. Microsoft’s Scott Guthrie set the twittersphere on fire with his blog post about the upcoming IIS Express release – a feature complete version of IIS that is portable and can be launched by right clicking a folder in explorer – GENIUS!

 

Automatic NTLM Logon for ASP.Net, TFS & SharePoint sites with IE & FireFox
NTLM Authentication for websites is a great addition to the bat-belt when writing ASP.Net sites. Additionally it is also a great to have support for it in Team Foundation & SharePoint portals. However as great as having support for NTLM authentication may be, having to enter & re-enter your credentials when surfing Intranet or Extranet sites can be an annoyance that is just not worth it.

 

Automated deployments with TeamCity, Deployment projects & SVN
One of the continually high risk and sometimes fiddly operations in web deployment is a web application’s deployment, and yet a lot of people working in smaller teams seem to have become stuck in the land of cowboys because the task of automated deployments seems either too difficult, too time consuming to setup or is perceived as un-needed. I’m about to attempt to prove all of these things wrong, while at the same time allowing you to get back to doing what you do best: write code.

 

Make your XML strongly-typed: Because you can, and its easy
Earlier in the week i posted a Twitter post commenting on how if your not using the XMLSerializer class to you advantage, well, as Scott Hanselman puts it now and then: Your doing it wrong. I use the XML Serializer classes on a daily basis to refer to my XML in a strongly typed manner and often wonder why i see people go to so much effort in creating hard to maintain code just to get data from or send it to an XML file.

 

Keep your ASP.Net websites warm and fast 24/7
ASP.Net web applications are awesome most of the time. But there is a sad reality: ASP.Net applications are tuned to handle huge amounts of traffic, not 50 page views a day. This becomes an issue when you have limited traffic to your site, because if your it doesn’t keep being viewed, your application pool may recycle, and that important visitor number 1 gets screwed waiting as your site rebuilds or your app pool to fires up. Whether it’s a SharePoint site, an ASP.Net or your internal TFS 2008/TFS 2010 Server, you want it to be FAST… all the time.

 

Video encoding in the cloud in mere minutes
I’m currently involved in a new project for a client that involves a lot of user contributed video, that then gets viewed on the site. This means video encoding, and lots of it, and the budget and timeline involved mean that the client can’t afford to implement the dedicated hardware to do this themselves. Why not encode in the cloud you say? Why not.

 

Controlling Facebook user referral link content
Social networking has taken the world by storm, and added a new tool to web developers’ marketing arsenal (along with Digg, Reddit etc), in the form of link sharing. The problem is that it is nearly impossible to have a say in most social network link sharing, along with how you are promoted. However in Facebook’s case we have a few tricks up our sleave.

 

ASP.Net Http module for mobile device browser redirection
With all the advances and improvements in the mobile space of late, there is even more need to have a mobile presence/version of your website. Today I'm going to take a look at a quick and easy way to make sure that mobile browsers are always looking at the correct version of your site, and we’ll do it using a nifty little Http Module.

 

Twitterify your strings using c# regex
So you’ve set up a twitter feed on your site – sweet. Now all your peeps can see how excited you are about the new limited edition Whitney Houston EP you’ve been listening to. But then you post a link – or a reply to a fellow twitterati member and those handy auto links you’ve become so used to aren’t there. Bummer duuude – lets fix that.

 

How to use the Not-so-new MailSettingsSectionGroup
Today i came across something that from my day-to-day coding i have noticed a lot of my fellow coders at work/play have let slide on their path to .Net Mecca – using the MailSettingsSectionGroup section of the web.config to specify both SMTP server host details as well as they other properties such as user/pass credentials in a central, single, easy to use manner. So I'll take this opportunity to make it as easy as possible for you to use.

 

Developer productivity is important - Reality or Myth?
Today i was reading a post by Rob Conery in which he discussed both his thoughts on developer productivity in relation to the creation of a new OS project (ASP MVP), and how he may have thought that in some instances hiding behind WebForms and not touching MVC was really just laziness or ignorance mistaken for productivity. Additionally i also read another post by Scott Bellware in which talks about a similar subject, in that developer productivity when viewed in isolation, is really a myth.

 

C# Convert DataSet to CSV
Today i found myself wanting to quickly export a dataset to CSV and i didn’t want to bloat of a library that does more than i need. The following method is the result of this need/want.

 

SubSonic, SQLite, Sonic.exe and 64bit, oh my!
Well this week i started work on my new development machine – a 64bit Windows 7 machine mmmm tasty. Everything has run perfectly smoothly until i hit one weird little issue. While attempting to generate a new data layer for a SQLite database using Subsonic i received nothing but errors – Another simple fix which I'll show you in this post.

 

Retrieving a Flickr Photo ID from a URL using RegEx
While working on a recent Flickr/Google Maps mashup i needed to make it as simple for users to share their Flickr photos as possible. What is easier than simply asking them to enter the Flickr photo page URL? Using this I'll show you a simple way to use RegEx to retrieve the photo ID part of the URL using c# as well as a JavaScript RegEx version for your ASP.Net RegEx validators. Lets get to it!

 

Consuming an ASP.Net WebService with Jquery & JSON
ASP.Net Script Services and Web Services are an incredibly powerful tool for providing rich dynamic sites using AJAX. As good as they are, there are times when you want to access them in alternate ways. Combine JQuery, JSON and ASP.Net Web Services and you have a combination that rivals the A Team – lets take a look.

 

Consuming an ASP.Net WebService with Jquery & JSON
ASP.Net Script Services and Web Services are an incredibly powerful tool for providing rich dynamic sites using AJAX. As good as they are, there are times when you want to access them in alternate ways. Combine JQuery, JSON and ASP.Net Web Services and you have a combination that rivals the A Team – lets take a look.

 

Adding Windows Live Writer support to your Blog engine
If there is one blogging related tool that I've come across lately that i think has been a game changer it would have to be Windows Live Writer. However some people are using either a custom written blog engine (like me) or are using a blog engine that doesn’t support Live Writer. If that is the case i will show you a simple way to integrate Windows Live Writer support into you blog with WebServices and the MetaWebLog API.

 

Sending encrypted e-mail with C#
There are times when the invention that we all call E-mail just doesn’t cut it for sending information securely. It is because of this that in every case where information really needs to be sent securely E-mail is not usually the medium chosen to send it. As most developers know though there are times when you have to bite the unsecure E-mail bullet. I’ll show you a way to solve this conundrum and at the same time probably keep your current e-mail client.

 

Forcing ASP.Net to use a Proxy to make requests
This is a quick one today. I was recently working with a web application that runs a spider to index content on a bunch of intranet sites. The client was a large company with a very security conscious IT team, that had locked down all intranet access from the web server server in question. Luckily Dot Net supports proxies in a loving fashion, and I'll show you how.

 

Getting a full ASP.Net rendered page as a string
So there i was looking for a simple solution to offer a preview function on a CMS for a client at work, when it hit me. Why try and replicate the content of the page in anyway (i could use a blank page and fill it in, i could carry values as a session and redirect to the front end view page. The reality is: I could do many different things. The real question comes down to “How would a Ninja do it”

 

Regular Expression to find the YouTube video ID from a string
Today i had to write a quick method to extract the YouTube video id from a YouTube video URL. So on with the show, lets get onto the code.