Jade Select Element for States

Decided to post since I can never find it when it’s needed. select(name=’State’) option(value=”, selected=’selected’) Select a State option(value=’AL’) Alabama option(value=’AK’) Alaska option(value=’AZ’) Arizona option(value=’AR’) Arkansas option(value=’CA’) California option(value=’CO’) Colorado option(value=’CT’) Connecticut option(value=’DE’) Delaware option(value=’DC’) District Of Columbia option(value=’FL’) Florida option(value=’GA’) Georgia option(value=’HI’) Hawaii option(value=’ID’) Idaho option(value=’IL’) Illinois option(value=’IN’) Indiana option(value=’IA’) Iowa option(value=’KS’) Kansas option(value=’KY’) […]

Bang Bang Boolean

When I gazing upon the all mighty “bang bang”. I felt need to blog the result to wire it back into my head. !!false === false //true !false === false //false !!true === false //false !true === false //true That’s it for now. Update 10/21/13: Funny I’ve been using !! much more frequently since this […]

NPM Commands You Need to Know

I’ve been playing with nodejs on and off for a couple years. Over the last few months I’ve dedicated substantial time to really focusing on the software and shocked at how easy NPM is and how amazingly powerful it’s reach is. Here are a few useful NPM tips if you are starting out with nodejs: […]

Javascipt Object.keys()

I was peer coding yesterday when my peer suggested that I use keys to get the length of the object node. I felt like a noob since I hadn’t directly used the method before. Here is a gist of me playing with the JSON Example from Doug Crockfords site ~ $node > var x= {“glossary”:{“title”:”example […]

Upload and Display Image Using NodeJS and Express w/Jade

The following code will allow an image to upload and then display on a NodeJS server with Express middleware. Remember to add this to the config: The following is needed to keep the image file extension and provide a directory for Express to write to. Alternatively the image will be uploaded to a .temp directory. […]

Connect locahost to MongoLab.com

Instructions for setting up Mongolab.com with your localhost. Create Mongolab.com account If you don’t have homebrew installed, install it. Install MongoDB with homebrew: $brew update brew install mongodb Create DB on mongoLab.com Create DB user Select connections tab and copy the connection type you need Update Usr and Pass credentials Connect to DB

Javascript “use strict”

Javascript “use strict” is recommended for most JS implementations now. Here is how to use it on your JS files. Client Side Methods to Invoke Strict Method: Have the Entire File Strict (function () { “use strict”; //entireFile will be strict }()); Have a single function be Strict // Non-strict code var withinFile = function […]

Yeah, Top 10 Time!

I’ve been laying low on the bloggin’ recently, last night I went “beast” and played around with some fun stuff with the terminal, packet managers, NPM’s and a new IDE. Here’s the list of 10 things you can’t not be using on the web. HomeBrew Grunt Mongolab Angularjs Finally had a chance to play around […]