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.
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:
chocoinstallgit
The above command installs the latest version of Git for Windows. And you don’t have to click through the installer.
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):
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:
Download and run RunBoxstarterInstall.bat (only works with IE as default browser but since this for a fresh Windows computer that is ok)
This will launch a download for an executable.
Run the executable it will download, install, and configure all programs in 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?
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.
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 hereif(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 handlersreturnresponseOrNewPromise;}// !!Important Must use promise api's q.reject()// to properly implement this interceptor// or the response will go the success handler of the callerreturn$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.
If you are using cookie authentication in ASP.NET Identity 2.1, there are two timeout settings that look similar upon first glance, ValidateInterval and ExpireTimespan:
CookieAuthenticationOptions.ExpireTimespan is the option that allows you to set how long the issued cookie is valid for. In the example above, the cookie is valid for 30 minutes from the time of creation. Once those 30 minutes are up the user will have to sign back in becuase the SlidingExpiration is set to false.
If SlidingExpiration is set to true then the cookie would be re-issued on any request half way through the ExpireTimeSpan. For example, if the user logged in and then made a second request 16 minutes later the cookie would be re-issued for another 30 minutes. If the user logged in and then made a second request 31 minutes later then the user would be prompted to log in.
SecurityStampValidator Validation Interval
The validateInterval of the SecurityStampValidator.OnValidateIdentity function checks the security stamp field to insure validity of the cookie after the given internval. This is not the same as checking expiration of the cookie, although it can cause the same result of being logged out.
The Security Stamp is created anytime a password is created/changed or an external login is added/removed. If a user changes their password then the SecurityStamp will be updated. This results in any cookie that might have been issued previous to the password change to become invalid the next time the validateInterval occurs.
For a concrete example using the above settings (this is a unlikely example but gets the point across):
User signs in at location A.
Same User changes work stations and signs in 10 minutes later at location B.
Same User changes their password at location B at the 12 minute mark.
The Same user goes back the the work station at location A and issues a request at the 20 minute mark.
Since the User issued a request after the validateInterval at location A they will be signed-out and prompted for their credentials again.
When the user is signed out in this scenario it is different from the the cookie timing out because the 30 minute Expire Time Out was never reached. Yet the user is logged out because the validateInterval of the SecurityStampValidator.OnValidateIdentity was set to 15 minutes.
The differences
The difference is subtle at first glance but provides some great benefits, such as Sign-out Everywhere. But it can be confusing since the default ASP.NET Identity template only has validateInterval leaving the ExpireTimespan hidden and set to the default of 14 days. Without some digging a developer new to the ASP.NET Identity library might not immediately recognize that the validateInterval is not the same as expiring cookies on a given time fame.