Ch-ch-ch-ch-changes!

I have neglected my blog for some time, and it is time I gave it a little love.

I recently went through a major career change. I received news that my employer of over 10 years was going through some financial hardship and that my hours were no longer guaranteed. I have been telecommuting for the past 5 years, so the news came as quite a shock. I knew I wasn’t going to be able to continue to telecommute, and the best I could hope for was a couple of days a week working from home.

Luckily I have been a developer for some time. I get a lot of recruiter emails, so I started replying and reaching out to previous recruiters I had spoken to. It did not take long for phone interviews to roll in, and then face-to-face interviews. I have always put way too much pressure on myself in interviews, and I was dreading going in to “code in ten minutes” or whiteboard or whatever.

The funniest part of this whole process is most of the employers I interviewed with were not actually on the MS stack – which has been my focus for most of my career as a developer. Most were on some sort of PHP codebase server side (eww…) but the majority of focus was on client-side. I am thankful for taking the leap into js frameworks!

So, I now have a new job in Seattle. I have to commute about 1.5 hrs each way, but it could be worse. I drive maybe 1.5 miles to the marina, park, hop on the foot ferry, then transfer onto the “big” ferry in to Seattle. Here are some pics from the ferry:

IMG_20150527_055839

IMG_20150529_060339

IMG_20150529_164745

If you gotta commute, commute in style

Anyway, to give some examples of some client-side code, I added some new gists and repos. Check them out if you like.

scroblr

I used to listen to my Last.fm station a lot, but lately I have been stream my local radio station (107.7 The End, Seattle). I like the variety and even some of the DJ banter while I work. I work from home and it makes it seem a little less like I am sitting at home in my office by myself.

The one downside was no scrobbling. I had another Chrome plugin but it did not work with Abacast (the platform 107.7 uses to stream their broadcast). I looked into making the plugin work with Abacast, but to be honest the docs were kinda poor and the API was a little “scattered”. I looked at more open-source plugins and found scroblr. It isn’t anything fancy, but the API made it a snap to create a new plugin for Abacast. I forked the code, whipped up a plugin, tested and submitted a pull request in under an hour. Now I am happily scrobbling from the 107.7 stream.

Introducing DataTablesDotNet

The datatables plugin is one of the coolest jQuery plugins around, and I wanted to find a way to make it work easily with ASP.NET MVC sites. Initially I created some objects that included the various datatables property names and that worked well. However, when another project came along and I wanted to use datatables in that project too I realized the original way I created the objects just wasn’t going to cut it.

After a lot of searching I found this blog post. I liked what I saw. Even better was the additional code contributed by Paul Inglis in the comments. The only thing I did not like was the stringify used to turn the datatables JSON into key/value pairs. I also did not like the way the project was made available – a box.net download location with no way to contribute (hence the code in the comments). I decided I would build on these great contributions and update the code to work without the serialization.

So, here it is on GitHub. The code has been cleaned up, it uses Paul’s Expression code for building the filters/sorts, and it doesn’t stringify the datatables data which cuts the data sent pretty much in half. I also added a model binder so it all “just works”.

NOTE: Isn’t it funny how one can look for something and not see it right in front of them? When I was doing my original googling, I was getting next to nothing for results. It is funny how that can work out sometimes. I built upon the above codebase and pushed my code to GitHub and nuget because I thought I was providing something of value. It wasn’t until I searched for my nuget package that I saw about a dozen other packages doing similar things. That being said, there are only a couple that include everything I did – others are just models or binders, so it is somewhat of use. Also, I see in the most used package a minor flaw in logic in the binder, but it doesn’t break any functionality, so not a big deal. Finally, the process gave me a chance to do a deep-dive into Expressions, and that was very enlightening, so the entire process was still of use, even if the nuget package isn’t. 🙂