Kamran Ayub is a developer and designer in Minneapolis, Minnesota. He specializes in .NET development with a dash of client-side and is passionate about UX.

Getting WebSockets to Work on Windows Azure

| Comments

I was banging my head against the wall for the past hour or so wondering why I was falling back to XHR polling when I deployed my Node.js application to Azure. I’m using socket.io and everything looks like it’s in order, works locally, etc. It was failing with a WebSocket handshake error.

What I saw in the Chrome developer console was something like:

Error during WebSocket handshake: Unexpected response code: 502

In my Azure Node.js console (azure site log tail SITENAME), I was seeing EPIPE errors.

It turns out, this little tidbit from the original Windows Azure blog post on Web Sockets did the trick.

Modify your web.config and add:

<webSocket enabled="false" />

To your system.webServer configuration. Also, another good point in that blog post is to use SSL, since you get SSL for free with a *.azurewebsites.net site.

Hope this helps someone else out there. This should be added to the official Azure tutorial on using web sockets with Node.js.

5 Tips to Improve Your ASP.NET MVC Codebase

| Comments

I have an urge to write a quick list of tips for improving an ASP.NET MVC application because I just got done reviewing some code for a support ticket at work. It’s still fresh in my mind and I wanted to get some of my thoughts down to share with others. If you have been doing MVC for a while, I don’t think much of this is news. It’s more for those of you that don’t do MVC often or are new to MVC.

Just Released: Have I Been Pwned?

| Comments

I just released Have I Been Pwned? to the Windows Phone store. It’s a tiny, tiny app that only took me a couple hours to build. You can find the source code on GitHub.

HaveIBeenPwned.com is a website created by Troy Hunt, a security MVP, that checks to see if your email address appears in a database of all the breached email addresses in prominent hacks like Gawker, Sony, and Adobe. I’ve definitely been pwned, so it’s a good service to use to quickly see if you need to change your passwords.

I plan to add the background task soon but I wanted the initial release out there so that I can just submit updates to it. If you want to contribute, send me a pull request!

Just Released: Bowling Calculator App

| Comments


I just released my second Windows Phone app, Bowling Calculator. It’s an open source app that I created when I gave my talk at TCCC15. If you’re a fellow developer, feel free to send me a pull request with any bug fixes or enhancements. I want to keep it focused on the simple use case of scoring a bowling game; I don’t need it to track multiple games or keep track of history. It’s purpose is to serve as a production-ready sample app and to also be good at what it aims to do.

MiniProfiler RavenDB Pull Request Accepted

| Comments

I just got a notification that my pull request for adding RavenDB support to MiniProfiler went through! It’s always really cool to see your contributions get pulled in. The MiniProfiler guys were really easy-going, @yellis was even kind enough to take on the testing. That kind of acceptance for pull requests is great to see because it makes me feel good about contributing and is a bit less intimidating.

Kamranicus: Now With 100% More Octopress

| Comments

I’ve just pushed a new version of Kamranicus that is built using the static site generator, Octopress. Octopress uses Jekyll to generate static sites.

I decided to switch because I can leverage GitHub Pages which are free and I can use a custom domain. It’s a perfect fit because I can just piggyback on GitHub’s cloud hosting for free and not worry about incurring any downtime due to database issues (something that happened more than a few times with the last ASP.NET MVC and SQL-based site).

I really enjoyed setting up Octopress, it was easy to migrate my posts. I highly recommend it! It would be even better to have a .NET/C#-based static site generator that supported all of Jekyll’s configuration options, except with Razor-based layouts and templating. Mmmm, that sounds pretty good. Someone get on that.

Just Pushed: Blackjack Sample Game

| Comments

It’s finally done! I sat down today and dug through my backups to find my original WPF BlackJack game I wrote way back when WPF was really cool. I converted it to VS 2013, made sure it still ran, organized the solution, and hit deploy. It’s now up on GitHub for your learning pleasure. There are no Nuget packages here! This was before Nuget where I had to find code to learn from and, ahem, copy. The deck is also something I found online. If I find the source, I’ll be sure to attribute it properly.

Code: https://github.com/kamranayub/blackjack/

This was a sample game I wrote to learn OO design and WPF. There’s some cool animations, sound effects, and a pretty fun Blackjack implementation. It’s very “simple” and should be easy to digest. I never got around to implementing all the cool AI but now that it’s on GitHub for all to see, maybe someone will pick it up.

I also think it’d be fun to port it to Windows 8 C# and XAML. It could be an app I release on the store, free and open source.

TCCC15: See You Again in April!

| Comments

Well, that was a blast. Yesterday was TCCC15 and it was great. Many awesome sessions, including several by my fellow co-workers Erik Onarheim and Stephen Erstad.

Thanks to all who attended my talk! I got +10 votes on the code camp speaker site and 9 llamas, which made me feel pretty good!

Please send me feedback at my email or leave a comment here with your thoughts. The code will be available (soon) at http://github.com/kamranayub/wp-bowling. It’ll be released under an open license but is meant to be educational. The app will also be available soon in the Windows Phone store.

If you missed my talk, you can still get all the bits once I release the app on GitHub. Sure, there won’t be droning voice over the code, but you can still see all the steps I took to enhance it.

There was only one big hiccup where Nuget would not install a package, even when I had it in my local repository (it installed the other ones). I remembered some time ago Scott Hanselman mentioning that Nuget packages were just zip files. I quickly changed my Nuget package extension (because I didn’t have Nuget Package Explorer installed), got the DLL, and added it as a project reference to quickly save my skin. Thanks Scott!

TCCC15: Leveling Up Your Windows Phone App

| Comments

It’s talk time again! I’m lucky to be giving yet another talk at Twin Cities Code Camp (my second one!). Last time was a lot of fun! This time, we’re leaving the Web API pasture and exploring the fun world of Windows Phone development.

TCCC15 is October 19 and I’ll be speaking in Rapson 45 at 2:15pm, so come say hi!

Why You Should Attend

If you’re an experienced or even a beginning Windows Phone developer, come. If you’re still not sure why Windows Phone is cool, come.

The code I’ll be showing will start out at a beginner level and move all the way passed intermediate to advanced. By the end, for example, you’ll see how to implement a custom message box that fully supports Caliburn binding, dismissal, and the view lifecycle.

Finally, all the code will be available on GitHub soon after (this weekend?). I just need time to remove any secrets and figure out a license that will let me publish the app and own it while still allowing you all to learn from it.

What We’ll Talk About

I’ll be doing a “live coding” presentation. In reality, I’ll be coding and switching to Git branches that showcase the fully completed code then walk through it. The app I’ll be presenting is actually a “complete” app; meaning that it works fine and does everything I need it to. However, anyone whose done app development can tell you that the work isn’t done when your app runs and all your tests pass; there’s still plenty of work making it “production ready.” That’s what I’ll cover in my session!

Right now, my talk is divided into 5 sections covering MVVM, fast resume, logging, about page, and UX improvement. The sections are designed in a way that will expose you to many different parts of my preferred MVVM framework, Caliburn. Along the way, you’ll also learn some great tips & tricks I’ve found along my journey designing Windows Phone apps.

I’m excited because we’ll start with the basic premise of an app (which works) and then take it to a production-ready application. Literally, by the end of the presentation, I could publish my app to the store and feel good about it.

I hope to see you on Saturday!