Retain Console History using Angular’s $log

I’ve started wrap up on a substantial, Angular project that is now being used in production by customers. Overall, the app is working beautifully and errors are limited. I am recording errors to a server side database and I’ve noticed there’s been ‘digest already in progress‘ errors on one of the views. Although I’ve taken steps to try and get around those issues, I haven’t been able to pinpoint how the user is causing those errors.

I began trying to devise a way to track a user as they interact with the application, then use this information to help debug the errors. After poking around the internet, I wanted to use Angular’s  $log (docs) module to not only write messages to the console, but retain those messages. Then, write them to the server when an error occurs. I figured out that this behavior can be easily added without having to touch the window’s  console object by decorating the  $log module. Continue reading

Top Reads November 2014

This time around I’m going to try and give a bit more context on each of things I want to share. I figured you guys would appreciate that more than just a list of links. I read and find quite a bit that I want other people to be aware of as well. Here are the top reads of articles, libraries, and websites that I found cool or useful for the past month. Enjoy! Continue reading

Beginner Node.js – Part 3: NPM

In the third installment of my beginner Node.js series, we will discuss the Node Package Manager, or NPM for short. If you missed the first two parts, make sure to go back and give them a quick read (part 1, part 2).

If you are familiar with other languages like Ruby or .Net, they come with a form of pulling in contained functionality through package managers. Ruby has its gems, .Net has Nuget, and Python has pip. Even operating systems now have their own package managers with OSX having Homebrew and Windows 10 now having its own.

NPM LogoNode’s is aptly named, Node Package Manager. We will go over the basics and hopefully become more familiar with working with it as it will become a crucial component of creating apps in Node. As of this post, there are currently over 100,000 packages in the NPM repository that are at your fingertips.

Continue reading

My Struggles with TDD

If you’ve spent any amount of time being a developer, I’m sure you’ve heard of TDD, or Test-Driven Development. The point of TDD is that you write a failing test first, write the code to make the test pass, refactor the code, and then repeat. All programming languages can follow this pattern to create well-constructed code. It also allows you to do more refactoring down the road and make sure that the changes don’t break other aspects of the application. Continue reading