2014 Reflection

It is the time of year when many reflect back on the previous year and take stock of their successes and failures. Reflection is an important skill that often gets over looked. Without reflection we always move onwards without ever taking the time to learn from the expereinces we have had.

2014 was the first year that I set goals at the beginning of the year and followed through with them. It has been a fun experience. I can attribute the successful experience to my mastermind group. Without their support I would have likely never gotten started or had the motivation to follow through.

Accomplishments

A few of the highlights (in no particular order) from the past year:

Lessons Learned

Community

Community is important. Whether it is small group of friends or a a larger group, community will help provide motivation and support for any activity you try to accomplish. If you are not a member of a local community, join one or start one, it will change your life.

Entrepenureship

There are many different types of entrepreneurs. I have struggled with my entrepreneurial spririt over the last year and half. It was while listening to a podcast this year, Startups for the Rest of Us, I realized that there are different motivations and options for feeding that spirit.

Diversity

Diverisity is important. It is easy to overlook ideas becuase they are different. The more diverse ideas you are presented with the better chance you have of finding the right one.

Consistency

Consistency is a rare trait because it is hard. But if you can stick with your idea/project/work then you will eventually have success. I saw this over the past few months with my blog going from zero readers the first few months to over 700 pages views this last month. If I had given up or stopped writing I would not have seen increase and would have called the blog expirement a failure. It was hard to put out a post a week… there were many late nights and early mornings.

Conculsion

2014 was a great year for me. When looking back there were some common themes and lessons that showed up time and time again. Learning from them has helped me plan to make the next year even better.

Resources

I often am asked by my co-workers about good resources for developers. So to help anyone that might be looking for curated developer resources, I have added a page with the resources that I use on a regular basis. The list has a little bit of everything… utility tools, IDE’s, and reference sites like the .NET source code. In the future I hope to add some of my favorite books that I have found most useful in furthering my skills. And if you enjoy podcasts you should check out my list of recommended developer podcasts.

I love to learn about other tools that make my work easier so if you have a resource that is a must have let me know in the comments.

Happy Holidays!

Chocolatey and Boxstarter

Setting up a new computer is never fun. That has all changed with some great tools called Chocolatey and Boxstarter. Long gone are the days of searching from site to site for the download here link. No longer will you sit there clicking through installers. Never again will you forget that to install the seldom used but critical program.

Chocolatey

Chocolatey is tool to install applications and tools quickly with out the fuss. From Chocolately’s about page:

Chocolatey is a package manager for Windows (like apt-get or yum but for Windows). It was designed to be a decentralized framework for quickly installing applications and tools that you need. It is built on the NuGet infrastructure currently using PowerShell as its focus for delivering packages from the distros to your door, err computer.

Once installed it is simple to use, just open the command prompt and type:

choco install git

The above command installs the latest version of Git for Windows. And you don’t have to click through the installer.

Boxstarter

Boxstarter lets you automate multiple Chocolately installs so you don’t have to worry about required reboots. It also lets you configure Windows system settings such as always showing hidden file/folders. From the Why Boxstarter page:

Boxstarter leverages Chocolatey packages to automate the installation of software and create repeatable, scripted Windows environments.

The best part is that you can do it all with one simple url and nothing installed on the machine to start. Simply use following URL (seems to only work in IE):

http://boxstarter.org/package/sysinternals,fiddler4,itunes

The above url will prompt you for a download. When you accept the download, the downloaded installer will automatically download Chocolatey and install the chocolately packages for sysinternals, fiddler4 and itunes. All with out any prerequisites!

Putting it together

You can also create Boxstarter scripts and install then using a URL also. I have created a GitHub repository called Chocolatey-recipe to demonstrate how it would work. To use it:

  1. Download and run RunBoxstarterInstall.bat (only works with IE as default browser but since this for a fresh Windows computer that is ok)
  2. This will launch a download for an executable.
  3. Run the executable it will download, install, and configure all programs in chocolatey-recipe.txt

The RunBoxstarterInstall.bat starts your browser with the following URL:

http://boxstarter.org/package/url?https://raw.githubusercontent.com/jsturtevant/chocolatey-recipe/master/chocolatey-recipe.txt

Instead of passing package names, this time we pass the URL of a plain text Boxstarter script that contains 20+ of my favorite programs, installs windows updates and sets Windows explorer options. Again, all without installing anything first. Now come back a couple hours later and your machine is ready with everything installed!

Do you use Chocolatey and Boxstarter? What other tools do you use?

Tech Podcasts

One of the best things I have started to do over the last year for my career is listen to technical podcasts. Whether I am commuting to work or washing the dishes, I get to stay on top of the latest tech news, learn about new (and old) technologies and get direct access to some of the brightest and most talented people in our industry. On top of all that, they are often entertaining.

Podcast players are notoriously bad. Recently, I made the switch to PlayerFM. I enjoy PlayerFM because it syncs across platforms, has double speed (I listen at 1.7x - give it a try you might never go back) and it is easy to share useful links.

Below is a short list of some of my favorites right now. Even though I currently work in .NET I find the podcasts about other languages interesting and useful to broadening my horizons.

There are many other podcasts that I subscribe to including business and entrepreneurship but this is a good starting point for anyone interested in technical podcasts.

Did I miss any? I would love to hear your thoughts about these and other podcasts.

AngularJS HTTP Service Success Handler 400 Response Code and Interceptors

I ran into a perplexing problem the other day while working with AngularJS. All of my 400 (400, 401, 403, 404…) responses from my back end ASP.NET WebApi site were going to the success handler of of the $http service:

$http.get('/api/resource').
  success(function(data, status, headers, config) {
    // 400/500 errors show up here
	if (status == 400)
	{
		console.log('Should never happen')
	}
  }).
  error(function(data, status, headers, config) {
    // never reached even for 400/500 status codes
  });

Luckily, the AngularJS team is tracking all of their issues in the open and with a quick Google/Bing search I found an issue that pointed me in the correct direction.

If you take the time to read through the issue you find that a improperly implemented interceptor is likely the culprit. And in my case this was indeed what was causing the strange behavior.

When you handle the requestError or the responseError for a interceptor and you wish to pass the error on to the next handler you must use the promise api to reject the message:

$httpProvider.interceptors.push(function($q) {
  return {
   'requestError': function(rejection) {
        // handle same as below
    },

   'responseError': function(rejection) {
      if (canRecover(rejection)) {
		 // if you can recover then don't call q.reject()
         // will go to success handlers
         return responseOrNewPromise;
      }

	  // !!Important Must use promise api's q.reject()
	  // to properly implement this interceptor
	  // or the response will go the success handler of the caller
      return $q.reject(rejection);
    }
  };
});

In my case the return $q.reject(rejection) was missing causing the message to go to the success handler. The documentation does not make this explicitly clear. If you are new to angular or not familiar with how the promise api works it is easily left off. This is a quick fix but can be quite confusing when first encountered.