Add Git Branch Name to Bash Prompt

When I am working on a git repository and using the command line, one of the things that I often end up checking is which git branch I am on and if there are any pending changes. How awesome would it be if the bash shell prompt, told you the branch name if the directory is part of a git repository and if there are any changes. Well, thankfully someone has done this work already and with a little bit of configuration on your part, you can implement the changes.

Read More ›

Windows 8.1 - Powershell Script to Uninstall Default Programs

When I am provisioning a new development virtual machine with vagrant, I do not need all of the Windows 8 modern applications such as bing maps, finance, skype, etc to be installed onto the virtual machine. These applications are nice on a non-virtualized machine but on a virtual machine it just uses extra resources that aren’t needed.

The base install of Windows has all of these programs installed with live tiles turned on that I don’t need. This is a huge amount of clutter in the start menu.

We will be going through 3 steps:

  1. Figure out which applications that you want to remove.
  2. Update the script with the list of applications to remove.
  3. Add the vagrant provisioning configuration to run the script when you initially run vagrant up

Read More ›

Javascript Debugging Made Easier with Sourcemaps

When you release your web site to production, you should minify and concatenate your javascript files. You will have much better performance by doing this but unfortunately debugging becomes difficult with the minified code as it shortens all of the variable and method names. Luckily there is a simple solution to tell the browser developer tools to use the original javascript files when debugging the code, called source maps.

Sourcemaps bacically are a way to map the combined/minified file back to the original file. As part of the minification process you generate a source map which holds the information about your original files. The developer tools will then parse the source map and make it appear as though you’re running unminified and uncombined files.

To generate the sourcemaps we are going to gulp with the gulp-concat, gulp-uglify, and gulp-sourcemaps modules. If you are not familiar with gulp, it is basically a javascript build system that allows you to write code to automate tasks.

Read More ›

Chrome DevTools - Hiding Vendor Scripts

The Chrome Developer tools are an amazing set of tools for debugging and trobuleshooting web sites. If you are a web developer and have not tried out these tools, you have been missing out. As amazing as the developer tools are, one of the most annoying features to me was not being able to skip over vendor javascript like jquery or angular. Getting stuck in a minified version of a angular or jquery takes you down a deep rabbit hole that you never wanted to go down and is a annoying to climb out of.

Luckily, there is a super simple solution that I learned from Jared Farris during his Chrome Developer Tools talk at the Codepalousa Conference called Black Boxing. Black boxing allows you to tell the javascript debugger to skip over the file when stepping through the code.

Read More ›

Removing the NPM spinner

One of the most annoying features of npm for me is the spinner. Many times it runs long enough that I am wondering if it is still working or hung. Thankfully you can easily change this with the .npmrc file.

Read More ›

back to top 