FYI, You Can’t Store Objects in HTML5 Web Storage

The following won’t work, because sessionStorage and localStorage will only store strings: var myObject = { bar: ‘baz’ }; sessionStorage.setItem(‘foo’, myObject); sessionStorage.getItem(‘foo’); // Returns ‘[object Object]’ localStorage.setItem(‘foo’, myObject); localStorage.getItem(‘foo’); // Returns ‘[object Object]’ Solution = JSON.stringify() The solution is to stringify your object: var myObject = { bar: ‘baz’ }; sessionStorage.setItem(‘foo’, JSON.stringify(myObject)); JSON.parse(sessionStorage.getItem(‘foo’)); // Returns […]

Use Font Awesome on Yeoman AngularJS Projects

By default, the bootstrap-sass package uses a glyphicons png file for icons. This is a limited set of icons and I usually need more. Here’s how: The 4.x.x Way Updated 11/08/2013 Bootstrap your project: $ yo angular myApp Install Font Awesome: $ bower install font-awesome –save Add Bootstrap to the top of main.scss @import “bootstrap-sass/lib/bootstrap”; […]

Install Latest Unstable AngularJS Using Bower

By default, Yeoman’s Generator Angular sets up your app to install the stable version of AngularJS and it’s dependencies. But if you want the latest and greatest you have to use one of the many separate repos that nice people have created to store the unstable branches. Here’s a working bower.js file that fetches AngularJS version […]

Enable e2e Testing with Yeoman Generator Angular

The speed of development on all these tools is going so fast that this post is bound to be obsolete by the time I’m done typing, but end-to-end testing in AngularJS is too important to ignore. I want it now! And this how I got it: 1. Create a /test/e2e/ directory I’m running two separate […]

Find the Size of Files and Directories in Terminal

du (Disk Usage) is a super handy command line tool to list file sizes.  Common usage goes something like this: du -h /path/to/directory Which recursively lists all files in the directory in human readable forms. These are the switches I find most useful: du -skhc /path/to/directory – c, –total Produce a grand total -h, –human-readable […]

Install Node on Ubuntu 12.10 as User

Update 7/31/2014: The good news is I can confirm this method still works on a fresh Linux Mint 17 “Qiana” install. However, you need to install the following dependencies first: $ sudo apt-get install build-essential openssl libssl-dev pkg-config — OMG, this could be the first time I’ve ever been able to post a link to […]

Install Node.js v0.8.17 on Webfaction

First follow the instructions for “Installing the latest version of tar” and “Save the new PATH” here : When I followed those instructions, installing tar went fine, but installing Node failed.  Here’s how I made it work: Install Node.js v0.8.17 cd $HOME/src wget tar -xvf node-v0.8.17.tar.gz cd node-v0.8.17 Using your favorite editor, open the files configure and […]