<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>David Dripps</title>
	
	<link>http://www.daviddripps.com</link>
	<description>Musings of an entrepreneur, techie, and all around cool guy</description>
	<lastBuildDate>Tue, 14 May 2013 17:09:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/DavidDripps" /><feedburner:info uri="daviddripps" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>DavidDripps</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>I’m Wanted By The Law</title>
		<link>http://feedproxy.google.com/~r/DavidDripps/~3/mBsi5CLYbHQ/</link>
		<comments>http://www.daviddripps.com/2013/05/14/im-wanted-by-the-law/#comments</comments>
		<pubDate>Tue, 14 May 2013 17:09:16 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Personal Life]]></category>

		<guid isPermaLink="false">http://www.daviddripps.com/?p=812</guid>
		<description><![CDATA[I didn&#8217;t realize it until today, and it didn&#8217;t happen intentionally, but I&#8217;m kind of a badass. As I write this, the Palo Alto police are running my fingerprints in connection with a domestic disturbance. What am I doing? Boarding flight after flight fleeing California for the East Coast. Catch me if you can, coppers! [...]]]></description>
				<content:encoded><![CDATA[<p>I didn&#8217;t realize it until today, and it didn&#8217;t happen intentionally, but I&#8217;m kind of a badass. As I write this, the Palo Alto police are running my fingerprints in connection with a domestic disturbance. What am I doing? Boarding flight after flight fleeing California for the East Coast. Catch me if you can, coppers!</p>
<h3>No Good Deed&#8230;</h3>
<p>I scheduled a flight really early this morning. I drove straight from the club in San Francisco, grabbed my suitcase, and walked outside to wait for the shuttle. I had some time so I walked over to a friend&#8217;s apartment to make sure everything looked to be in order. She was out of town&#8230;or so I thought. So I walk around, jiggle the door handles, make sure everything&#8217;s locked and nothing looks suspicious. Turns out, the only thing that looked suspicious was a guy walking around jiggling door handles at 4am! The truly unfortunate part is that they were not out of town. They were sitting in bed, mortified after being awoken by a burglar.</p>
<h3>iMessage Could Get You Arrested</h3>
<p>This post should probably be titled &#8220;Don&#8217;t use iMessage. It can get you arrested.&#8221; You see, my iMessage is all kinds of screwed up. I hate it. I send a message from my laptop that never appears on my phone. Sometimes people send me a message and it gets marked as read on my phone, but never shows in the OSX app either. All kinds of stuff goes wrong.</p>
<p>After being terrorized by a break in attempt, she texts a few friends. Makes sense. What doesn&#8217;t make sense is how my phone handled the message. The message came in as a text message because some people on the thread don&#8217;t have iPhones. I respond within minutes saying it was me, not a burglar. It sends as an iMessage, but only to her. Not as a text message, and not to the group. Since no one else on the group message saw my reply, it sounded really serious. They&#8217;re good friends so they called the police.</p>
<p>The cops dusted for fingerprints. Mine are at the &#8220;scene of the crime&#8221; because I was the one unknowingly terrorizing my best friend. The cops called back afterwards, and they were told it&#8217;s a misunderstanding. They can&#8217;t take the chance of the victim having been coerced so they&#8217;re running the fingerprints through the system anyway.</p>
<p>John McAfee would probably recommend I take a vacation about now. Belize maybe.</p>
<h3>Another Good Story</h3>
<p>I&#8217;m not really worried about it. It&#8217;s stuff like this that you tell at dinner a few weeks later and everyone laughs about.</p>
<p>In fact, after rejoining the group message thread, talking about the cops, and joking about all the ways to break out of prison when I get caught; my biggest concern should probably be Homeland Security waiting for me at Dulles. (doh, I just gave away my final destination&#8230;or did I?) I&#8217;m pretty sure my phone is flagged as suspicious or whatever at this point.</p>
<p>Good stories are worth it. I&#8217;ve had so many cool experiences lately, and I never take the time to write them down. Hopefully this one is the starting point for changing that.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DavidDripps?a=mBsi5CLYbHQ:y0Nqo4R5PTQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DavidDripps?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DavidDripps?a=mBsi5CLYbHQ:y0Nqo4R5PTQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DavidDripps?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DavidDripps/~4/mBsi5CLYbHQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.daviddripps.com/2013/05/14/im-wanted-by-the-law/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.daviddripps.com/2013/05/14/im-wanted-by-the-law/</feedburner:origLink></item>
		<item>
		<title>It Keeps On Giving</title>
		<link>http://feedproxy.google.com/~r/DavidDripps/~3/VGvFHs5cooc/</link>
		<comments>http://www.daviddripps.com/2013/05/10/it-keeps-on-giving/#comments</comments>
		<pubDate>Fri, 10 May 2013 19:30:24 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Personal Life]]></category>
		<category><![CDATA[Startup Life]]></category>
		<category><![CDATA[Chick Approved]]></category>

		<guid isPermaLink="false">http://www.daviddripps.com/?p=800</guid>
		<description><![CDATA[We&#8217;re approaching the one year anniversary of the Chick Approved acquisition. There&#8217;s no new money coming in, no new press releases with my name in them, and nothing being done with the site. Yet the experience keeps on giving. I just got a huge dose of joy and nostalgia from a memory I forgot I [...]]]></description>
				<content:encoded><![CDATA[<p>We&#8217;re approaching the one year anniversary of the <a title="Crunchbase Profile" href="http://www.crunchbase.com/company/chick-approved" target="_blank">Chick Approved</a> acquisition. There&#8217;s no new money coming in, no new press releases with my name in them, and nothing being done with the site. Yet the experience keeps on giving. I just got a huge dose of joy and nostalgia from a memory I forgot I ever made.</p>
<figure class="full-width-mobile alignleft thin" style="width: 320px;"><a href="http://wordpress.daviddripps.com/wp-content/uploads/2013/05/hop-munk-bar-stool.png" class="fancybox" title=""><img alt="" src="http://wordpress.daviddripps.com/wp-content/uploads/2013/05/hop-munk-bar-stool.png" class="wp-image-805" /></a></figure>
<p>I was sitting at <a href="http://www.hopmonk.com/sebastopol/" target="_blank">Hop Monk</a> a few nights ago with my oldest California friend, Silke. We were just grabbing dinner and catching up when she randomly said, &#8220;Do you remember that one time when you were sketching Chick Approved ideas on a napkin at the bar when I met up with you?&#8221; Whoah! Whirlwind of emotion. Over 2.5 years ago I was sitting at the bar a few feet away waiting for Silke to finish work and meet me for dinner. Chick Approved was still just an idea. No users. No website. It wasn&#8217;t even the same concept it eventually became. It was all I could think about. I was so excited. Every free minute was spent fleshing out the idea. I grabbed a beer and a napkin and started sketching ideas (I always have a pen on me so napkins are often my mind&#8217;s canvas). That napkin, which I desperately wish I&#8217;d kept now, had the general layout for the site&#8217;s first <a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller" target="_blank">models</a>.</p>
<p>It&#8217;s kinda hard to describe the emotion. It&#8217;s amazing though. Even as I&#8217;m writing this my chest gets tight, tears swell behind my eyes, and I feel <em>it</em>. Nostalgia? Probably, but what does that even mean? It aches like remembering lost love, but it&#8217;s not sad. It&#8217;s definitely elation, but not just happiness. A little bit of pride. Whatever it is, it&#8217;s powerful and feels really good. It makes me want to work harder. I can&#8217;t wait to feel it again.</p>
<p>I&#8217;m convinced I wouldn&#8217;t feel this way about anyone else&#8217;s idea. I&#8217;m fairly certain you won&#8217;t either. So start something. Even when the project is long gone&#8230;it keeps on giving.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DavidDripps?a=VGvFHs5cooc:y0_UKSGZ9oE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DavidDripps?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DavidDripps?a=VGvFHs5cooc:y0_UKSGZ9oE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DavidDripps?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DavidDripps/~4/VGvFHs5cooc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.daviddripps.com/2013/05/10/it-keeps-on-giving/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.daviddripps.com/2013/05/10/it-keeps-on-giving/</feedburner:origLink></item>
		<item>
		<title>For MySQL: Goodbye NodeJS, Welcome Back PHP</title>
		<link>http://feedproxy.google.com/~r/DavidDripps/~3/4rRVNwaIJf8/</link>
		<comments>http://www.daviddripps.com/2012/10/10/mysql-support-goodbye-nodejs-welcome-back-php/#comments</comments>
		<pubDate>Wed, 10 Oct 2012 18:00:56 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Doctrine]]></category>
		<category><![CDATA[EloquentORM]]></category>
		<category><![CDATA[Github]]></category>
		<category><![CDATA[Laravel]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[node-mysql]]></category>
		<category><![CDATA[NodeJS]]></category>
		<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[PDO]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[sequelize]]></category>
		<category><![CDATA[ZendDB]]></category>

		<guid isPermaLink="false">http://www.daviddripps.com/?p=712</guid>
		<description><![CDATA[Talk about words you never thought you&#8217;d hear yourself saying! If you&#8217;ve ever worked with me (or probably even spoken with me) you know I love Node.js. I love everything about it&#8230;Javascript, the frameworks, the community, everything. I&#8217;m especially fond of the trend toward NoSQL data stores in combination with Node. Having used one or more NoSQL [...]]]></description>
				<content:encoded><![CDATA[<p>Talk about words you never thought you&#8217;d hear yourself saying!</p>
<p>If you&#8217;ve ever worked with me (or probably even spoken with me) you know I <em>love</em> Node.js. I love everything about it&#8230;Javascript, the frameworks, the community, everything. I&#8217;m especially fond of the trend toward <a class="zem_slink" title="NoSQL" href="http://en.wikipedia.org/wiki/NoSQL" rel="wikipedia nofollow" target="_blank">NoSQL</a> data stores in combination with Node.</p>
<p>Having used one or more NoSQL databases in my last few projects, I know they&#8217;re fast, usually Javascript based, and <strong>the absolute wrong choice </strong>for a project I just started. The right choice: a relational database. MySQL being my choice.</p>
<p>I&#8217;m not going to go into why that&#8217;s the right choice, or <a title="MySQL" href="http://www.mysql.com/" rel="homepage nofollow" target="_blank">MySQL</a> over <a class="zem_slink" title="PostgreSQL" href="http://www.postgresql.org" rel="homepage nofollow" target="_blank">PostgreSQL</a>, or <a class="zem_slink" title="InnoDB" href="http://en.wikipedia.org/wiki/InnoDB" rel="wikipedia nofollow" target="_blank">InnoDB</a> over <a class="zem_slink" title="MyISAM" href="http://en.wikipedia.org/wiki/MyISAM" rel="wikipedia nofollow" target="_blank">MyISAM</a>. There are a number of reasons, but it mostly comes down to the project requirements and personal preference.</p>
<figure class="full-width-mobile aligncenter thin" style="width: 480px;"><img alt="FTW!" src="http://wordpress.daviddripps.com/wp-content/uploads/2012/10/phpmysql.jpeg" class="wp-image-741" /><figcaption>FTW!</figcaption></figure>
<h3></h3>
<h3>What does it matter? Isn&#8217;t the database independent of the scripting language?</h3>
<p>Yes and no. They&#8217;re independent systems, but we still need drivers to interface between them. That&#8217;s where the problem lies.</p>
<p>With the focus on NoSQL data stores, I don&#8217;t think anyone has taken the time to write a performant MySQL driver. The situation gets even worse with ORMs and worse still with newer versions of Node. Most of the solutions I found don&#8217;t support Node 0.7.x.</p>
<p>Wanting desperately to &#8220;make it work,&#8221; I spent some time this weekend comparing different combinations of Node drivers and frameworks/ORMs with those available in PHP.  PHP is the clear winner.</p>
<pre class="brush: bash; title: ; notranslate">
+----------------------+--------+-------+-------+-------+-------+
| Driver/ORM           | Type   | Run 1 | Run 2 | Run 3 |Average|
+----------------------+--------+-------+-------+-------+-------+
| NodeJS_mysql         | driver | 4.53  | 4.58  | 4.65  | 4.58  |
| NodeJS_sequelize     | orm    | 11.64 | 11.70 | 11.74 | 11.69 |
| PHP_PDO              | driver | 2.14  | 2.21  | 2.21  | 2.18  |
| PHP_laravel_raw      | driver | 3.33  | 3.37  | 3.38  | 3.36  |
| PHP_laravel_eloquent | orm    | 4.52  | 4.38  | 4.37  | 4.42  |
| PHP_doctrine         | orm    | 2.43  | 2.44  | 2.54  | 2.47  |
| PHP_zenddb           | driver | 2.39  | 2.48  | 2.48  | 2.45  |
+----------------------+--------+-------+-------+-------+-------+
</pre>
<p>If you&#8217;re wondering how I arrived at those results, <a href="https://github.com/daviddripps/MySQL-Driver-ORM-Tests" target="_blank">the repo</a> is on GitHub. Feel free to fork it f you have another driver or ORM you think should be included.</p>
<h3></h3>
<h3>The Point</h3>
<p>Pick the right tool for the right job. Look at the results above. <strong>The right tool for MySQL is <em>not</em> Node</strong>. Not yet anyway.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DavidDripps?a=4rRVNwaIJf8:BxkW1-_qH6w:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DavidDripps?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DavidDripps?a=4rRVNwaIJf8:BxkW1-_qH6w:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DavidDripps?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DavidDripps/~4/4rRVNwaIJf8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.daviddripps.com/2012/10/10/mysql-support-goodbye-nodejs-welcome-back-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.daviddripps.com/2012/10/10/mysql-support-goodbye-nodejs-welcome-back-php/</feedburner:origLink></item>
		<item>
		<title>Test-Driven HTML Part 2: Head Is Good</title>
		<link>http://feedproxy.google.com/~r/DavidDripps/~3/jk2jFK5DS0w/</link>
		<comments>http://www.daviddripps.com/2012/09/12/test-driven-html-part-2-head-is-good/#comments</comments>
		<pubDate>Wed, 12 Sep 2012 17:00:47 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Test-Driven Development]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Github]]></category>

		<guid isPermaLink="false">http://www.daviddripps.com/?p=540</guid>
		<description><![CDATA[Who doesn&#8217;t love head? I do. Whether or not you do, it&#8217;s an important component of our testing process. In my last post we set up our linting and used BusterJS to TDD our HTML in an instance of PhantomJS, a headless browser. Unfortunately, the real world isn&#8217;t all sunshine and webkit. That&#8217;s why we need to [...]]]></description>
				<content:encoded><![CDATA[<p>Who doesn&#8217;t love head? I do. Whether or not <em>you</em> do, it&#8217;s an important component of our testing process. In my <a title="Test-Driven HTML: Why and How" href="http://www.daviddripps.com/2012/08/09/test-driven-html-why-and-how/">last post</a> we set up our linting and used BusterJS to TDD our HTML in an instance of PhantomJS, a headless browser. Unfortunately, the real world isn&#8217;t all sunshine and webkit. That&#8217;s why we need to test in real, GUI-ful browsers with all their quirks and differences&#8230;yes&#8230;head. You know you love it!</p>
<p>On a decently fast computer, the speed difference between running your tests in PhantomJS alone and also running them in IE, FF, and Chrome is negligible. Due to the forethought of the developers, we can actually test all of our browsers with the current setup. Once our buster server is running (see <a title="Test-Driven HTML: Why and How" href="http://www.daviddripps.com/2012/08/09/test-driven-html-why-and-how/" target="_blank">Part 1</a>) we can connect all the clients we&#8217;d like to test to localhost:1111. In my relentless pursuit of automation I use the script below to automate opening the browsers and connecting to the Buster server (OSX only for now, sorry).</p>
<pre class="brush: bash; title: ; notranslate">
#!/usr/bin/env bash

open -a 'firefox' 'http://localhost:1111/capture'
open -a 'opera' 'http://localhost:1111/capture'
#using PhatomJS so I don't run these on every test
open -a 'google chrome' 'http://localhost:1111/capture'
open -a 'safari' 'http://localhost:1111/capture'
</pre>
<p>Very simply, this script opens my browsers and navigates them to <code>http://localhost:1111/capture</code>. The <code>/capture</code> endpoint is simply a shortcut for clicking the &#8220;Capture Browser&#8221; button &#8211; this way the browsers open and immediately start listening for tests. I also use <a href="https://www.virtualbox.org/" target="_blank">VirtualBox</a> with <a href="http://osxdaily.com/2011/09/04/internet-explorer-for-mac-ie7-ie8-ie-9-free/" target="_blank">IE9 on a Windows 7 VM</a> which I have to start manually and connect via IP address. Leave it to IE to be the biggest pain of them all!</p>
<p><span style="color: #ffffff; opacity: 0;">spacer</span></p>
<p style="text-align: center;"><figure class="full-width-mobile  thin" style="width: 464px;"><a href="http://shoze.blogspot.com/" target="_blank"><img alt="" src="http://4.bp.blogspot.com/-BgoDow9U3v0/T711pXTM_LI/AAAAAAAABDc/QX_-isQQl7U/s1600/BW_non-branded_small.jpg" class="" /></a></figure></p>
<p><span style="color: #ffffff; opacity: 0;">spacer</span><br />
<strong>Personal Note:</strong> I&#8217;m an NPM junkie so I use the package.json scripts to start the Buster server, PhantomJS, and my browsers. This way, everything is setup at once with a quick &#8220;<code>npm start</code>&#8220;. See the package.json in the Github repo if you&#8217;re interested in a similar setup.<br />
<span style="color: #ffffff; opacity: 0;">spacer</span></p>
<h3>Consolidate Our Various Tests</h3>
<p>Ok, we know we need to lint our code, we know we need to test our code, and we know we need to do this a hundred+ times a day. What we need is one command to do both so we can UP-Enter or setup our IDE to run it for us. If you&#8217;re looking at the Github repo then you&#8217;ll find it in package.json for easy execution with &#8220;<code>npm test</code>&#8220;, but if you didn&#8217;t&#8230;things are about to get real! Here&#8217;s the script:</p>
<pre class="brush: bash; title: ; notranslate">
#!/usr/bin/env bash
jake lint
buster test
</pre>
<p>Whew! Did you get all that? I&#8217;m exhausted. j/k. Looks simple enough, right?</p>
<p>That works, but by the same thought process that we relentlessly refactor our code after testing, I&#8217;m gonna consolidate our configs a little bit. After adding the <a href="https://github.com/TDDHTML5/tddhtml5-html-lint" target="_blank">tddhtml5-html-lint</a> and <a href="https://github.com/TDDHTML5/tddhtml5-html-buster" target="_blank">tddhtml5-html-buster</a> repos I copied all the files into the root directory so I could run the script above. This leaves us with buster.js and config.js which essentially do the same thing: hold config data. Since Buster is particular in how the config is retrieved I had to leave that file, but we can move the Buster config into config.js and just import the config into buster.js. Now we have one file with all of our testing configs.</p>
<p><strong>buster.js</strong></p>
<pre class="brush: jscript; title: ; notranslate">

var config = require(__dirname + '/config');
module.exports = config.buster;

</pre>
<p><strong>config.js</strong></p>
<pre class="brush: jscript; title: ; notranslate">

var fs = require('fs');

module.exports = {
  lint: { ... },

  buster: {
    html: {
      //set our root path to be the project root
      rootPath: '../../',
      environment: &quot;browser&quot;,
      libs: [
        //bring in jQuery
        &quot;lib/*.js&quot;
      ],
      tests: [
        //load our test files
        &quot;test/*.test.js&quot;
      ],
      resources: [
        { path: &quot;/&quot;, content: fs.readFileSync('src/index.html') },
        { path: &quot;/form&quot;, content: fs.readFileSync('src/form.html') }
      ]
    }
  }
};

</pre>
<p><span style="color: #ffffff; opacity: 0;">spacer</span><br />
In an effort to keep my posts shorter than usual, I&#8217;m going to stop there <img src='http://wordpress.daviddripps.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<span style="color: #ffffff; opacity: 0;">spacer</span></p>
<h3>Question About Testing Tools</h3>
<p>Prior to hearing about BusterJS a month or so ago, I used JsTestDriver quite extensively. Are there any other test frameworks/harnesses that make frontend testing easy? I&#8217;ll talk about Selenium and browser automation in a later post, but I don&#8217;t consider that TDD. It takes a while to run so you generally have to write your implementation first to save the time of watching the tests fail.</p>
<p>Has anyone had success with other technologies?</p>
<hr />
<p>If you enjoyed this post, <a title="Follow me on Twitter" href="http://twitter.com/#!/daviddripps" target="_blank">please follow me on Twitter.</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DavidDripps?a=jk2jFK5DS0w:SqJJq2vIgD4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DavidDripps?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DavidDripps?a=jk2jFK5DS0w:SqJJq2vIgD4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DavidDripps?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DavidDripps/~4/jk2jFK5DS0w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.daviddripps.com/2012/09/12/test-driven-html-part-2-head-is-good/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.daviddripps.com/2012/09/12/test-driven-html-part-2-head-is-good/</feedburner:origLink></item>
		<item>
		<title>Test-Driven HTML: Why and How</title>
		<link>http://feedproxy.google.com/~r/DavidDripps/~3/ut6zAX_gdGA/</link>
		<comments>http://www.daviddripps.com/2012/08/09/test-driven-html-why-and-how/#comments</comments>
		<pubDate>Thu, 09 Aug 2012 08:31:58 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Test-Driven Development]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[BusterJS]]></category>
		<category><![CDATA[Christian Johansen]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Functional Testing]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Jake]]></category>
		<category><![CDATA[Jakefile]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Learnboost]]></category>
		<category><![CDATA[Linting]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[TJ Holowaychuk]]></category>
		<category><![CDATA[Tobi]]></category>
		<category><![CDATA[Unit Testing]]></category>
		<category><![CDATA[ZombieJS]]></category>

		<guid isPermaLink="false">http://www.daviddripps.com/?p=515</guid>
		<description><![CDATA[I&#8217;ve been racking my brain for a week straight on the best way to employ test-driven principles to HTML. Hell, I&#8217;ve been trying to figure out if it even can be done. Trying to figure out if it&#8217;s even worth it. Mostly through blind faith, I&#8217;ve come up with the beginning of what I hope [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been racking my brain for a week straight on the best way to employ test-driven principles to HTML. Hell, I&#8217;ve been trying to figure out if it even <em>can</em> be done. Trying to figure out if it&#8217;s even worth it. Mostly through blind faith, I&#8217;ve come up with the beginning of what I hope becomes a winning strategy for test-driven HTML development.</p>
<p>&#8220;&#8230;the beginning of what I hope becomes a winning strategy&#8230;&#8221; – lol, how&#8217;s that for confidence <img src='http://wordpress.daviddripps.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<figure class="full-width-mobile  thin" style="width: 300px;"><img alt="" src="http://wordpress.daviddripps.com/wp-content/uploads/2012/08/TDDHTML5-logo.gif" class="wp-image-619" /></figure></p>
<h3>What Exactly Are We Testing?</h3>
<p>The look and feel of the UI is handled through CSS. If you&#8217;re still using tables for layout then there may be more value here for you, but if that&#8217;s the case, seriously, stop reading this right now and catch up on the last 15 years of web design. We&#8217;ll be waiting. Ok, back to 2012. If the &#8220;look and feel&#8221; are handled by CSS and the fancy stuff is handled by Javascript (e.g. AJAX, client-side form validation, image sliders, etc), then what&#8217;s left to test?</p>
<ol>
<li>Do your links go where they&#8217;re suposed to? &#8211; because you&#8217;re dedicated to unobtrusive Javascript, <em>all</em> your links have an HREF attribute, right?</li>
<li>Do your view templates render their content into the right DIV?</li>
<li>Do your forms redirect appropriately when submitted? &#8211; or not redirect as the case may be</li>
<li>Do portions of your home page fail to load when you change the JSON output of a seemingly unrelated API endpoint (that happened to me)</li>
<li>Most importantly, <strong>can you refactor your views and layouts with confidence?</strong></li>
</ol>
<p>If you can already answer &#8220;yes&#8221; to the questions above, then skip testing your HTML. It&#8217;s not necessary. I don&#8217;t say that rhetorically either; it&#8217;s possible to manually test your site in such a way that you can answer &#8220;yes&#8221; to everything on that list. My guess is you are the minority, however. Personally, I <em>hate</em> debugging. It&#8217;s time consuming, and it&#8217;s usually a bug caused by a missing semicolon or something stupid. I want to spend my time solving problems, not manually linting code. Hence my obsession with testing. I&#8217;ve saved countless hours over the past few months due to <strong>well thought out, well written, and automated</strong> tests. Now you can too.</p>
<h3>Linting</h3>
<p><a href="http://en.wikipedia.org/wiki/Lint_(software)" target="_blank">Linting</a> is a given, or at least it should be. Make sure your code is clean. Again, this can be done manually by copy/pasting your HTML into one of the dozens of HTML linting websites and clicking &#8220;Go&#8221;. For the ambitiously lazy people like myself, we <em>automate</em>. I use Perl&#8217;s HTML::Lint (easily installed using CPAN) in a simple script that I run with a <a href="https://github.com/mde/jake/" target="_blank">Jakefile</a>. In my implementation there are a lot of config options and such that I&#8217;m leaving out for brevity; follow the <a href="https://github.com/TDDHTML5/tddhtml5-html-lint">GitHub repo</a> and I&#8217;ll eventually update it with my full code.</p>
<p><strong>Perl Script:</strong></p>
<pre class="brush: perl; title: ; notranslate">
#!/usr/bin/env perl

use strict;
use HTML::Lint;

if (@ARGV == 0) { die(&quot;You must provide a file to lint.\n&quot;); }

my $linter = HTML::Lint-&gt;new;

my $numerrors = 0;

foreach my $arg (@ARGV) {
  $linter-&gt;parse_file($arg) or die(&quot;Cannot lint file: &quot;, $arg, &quot;\n&quot;);

  if ($linter-&gt;errors &gt; 0) {
    $numerrors += scalar($linter-&gt;errors);

    foreach my $error ($linter-&gt;errors) {
      print $arg, &quot;: &quot;, $error-&gt;errtext(), &quot; at &quot;, $error-&gt;where(), &quot;\n&quot;;
    }
  } else {
    print $arg, &quot; ok.\n&quot;;
  }
}

if($numerrors &gt; 0) {
  print &quot;-----------------\n&quot;;
  print &quot;Total Errors: &quot;, $numerrors, &quot;\n&quot;;
  exit 1;
} else {
  print &quot;-----------------\n&quot;;
  print &quot;No errors found.\n&quot;;
  exit 0;
}
</pre>
<p><strong>Jakefile:</strong></p>
<pre class="brush: jscript; title: ; notranslate">

(function() {
  'use strict';

  task('default', ['lint']);

  desc('Lint our layouts, views, and templates');
  task('lint', function() {
    //get the correct files for linting
    var files = new jake.FileList();
    //including all 3 lines below may be overkill,
    // but it helps illustrate some options
    files.include('index.html');
    files.include('src/*.html');
    files.include('src/**/*.html');
    //don`t lint our tests
    files.exclude('test');

    var fileNames = files.toArray().join(' ');
    var perlLintCmds = [ 'perl ./html_lint.pl ' + fileNames];

    var exec = jake.createExec(perlLintCmds, { stdout: true });

    exec.addListener('cmdEnd', function() {
      //since we only execute 1 command we don't need to count the number
      // of commands to determine when we're done. just finish.
      complete();
    });

    exec.addListener('error', function(msg, code) {
      //just add a blank space to make the output more readable
      console.log('');
      //fail the Jake test
      fail(msg, code);
      complete();
    });

    exec.run();

  }, {async: true});
}());
</pre>
<p><strong>Run the Linter:</strong></p>
<pre class="brush: bash; title: ; notranslate">$ jake lint</pre>
<h3></h3>
<h3>Semantics And Document Structure</h3>
<p>I haven&#8217;t seen anything to test for semantically correct HTML as this would require someone to interpret the meaning of the content of your tags (highly improbable and subject to interpretation). There may be opportunity in building a markup language that expresses the intent of your content and creates the appropriate HTML tag for its components.  I envision something similar to jade, except instead of tag names preceding a line, it would be an intention descriptor.  Fun to think about, but not something I&#8217;m passionate enough about to dedicate any significant time to.  If you decide to write one though, let me know.  I&#8217;d love to contribute.</p>
<figure class="full-width-mobile aligncenter thin" style="width: 475px;"><a href="http://learn.shayhowe.com/assets/courses/html-css-guide/elements-semantics/html5.png" class="fancybox" title="Basic HTML5 Document Structure"><img alt="Basic HTML5 Document Structure" src="http://learn.shayhowe.com/assets/courses/html-css-guide/elements-semantics/html5.png" class="" /></a><figcaption>Basic HTML5 Document Structure</figcaption></figure>
<p>Testing the document structure seems kind of pointless with so many people using jade, ejs, haml, etc. I was working on a YAML interpretation of document structure that, combined with jQuery, would load a page and test the structure was correct. the YAML ended up looking a lot like jade though so I dropped it.  It felt like I was trying to employ test-driven principles to writing copy&#8230;that&#8217;s going a little overboard IMHO.</p>
<p>CSS tests catch most anything relating to the UI anyways (more on testing CSS to come). If your CSS tests are solid then anything the user actually cares about will be tested by a combination of CSS and functional testing.  Which brings use to our next topic&#8230;</p>
<h3>Functional Testing</h3>
<p>Now that we can lint our code with easy, we can start on functional testing.  <strong>Functional testing is where I see the most value in testing HTML</strong>.  So, how do we write tests first to keep our code lean and mean?  I recommend a 2-step approach.  Headless browser tests first for the sake of speed, then in-browser tests for compatibility.  If you don&#8217;t know what a headless browser is or the pros and cons of using one, please Google it real quick. I&#8217;m a huge fan of almost everything <a href="https://www.learnboost.com/" target="_blank">Learnboost</a> and <a href="http://tjholowaychuk.com/" target="_blank">TJ Holowaychuk</a> have put out for the community, so I used Tobi for a long time and I loved it, but it&#8217;s so out of date now that it&#8217;s no longer useful <img src='http://wordpress.daviddripps.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> .</p>
<p>For this project, I looked at <a href="https://github.com/assaf/zombie" target="_blank">Zombie</a>, but they really want you to run your app and test the whole stack.  Since this is unit testing, we&#8217;re looking to test the smallest portion of HTML that we can.  That&#8217;s definitely <em>not</em> the full stack.  After some research, I&#8217;ve decided to give Buster.JS a shot despite being in beta still.  It&#8217;s actively being developed by Christian Johansen who literally <a href="http://www.amazon.com/Test-Driven-JavaScript-Development-Developers-Library/dp/0321683919/ref=sr_1_1?ie=UTF8&amp;qid=1344460737&amp;sr=8-1&amp;keywords=test+driven+javascript+development" target="_blank">wrote the book</a> on Javascript TDD so I&#8217;m pretty confident it&#8217;ll work for our simple HTML tests.</p>
<p>Enough talk.  How do we get rolling with test-driven HTML?  First install NodeJS, then create a directory and install BusterJS via NPM and download the PhantomJS binary for your system and extract it to ./lib/phantomjs. Automatic headless testing is coming to Buster, but it&#8217;s not quite there yet.  In the meantime, they&#8217;ve provided us with a handy script to configure PhantomJS for use with Buster.</p>
<p>Execute the following to start the Buster test server and an instance of PhantomJS with the correct settings.</p>
<pre class="brush: bash; title: ; notranslate">

buster server &amp;
./lib/phantomjs/bin/phantomjs ./node_modules/buster/script/phantom.js &amp;

</pre>
<p>Great, now for the <strong>Buster config file</strong>.  (I swear this is the last step before actually writing some tests).  Also, I downloaded jQuery and placed it in the ./lib folder because it makes DOM stuff really easy so we can concentrate on writing solid tests.  If you&#8217;re not using jQuery in your project, use whatever library your project is built around to ensure compatibility.</p>
<p><strong>buster.js</strong></p>
<pre class="brush: jscript; title: ; notranslate">

var fs = require('fs');

var config = module.exports;

config[&quot;TDD HTML Headless&quot;] = {
  environment: &quot;browser&quot;,
  libs: [
    //this just brings in jQuery
    &quot;lib/*.js&quot;
  ],
  tests: [
    //our test file (yet to be created)
    &quot;*.test.js&quot;
  ],
  //allows us to bring in our views without firing up a server
  //@see: http://www.kraken.no/blog/2012/03/23/injecting-html-with-busterjs/
  resources: [ { path: &quot;/form&quot;, content: fs.readFileSync('form.html') } ]
};

</pre>
<p>Finally, on to the good stuff. We&#8217;ll write our test first of course.</p>
<p><strong>form.test.js</strong></p>
<pre class="brush: jscript; title: ; notranslate">

buster.testCase('Login Form', {
  setUp: function(done) {
    var self = this;

    //this calls the &quot;/form&quot; route we set up in the &quot;resources&quot; section
    // of our config file above and reads in the HTML from &quot;form.html&quot;
    $('body').load(buster.env.contextPath + '/form', function() {
      //use jQuery to grab our form element
      self.$form = $('form#login');
      done();
    });
  },

  //the simple tests are always the best, make sure the form exists
  'exists': function() {
    //since jQuery represents selectors as arrays, this will always exist, so
    // we'll test the length to make sure there's an element in the selector
    assert(this.$form.length);
  }
});

</pre>
<p><strong>To run our test, we type</strong></p>
<pre class="brush: bash; title: ; notranslate">$ buster test</pre>
<p>&#8230;and we get something that looks like this&#8230;</p>
<pre class="brush: bash; title: ; notranslate">

PhantomJS 1.6.1, OS X: F
  Failure: PhantomJS 1.6.1, OS X Login Form exists
  [assert] Expected 0 to be truthy

</pre>
<p>Great! It failed. Tests should always fail when you write them. Now, the HTML to fill our test.</p>
<p><strong>form.html</strong></p>
<pre class="brush: xml; title: ; notranslate">

&lt;form id=&quot;login&quot;&gt;&lt;/form&gt;

</pre>
<p>Some more tests</p>
<pre class="brush: jscript; title: ; notranslate">

'method is POST': function() {
  assert.equals('post', this.$form.attr('method').toLowerCase());
},

'action is /login.php': function() {
  assert.equals('/login', this.$form.attr('action'));
},

'has a username input first': function() {
  var $usernameInput = this.$form.children(':first');
  assert.equals('INPUT', $usernameInput.get(0).tagName);
  assert.equals('username', $usernameInput.attr('name'));
}

</pre>
<p>And the HTML for those</p>
<pre class="brush: xml; title: ; notranslate">

&lt;form id=&quot;login&quot; action=&quot;/login&quot; method=&quot;post&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;username&quot; /&gt;

</pre>
<p>&#8230;repeat until the view is complete. Remember to test the actual submission of the form, client-side validation if it adds elements to the DOM, server error handling, etc.  Check out SinonJS for stubbing server requests.  It&#8217;s written by one of the authors of Buster so it has really nice integration. Trust me, you&#8217;ll have the best night&#8217;s sleep you&#8217;ve had in a while.  Now you&#8217;re confident that the form works when it&#8217;s loaded into a layout, or several layouts as is often the case with login forms.  What happens if it doesn&#8217;t work when it&#8217;s inserted into a layout?  Well, we&#8217;ve eliminated (or significantly mitigated) the possibility that it&#8217;s a problem with the form, so it must be a conflict with something else on the page.  For that we turn to full stack testing, which is a topic for another day.  I&#8217;m thinking live browser testing should be too.</p>
<h3>Next time&#8230;</h3>
<p>Yep, this post has gotten pretty long already so I&#8217;ll go into setting up and running live browser tests in my next post.</p>
<p>Have I missed anything in testing HTML that I should consider testing?  Is there a better methodology, framework, or tool that I should be using?  Let me know your thoughts in the comments below or on <a href="https://twitter.com/daviddripps">Twitter</a>.</p>
<hr />
<p>To keep up with my latest posts, <a title="Follow me on Twitter" href="http://twitter.com/#!/daviddripps" target="_blank">please follow me on Twitter.</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DavidDripps?a=ut6zAX_gdGA:SUNjI2MO5XA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DavidDripps?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DavidDripps?a=ut6zAX_gdGA:SUNjI2MO5XA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DavidDripps?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DavidDripps/~4/ut6zAX_gdGA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.daviddripps.com/2012/08/09/test-driven-html-why-and-how/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.daviddripps.com/2012/08/09/test-driven-html-why-and-how/</feedburner:origLink></item>
		<item>
		<title>Sex, Gun Control, and Personal Responsibility</title>
		<link>http://feedproxy.google.com/~r/DavidDripps/~3/DDqRyfj1plE/</link>
		<comments>http://www.daviddripps.com/2012/08/01/sex-gun-control-and-personal-responsibility/#comments</comments>
		<pubDate>Wed, 01 Aug 2012 07:42:52 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Opinions]]></category>
		<category><![CDATA[Personal Life]]></category>
		<category><![CDATA[accountability]]></category>
		<category><![CDATA[decisions]]></category>
		<category><![CDATA[hooking up]]></category>
		<category><![CDATA[James Bond]]></category>
		<category><![CDATA[Kozy Kar]]></category>
		<category><![CDATA[struggle]]></category>
		<category><![CDATA[waterbed]]></category>

		<guid isPermaLink="false">http://www.daviddripps.com/?p=502</guid>
		<description><![CDATA[It&#8217;s been one week sine you looked at me, cocked your head to the side and said I&#8217;m angry&#8230;oops, wrong intro. Let&#8217;s try that again&#8230; It&#8217;s been one week since I wrote my very personal, very intimate blog post: I Don&#8217;t Need God. I&#8217;ve had more calls, messages, and emails than I ever thought it [...]]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s been one week sine you looked at me, cocked your head to the side and said I&#8217;m angry&#8230;oops, wrong intro. Let&#8217;s try that again&#8230; It&#8217;s been one week since I wrote my very personal, very intimate blog post: <a title="I Don’t Need God" href="http://www.daviddripps.com/2012/07/20/i-dont-need-god/">I Don&#8217;t Need God</a>. I&#8217;ve had more calls, messages, and emails than I ever thought it would garner, but all-in-all I appreciate your opinions and intend to respond to many of those messages this week. Sorry for the late response, but <em>big</em> things are afoot and I needed to attend to them first.</p>
<p>Since my post, I haven&#8217;t really put myself in a situation to be tested&#8230;until Friday tonight. Why put myself in that situation at all? Well, because I really enjoy going out, meeting people, and making memories. I decided that I would just stop getting drunk when I go out since I saw a seemingly direct correlation between nights I get wasted and nights I regretted. Turns out, it&#8217;s not the drinking&#8230;<span id="more-502"></span></p>
<figure class="full-width-mobile  thin" style="width: 260px;"><a href="http://wordpress.daviddripps.com/wp-content/uploads/2012/08/jpeg.jpeg" class="fancybox" title=""><img alt="" src="http://wordpress.daviddripps.com/wp-content/uploads/2012/08/jpeg.jpeg" class="wp-image-510" /></a></figure>
<h3>Gun Control? How About Personal Responsibility</h3>
<p>Before I get into that story though, a little background that&#8217;ll make the second story that much sweeter. Something you should know about me: <strong>I have an opinion on just about everything, often more than one at a time, and sometimes even contradicting.</strong>  However, I&#8217;m a constant proponent of personal responsibility. I believe we should hold people accountable for their own actions aside from the influences of their upbringing, society, etc. Not even a week ago we had a succinct debate about gun control in the office. I, in my typical fashion, vehemently proclaimed my opinion that gun control laws are mostly sufficient, and that personal responsibility should play the primary role in sentencing gun-related crimes. Don&#8217;t outlaw guns; teach people to express themselves in a passive way. That sentiment doesn&#8217;t necessarily resonate with the more liberal occupants of our office. Personally, I&#8217;m a talker. When I&#8217;m feeling <em>anything,</em> I talk about it&#8230;often to myself, but never resorting to violence. Not everyone has that outlet, but regardless, I&#8217;m a supporter of the rights of US citizens and, therefore, the right to bear arms.</p>
<p>I don&#8217;t own a gun. In fact, I just shot a handgun for the first time about two weeks ago. It was fun and I felt a bit like <a href="http://en.wikipedia.org/wiki/James_Bond">James Bond</a>, but I wouldn&#8217;t go out of my way to do it again. Not only do I not own a gun. I have no <em>desire</em> to own a gun. You know what else I have no desire to do? Smoke cigarettes. Both kill people. Neither should be illegal.</p>
<p>A personal note: multiple people in my immediate family own guns. Guess what&#8230;despite shooting hundreds of thousands of rounds they&#8217;ve never shot anyone. Personal responsibility &#8211; don&#8217;t point a gun at a person you moron!</p>
<figure class="full-width-mobile aligncenter thin" style="width: 300px;"><img alt="Bobby and I on the waterbed at Kozy Kar" src="http://wordpress.daviddripps.com/wp-content/uploads/2012/07/2012-07-27-21.21.51.jpg" class="wp-image-504" /><figcaption>Bobby and I on the waterbed at Kozy Kar</figcaption></figure>
<h3>The real story</h3>
<p>Saturday was my buddy Bobby&#8217;s birthday. My day was packed so I decided to take him out Friday night instead. We went to a couple places, grabbed some dinner, and ended up at a bar he insisted on: Kozy Kar. This bar is unlike anywhere you&#8217;ve ever been. I swear. It had two water beds (yes, in a bar), a jacuzzi split in half as a booth, and 70&#8242;s soft porn pictures creating a motif along the bartop, walls, and dance floor. As it usually happens when you&#8217;re out and about, you meet people. We met two girls, and I immediately offered to buy a round of drinks for the four of us. (For some reason girls feel obligated to talk to you if you buy them a drink. Don&#8217;t know why, but I&#8217;ll take it.) We started chit-chatting. Both of them are lawyers, one a public defender. (Why get a J.D. if you&#8217;re gonna work in public service. You could get a job at the post office for about $100k less in student loans, but I digress.)</p>
<p>Long story short, I wind up making out with one of them on the aforementioned waterbed to the cheers and applause of about two dozen onlookers. People were literally coming up and jeering us when we&#8217;d take a break for a minute. With rare exception, I couldn&#8217;t care less what anyone else thinks so I was just taking it in stride &#8211; also it doesn&#8217;t hurt that I like attention <img src='http://wordpress.daviddripps.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>To the point</h3>
<p>At one point during our public spectacle she asked me, &#8220;Do you carry a gun?&#8221; I was, surprisingly, not flustered by the question.<br />
&#8220;No, I&#8217;m not big on guns&#8221; I promptly responded.<br />
&#8220;You seem like someone who would carry a gun.&#8221;<br />
&#8220;Why&#8217;s that?&#8221;<br />
&#8220;I don&#8217;t know. You just do.&#8221;</p>
<p>Typical girl answer. I just took it as a testament to my masculinity, but if you know me at all you&#8217;ll realize that would be a very atypical accusation. My guess is that I was just being overly aggressive. I guess I&#8217;ll never know. *shrugs*</p>
<p>A note to women reading this: if you make out with a guy in a bar you&#8217;ll probably lose his respect. If its just for fun, go for it. Otherwise, take a goodnight kiss and then wait for a real date.</p>
<p>Reflecting back, I&#8217;m mostly ambivalent when I think about that night. I kinda feel like the man. I can count on one hand the number of times I&#8217;ve made out with a girl I met in a bar. My ego doesn&#8217;t really need a boost, but it definitely got one. On the other hand, I&#8217;m wondering if kissing, somewhat like sex, is commoditized by repetition. It&#8217;s far less intimate an action, but still, it makes me wonder. I&#8217;ll let you know if/when I find the answer.</p>
<p>Bottom line, I would carry a gun and smoke at the same time if I had the desire. I think we should be held accountable for our decisions when it comes to gun possession, smoking, and how we choose to conduct ourselves in public.  Accountable for those decisions, but also free to make them.  As for my new path towards a more respectable self, I&#8217;m counting this as a step in the right direction.  I didn&#8217;t get drunk on a Friday night bar hopping in the city, and I knew exactly what I was doing.  Was it the right decision?  Not sure yet.  Was it <em>my</em> decision.  Absolutely.</p>
<p>&nbsp;</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DavidDripps?a=DDqRyfj1plE:GjP3lRf1PGA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DavidDripps?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DavidDripps?a=DDqRyfj1plE:GjP3lRf1PGA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DavidDripps?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DavidDripps/~4/DDqRyfj1plE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.daviddripps.com/2012/08/01/sex-gun-control-and-personal-responsibility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.daviddripps.com/2012/08/01/sex-gun-control-and-personal-responsibility/</feedburner:origLink></item>
		<item>
		<title>You Don’t Get Fired For Investing In Mobile</title>
		<link>http://feedproxy.google.com/~r/DavidDripps/~3/Se8hVJS9vXA/</link>
		<comments>http://www.daviddripps.com/2012/07/21/you-dont-get-fired-for-investing-in-mobile/#comments</comments>
		<pubDate>Sat, 21 Jul 2012 18:00:30 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Startup Life]]></category>
		<category><![CDATA[Chick Approved]]></category>
		<category><![CDATA[Doug Pepper]]></category>
		<category><![CDATA[Interwest]]></category>
		<category><![CDATA[investing]]></category>
		<category><![CDATA[market lifecycle]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[venture capital]]></category>

		<guid isPermaLink="false">http://www.daviddripps.com/?p=416</guid>
		<description><![CDATA[If you&#8217;ve worked in IT for any length of time you&#8217;ve heard the phrase &#8220;You don&#8217;t get fired for buying IBM.&#8221; Why? Because at the time that phrase was coined, IBM was the biggest, most reliable computer company there was. If you take a chance on the little guy and it fails, it&#8217;s your ass. [...]]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;ve worked in IT for any length of time you&#8217;ve heard the phrase &#8220;You don&#8217;t get fired for buying IBM.&#8221; Why? Because at the time that phrase was coined, IBM was the biggest, most reliable computer company there was. If you take a chance on the little guy and it fails, it&#8217;s your ass. If you buy IBM and it fails, it was still the &#8220;smart&#8221; decision. The investing landscape in the valley is heading the same direction.</p>
<p>We were pitching a VC recently, and outlined the product, market, needs, benefits, etc. He listened politely, but made it clear that this was a market he thought was saturated and had zero potential going forward. We pressed on, eventually arriving at a slide we put little emphasis on: expansion. One of our strategies for expanding the product is a mobile app and that was only one of a few bullets on the slide.</p>
<p>Everything stopped.<span id="more-416"></span></p>
<p>What&#8217;s your plan for the mobile app? Where are you in development? I think there&#8217;s a real need there.</p>
<p>Really? A few minutes ago this market was saturated with no potential to be found. We list mobile as a bullet point and all of a sudden it&#8217;s a revolution in social sharing?</p>
<p>I&#8217;m not hating on anyone here. I&#8217;m a nerd, numbers don&#8217;t lie, if you always play the odds, you&#8217;re most likely going to come out on top. Maybe never with a big win, but probably with far fewer big losses than those who make decisions on gut instinct alone. I also understand that a VC isn&#8217;t investing his own money. When he makes the decision to invest, he has to justify it to his partners and those investors who&#8217;ve entrusted him with their hard-earned money. (The landscape for angel investors is very similar but for different reasons.)</p>
<p>There&#8217;s a <a href="http://techcrunch.com/2012/04/01/the-market-curve-the-life-cycle/">terrific article</a>  by <a href="http://www.interwest.com/interwest-team/doug_pepper.html">Doug Pepper</a> that outlines the market lifecycle and several reasons why mobile is a good bet right now.  Doug was very helpful while building <a href="http://www.crunchbase.com/company/chick-approved" target="_blank">Chick Approved</a>, and he&#8217;s one of the sharpest VCs out there so I pay attention when he shares some bits of knowledge.  I point to that article to say that I&#8217;m not opposed to mobile.  In fact, <strong>I think it&#8217;s essential to consider a mobile strategy for any new venture</strong> in almost any industry.  Still, investing in a company that you otherwise wouldn&#8217;t because they have a killer mobile strategy doesn&#8217;t make it the safe bet.  If the pitch has blatantly overlooked mobile, however, then you may want to pass on that opportunity.</p>
<p style="text-align: center;"><figure class="full-width-mobile  thin" style="width: 616px;"><img alt="" src="http://tctechcrunch2011.files.wordpress.com/2012/04/screen-shot-2012-04-01-at-9-38-09-am.png" class="" /></figure></p>
<p>To put it plainly, you&#8217;re not going to hurt my feelings by telling me you don&#8217;t like it or it&#8217;s not your cup of tea.  I&#8217;ve been doing this long enough to have built some pretty high emotional walls.  I respect the people who tell it to me straight.  I know when you&#8217;re interested and when you&#8217;re just trying to be nice.  I know when you like it, but you&#8217;re afraid of what that means so you say you aren&#8217;t.  I know it&#8217;s your job as an investor to try and make everyone like you so they come back to you with the next idea that could hit it big.  Stop it.  Stick to your guns.  If the market potential isn&#8217;t there, the mention of a mobile app isn&#8217;t going to change that.  <strong>Disclaimer:</strong> the product I was pitching isn&#8217;t focused around mobile so that statement is true.  There are many markets that can absolutely be disrupted by the introduction of a mobile solution.  I&#8217;m working on some right now <img src='http://wordpress.daviddripps.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><strong>You won&#8217;t get fired for investing in mobile, but you won&#8217;t come out ahead just because you do.</strong></p>
<p>&nbsp;</p>
<hr />
<p>If you enjoyed this post, <a title="Follow me on Twitter" href="http://twitter.com/#!/daviddripps" target="_blank">please follow me on Twitter.</a></p>
<div></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DavidDripps?a=Se8hVJS9vXA:PpdUE_5FGto:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DavidDripps?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DavidDripps?a=Se8hVJS9vXA:PpdUE_5FGto:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DavidDripps?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DavidDripps/~4/Se8hVJS9vXA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.daviddripps.com/2012/07/21/you-dont-get-fired-for-investing-in-mobile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.daviddripps.com/2012/07/21/you-dont-get-fired-for-investing-in-mobile/</feedburner:origLink></item>
		<item>
		<title>I Don’t Need God</title>
		<link>http://feedproxy.google.com/~r/DavidDripps/~3/bPXRzYgssD4/</link>
		<comments>http://www.daviddripps.com/2012/07/20/i-dont-need-god/#comments</comments>
		<pubDate>Fri, 20 Jul 2012 15:41:48 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Personal Life]]></category>
		<category><![CDATA[Christian]]></category>
		<category><![CDATA[David Daubert]]></category>
		<category><![CDATA[friendship]]></category>
		<category><![CDATA[God]]></category>
		<category><![CDATA[love]]></category>
		<category><![CDATA[religion]]></category>
		<category><![CDATA[struggle]]></category>

		<guid isPermaLink="false">http://www.daviddripps.com/?p=464</guid>
		<description><![CDATA[Let&#8217;s get this out of the way early: I&#8217;m not trying to tell anyone else how they should live their life, just sharing my struggle.  I have a lot of interests so my writing/conversations/blog tend to be all over the place, but I usually paint myself in a good light for the sake of my [...]]]></description>
				<content:encoded><![CDATA[<p>Let&#8217;s get this out of the way early: I&#8217;m not trying to tell anyone else how they should live their life, just sharing my struggle.  I have a lot of interests so my writing/conversations/blog tend to be all over the place, but I usually paint myself in a good light for the sake of my ego.  I&#8217;m gonna change it up and be real for a few minutes.  Also, I say a few minutes, but I can tell you now this is gonna be a long post.</p>
<p>At any point since I was five years old if you asked me, &#8220;Are you a Christian?&#8221; I would have said &#8220;Yes.&#8221;  In fact, someone asked me that question just a few weeks ago.  Someone I literally made a conscious decision never to lie to.  Looking back on my answer (it was via text), I&#8217;ve gotta say that I&#8217;m damn good at supporting my &#8220;Yes&#8221; answer even though it&#8217;s a lie.  So good, in fact that I convinced <em>myself</em> I was telling the truth&#8230;I wasn&#8217;t.  It was only a few days ago that I discovered this was the case though.  <strong>I&#8217;m having an identity crisis in its truest form.</strong>  A huge part of my identity for 20-something years is gone.</p>
<p>To my friends asking why I&#8217;ve been distant and non-communicative the last week: that&#8217;s why.</p>
<p>I&#8217;ve had only two conversations about it.  One is my devoutly Christian friend <a href="https://twitter.com/daviddaubert" target="_blank">David Daubert</a>.  He&#8217;s closer than a brother, knows his convictions, and loves me too much to judge.  He&#8217;s the first person I&#8217;ve ever told I wasn&#8217;t a Christian (which was weird to say).  The second was with my closest friend in California whose name I won&#8217;t mention because she wouldn&#8217;t like it.  She&#8217;s one of the most anti-religious people I&#8217;ve ever met; she literally has a negative emotional reaction when she walks by churches.  (We take walks a lot so I&#8217;ve seen it frequently.)  Despite being very different, I still love her and feel very comfortable opening up to her.  She&#8217;s probably the only person I&#8217;ve ever shared my real life goals with.</p>
<p>I tell you about them for a few reasons:</p>
<ol>
<li>To thank them for being trusted friends</li>
<li>To emphasize that I sought two very different opinions</li>
<li>Even though I eventually ignored both of their advice, I still seriously considered it and appreciate them</li>
</ol>
<div></div>
<h3>Why I Wasn&#8217;t a Christian</h3>
<p>How can you not know your religion?  That&#8217;s easy, I&#8217;m not religious.  I have no desire to be.  I want a personal relationship with God.  Just like any relationship, it takes work.  I&#8217;d stopped putting in the effort.</p>
<p>Many people have this idea of a healthy relationship being a two way street.  I don&#8217;t see it that way.  I see two one-way streets headed in the same direction.  If it were a 2 way street, one person could stop putting in effort and the result would be the same: you end up meeting somewhere in the middle.  With two one-way streets, if one person stops putting in the effort they get left behind.  That&#8217;s what happened.  When I fell behind due to lack of effort, I lost sight of God in the distance.  The direction both one-way streets are heading becomes very important in my paradigm.  If you&#8217;re not headed in the same direction &#8211; if you&#8217;re off by even one degree &#8211; you wind up in very different places over time.</p>
<p>I live an easy life.  I have friends, freedom, money, goals, some level of success, ambition&#8230;almost all the things that make life worth living.  It hasn&#8217;t always been that way though.  I&#8217;ve been in bad situations in every one of those categories, and it&#8217;s really easy to rely on God when shit&#8217;s fucked up &#8211; I obviously haven&#8217;t decided to stop swearing <img src='http://wordpress.daviddripps.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   When things are going great, however, I don&#8217;t need God anymore so the relationship fails.  That&#8217;s a sure sign of an unhealthy relationship.  I forget who said it, but something that always rings true with me is: &#8220;Immature love says &#8216;I love you because I need you.&#8217;  True love says &#8216;I need you because I love you.&#8217;&#8221;  Like the Israelites in the desert, <strong>I had an immature relationship with God.</strong>  Because everything in life is going so well right now, I don&#8217;t <em>need</em> anyone.  Not God, which is obvious since I&#8217;m writing this post.  Not another mentor, I&#8217;m doing pretty well with the ones I have.  Not a girlfriend, I&#8217;ve been happily single for four years.  Not a massive circle of friends, it&#8217;s shrunk to a tiny fraction of what it once was: just those I truly love.  It doesn&#8217;t mean I don&#8217;t <em>want</em> those things, I want all of those things, but I&#8217;m at a place where I truly don&#8217;t need them.  I think that makes it the right time to start building again.</p>
<p>A lot of things happened over the last few weeks.  Most significantly, I woke up one morning a few days ago and I looked over to the other bed (I was in a hotel).  My buddy was already awake and hating himself in that way that only a sever hangover can make you hate yourself.  We&#8217;d partied <em>really</em> hard the night before (rockstars would be envious) so he looked at me and said, &#8220;Fuck bitches. Get money.&#8221;  Seriously, it will go down in memory as a most epic night.  I laughed it off, but it got me thinking.  I like chasing girls.  I&#8217;m not one to go home with a stranger, but I like flirting and getting numbers and such.  I also like making money.  It&#8217;s how I keep score, and I like to win.  Is that really what life had come down to?  Then it hit me: these weren&#8217;t the motivations or actions of a Christian.  &#8221;Wtf David?  If &#8216;by their fruit you will recognize them,&#8217; then you&#8217;re not a Christian.&#8221; (I often talk to myself out loud).</p>
<figure class="full-width-mobile  thin" style="width: 300px;"><a href="http://wordpress.daviddripps.com/wp-content/uploads/2012/07/religion.jpeg" class="fancybox" title=""><img alt="" src="http://wordpress.daviddripps.com/wp-content/uploads/2012/07/religion.jpeg" class="wp-image-473" /></a></figure>
<h3>Why Change?</h3>
<p>My business partner always threatens to make a pull-string doll of me since I repeat the same phrases over and over.  A phrase he&#8217;s probably heard me say a million times is, &#8220;I&#8217;m me, if you don&#8217;t like it that&#8217;s too bad.&#8221;  It&#8217;s true.  I have no problem making friends.  I always want another friend, but I&#8217;m not gonna try and force it &#8211; again, it&#8217;s not a two way street where we can meet in the middle.</p>
<p>It&#8217;s an interesting phenomenon when you ask yourself a question and your subconscious actually answers back.  I woke up that morning, and for the first time in longer than I can remember I didn&#8217;t really like who I was.  My subconscious was quick to fire back &#8220;I&#8217;m me.  If you don&#8217;t like it, that&#8217;s too bad.&#8221;  I really don&#8217;t like being told what to do, but even worse is someone telling me I&#8217;m incapable of doing something.  When my subconscious basically told me I couldn&#8217;t change, I was <em>pissed</em>!</p>
<p>Getting back to my two conversations.  I told David that I&#8217;d come to the conclusion I wasn&#8217;t a Christian and that I wasn&#8217;t sure I wanted to be.  For a number of reasons, but mainly that I really enjoy my lifestyle.  I&#8217;d have to give up some of the things I really enjoy to get right with God again.  Life is good, why would I want to change anything?  &#8221;Because you just said you didn&#8217;t like who you&#8217;d become.&#8221;  Fair point.  He challenged me to give up the things I was holding onto for 30 days.  Kinda like a personal Lent.  If I thought life was better before, go back, if not, continue anew.</p>
<p>My second trusted friend gave me somewhat different advice.  She said, &#8220;Who cares?  Make up your own set of rules.  Stop doing the things that make you dislike yourself and just keep doing everything else.&#8221;  Another fair point.  Life is good &#8211; with the exception of my identity crisis, an emotional struggle I&#8217;m dealing with, and a physical stress that&#8217;s just come up.  Those are all things I can tackle myself though.  I don&#8217;t need a god&#8217;s help.</p>
<p>I&#8217;ve been actively thinking on this for the last day or so and, along with the other 2 stresses I mentioned, it&#8217;s consumed almost all my energy.</p>
<p>&nbsp;</p>
<h3>My Decision</h3>
<p>By design, it&#8217;s probably not obvious from the title that I chose to just get right with God again.  I&#8217;m not a fan of waiting.  I don&#8217;t want to take 30 days to figure stuff out.  I&#8217;m an entrepreneur: I make quick, calculated decisions.</p>
<p>It&#8217;s now 5:42am PT.  (It&#8217;s actually closer to 8am now, but I had to write the rest of the post.)  About 45 minutes ago I woke up with a vision I didn&#8217;t care to see.  It was the straw that broke the camel&#8217;s back.  After fighting my ego to get down on my knees, I battled it out with God for a bit.  He won.  <strong>I don&#8217;t need God</strong>, I&#8217;ve reinvented myself twice before, and I could easily do it again.  I <em>want</em> a relationship with Him.  I <em>want</em> to follow the rules.  I <em>want</em> to read the Bible and pray and meditate.  <strong>I want to be a Christian, so I&#8217;m going to be.  Simple as that.</strong></p>
<h4><figure class="full-width-mobile  thin" style="width: 204px;"><img alt="" src="http://wordpress.daviddripps.com/wp-content/uploads/2012/07/Jesus_Holding_Man-w-Hammer.jpeg" class="wp-image-474" /></figure></p>
</h4>
<h4>Why make this so public?</h4>
<p>Nothing is more important to me than my friends (yes, that includes success and money).  I have incredibly high emotional walls, if I&#8217;ve let you in then I want you there.  Another of my sayings: Get the best and keep it forever.  That applies to the people in my life too.  I make decisions and I stick with them, but <strong>this is a warning to those close to me that I will probably lean on you for support</strong> at some point.  Also, don&#8217;t mistake this post as me letting everyone in, the details of this decision are still reserved securely behind my aforementioned walls.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DavidDripps?a=bPXRzYgssD4:78WFM9Am2mM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DavidDripps?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DavidDripps?a=bPXRzYgssD4:78WFM9Am2mM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DavidDripps?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DavidDripps/~4/bPXRzYgssD4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.daviddripps.com/2012/07/20/i-dont-need-god/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.daviddripps.com/2012/07/20/i-dont-need-god/</feedburner:origLink></item>
		<item>
		<title>One Javascript Singleton to Rule Them All</title>
		<link>http://feedproxy.google.com/~r/DavidDripps/~3/cLJb1ZQhqwE/</link>
		<comments>http://www.daviddripps.com/2012/07/19/one-javascript-singleton-to-rule-them-all/#comments</comments>
		<pubDate>Thu, 19 Jul 2012 16:46:18 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[constructor]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[NodeJS]]></category>
		<category><![CDATA[Singleton]]></category>
		<category><![CDATA[StackOverflow]]></category>

		<guid isPermaLink="false">http://www.daviddripps.com/?p=418</guid>
		<description><![CDATA[I don&#8217;t want to get into a debate about Globals and Singletons right now. Suffice to say that I use Singletons on rare occasion and after creating one for a NodeJS project, I figured I&#8217;d save someone else the hassle. There are a bunch of answers on StackOverflow and one was very helpful&#8230;until I added [...]]]></description>
				<content:encoded><![CDATA[<p>I don&#8217;t want to get into a debate about Globals and Singletons right now. Suffice to say that I use Singletons on rare occasion and after creating one for a NodeJS project, I figured I&#8217;d save someone else the hassle. There are a bunch of answers on StackOverflow and <a href="http://stackoverflow.com/questions/1635800/javascript-best-singleton-pattern" target="_blank">one was very helpful</a>&#8230;until I added 2 little words to the top of my constructor: &#8220;use strict&#8221;;  (I&#8217;ve updated the answer on StackOverflow to reflect the changes I&#8217;m going to explain here, and it&#8217;s awaiting peer review).</p>
<p>I&#8217;m something of a rebel so I chose not to use a getInstance() method.  I just don&#8217;t like the way it looks.  If I want a reference to the singleton I should just be able to type:</p>
<pre class="brush: jscript; title: ; notranslate">
var singletonInstance = Singleton();
var singletonInstance = new Singleton();
//...or similar
</pre>
<p>I started with this solution and it worked really nicely for a while.</p>
<pre class="brush: jscript; title: ; notranslate">
function MySingletonClass() {
  if ( arguments.callee._singletonInstance )
    return arguments.callee._singletonInstance;
  arguments.callee._singletonInstance = this;

  this._client = function() {
    // ...
  }
}
</pre>
<p>Unfortunately, I want to use the most up-to-date methodologies if I can and right now that&#8217;s strict mode in Javascript.  No problem, I just add &#8220;use strict&#8221;; at the top of my constructor and run my tests.  They all pass.  Great!  Then I ran the full build, which includes JSHint, and the results were not so pretty.  arguments.callee was deprecated in strict mode so I implemented the strict mode version of the answer on StackOverflow to get this:</p>
<pre class="brush: jscript; title: ; notranslate">
var MySingletonClass = function() {
  &quot;use strict&quot;;
  if ( MySingletonClass.prototype._singletonInstance ) {
    return MySingletonClass.prototype._singletonInstance;
  }

  MySingletonClass.prototype._singletonInstance = this;

  this._client = function() {
    // ...
  };
};
</pre>
<p>I fired up node and all hell broke loose. TypeError: Cannot set property &#8216;_client&#8217; of undefined.  What!?!  All my tests are green.  JSHint is green.  There can&#8217;t possibly be anything wrong with my code.  I wish TDD meant that your code was perfect, but in fact it&#8217;s just for regression prevention.  I didn&#8217;t have a regression, I had a whole new problem.  <strong>If you instantiate a Javascript constructor in strict mode without the new operator &#8220;this&#8221; will be undefined.</strong>  I eventually ended up with the following test and solution:</p>
<pre class="brush: jscript; title: ; notranslate">
test('should not throw if created without &quot;new&quot; operator', function() {
  (function() {
    var instance = require('./singleton');
  }).should.not.throw();
});
</pre>
<pre class="brush: jscript; title: ; notranslate">
var MySingletonClass = function() {
  &quot;use strict&quot;;
  if ( MySingletonClass.prototype._singletonInstance ) {
    return MySingletonClass.prototype._singletonInstance;
  }

  var self = this;

  if (typeof self === 'undefined') {
    self = new MySingletonClass();
  }

  MySingletonClass.prototype._singletonInstance = self;

  self._client = function() {
    // ...
  };
};
</pre>
<p>I hope that someone is saved the headaches that I was by using the above.  It&#8217;s literally copy, paste, change the singleton name, and you&#8217;re off and running.  Let me know if you have any comments/improvements.</p>
<hr />
<p>If you enjoyed this post, <a title="Follow me on Twitter" href="http://twitter.com/#!/daviddripps" target="_blank">please follow me on Twitter.</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DavidDripps?a=cLJb1ZQhqwE:n4R1Tm-bsKg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DavidDripps?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DavidDripps?a=cLJb1ZQhqwE:n4R1Tm-bsKg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DavidDripps?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DavidDripps/~4/cLJb1ZQhqwE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.daviddripps.com/2012/07/19/one-javascript-singleton-to-rule-them-all/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.daviddripps.com/2012/07/19/one-javascript-singleton-to-rule-them-all/</feedburner:origLink></item>
		<item>
		<title>Most Opinions Suck, But That’s Just My Opinion</title>
		<link>http://feedproxy.google.com/~r/DavidDripps/~3/jXpyPk9VsKE/</link>
		<comments>http://www.daviddripps.com/2012/07/03/most-opinions-suck-but-thats-just-my-opinion/#comments</comments>
		<pubDate>Tue, 03 Jul 2012 16:00:21 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Opinions]]></category>
		<category><![CDATA[Startup Life]]></category>
		<category><![CDATA[Chick Approved]]></category>
		<category><![CDATA[recursion]]></category>

		<guid isPermaLink="false">http://www.daviddripps.com/?p=389</guid>
		<description><![CDATA[The goal of this post is to provide some very general guidelines to determine what good advice looks like.  Feel free to read the whole post, but I like when people get to the point early so here it is: Good advice is relevant, actionable, and timely. I learned a lot through the development, fundraising, and [...]]]></description>
				<content:encoded><![CDATA[<p>The goal of this post is to provide some very general guidelines to determine what good advice looks like.  Feel free to read the whole post, but I like when people get to the point early so here it is: <strong>Good advice is relevant, actionable, and timely.</strong></p>
<p>I learned a lot through the development, fundraising, and sale of <a href="http://www.crunchbase.com/company/chick-approved" target="_blank">Chick Approved</a>.  We did a lot of things wrong, but we also did a lot of things right.  Every startup is so different and their goals vary so widely that I&#8217;m not going to attempt to make a bulleted list of tasks you should check off to be successful (besides most of those are more bull<em>shit</em>ted than bulleted).  Though, as I&#8217;m working through new projects I can guarantee that I&#8217;ll come across similar obstacles, be reminded of a lesson learned, and share it with you.</p>
<p>It seems fitting that my first bit of advice is not to blindly follow my advice or even assume I&#8217;m anywhere close to being right <img src='http://wordpress.daviddripps.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
<h3><figure class="full-width-mobile  thin" style="width: 499px;"><a href="http://bellamort-in-wonderland.tumblr.com/" target="_blank"><img alt="" src="http://static.tumblr.com/evqduvc/21Gm1y4qs/i_have_no_idea_what_i_m_talking_about.gif" class="" /></a></figure></p>
</h3>
<p>&nbsp;</p>
<h3>Be opinionated, but listen</h3>
<p>I&#8217;m an opinionated person.  I feel very strongly about almost any topic I&#8217;m aware of.  One of my opinions is that I&#8217;m always right, despite the fact that I&#8217;m wrong <em>a lot</em>.  Some people say I&#8217;m confident, others cocky, and others still, pigheaded.  Whatever, it works for me.  If I thought it was a bad thing I would make an effort to change, but I don&#8217;t.  Here&#8217;s why: it&#8217;s <em>hard</em> to convince me of something, but if you do, I&#8217;m sold 100%.  In my opinion (yes another one), it&#8217;s ok to be stubborn as long as you&#8217;re not closed to others&#8217; opinions.  Basically, be open minded. (I&#8217;ll do another post on being open minded because so many people throw it out there without knowing what it means.  Kinda like <a href="http://www.dack.com/web/bullshit.html" target="_blank">buzz words</a> in tech pitches.)</p>
<p>&nbsp;</p>
<figure class="full-width-mobile  thin" style="width: 458px;"><a href="http://zootool.com/watch/nl673/" target="_blank"><img alt="" src="https://s3.amazonaws.com/zootool.previews/nl673/l.jpg?1319669019" class="" /></a></figure>
<p>&nbsp;</p>
<h3>The Litmus Test: What constitutes good advice?</h3>
<p>&#8220;Opinions are like assholes. Everybody&#8217;s got one and everyone thinks everyone else&#8217;s stinks.&#8221; &#8211; The Deal Pool</p>
<p>I&#8217;m constantly seeking advice from people I like, trust, and respect.  I&#8217;ve received more good advice than I can remember or truly appreciate. Like everyone, I&#8217;ve also received a ton of bad advice. To make my inquisitive efforts more fruitful, I developed a quick test to tell whether the advice I&#8217;m receiving is worthwhile: <strong>Good advice is relevant, actionable, and timely.</strong>  If you ask for advice on X and you&#8217;re getting a story about Y, it&#8217;s not relevant.  If you don&#8217;t walk away with a mental todo list, the advice is not actionable.  Finally, if you&#8217;re asking for advice on a current matter and receiving criticism or advice on a previous issue, the advice is not timely. If you want to see exponential gains from the advice you receive, make sure it passes this test: relevant, actionable, and timely.  Hopefully my litmus test passes itself. (I&#8217;m a nerd, so all I can think of right now is <a href="https://www.google.com/webhp?ie=UTF-8#hl=en&amp;output=search&amp;sclient=psy-ab&amp;q=recursion" target="_blank">recursion</a>.)</p>
<p>&nbsp;</p>
<h3>5 things to remember while keeping an open mind to others&#8217; advice:</h3>
<ol>
<li>It&#8217;s just one person&#8217;s opinion, they have a completely different paradigm than anyone else you&#8217;ll talk to.  Talk to multiple people.</li>
<li>No one understands your problem, vision, or idea like you do.  It&#8217;s up to you to make them understand.</li>
<li>In an effort to be helpful, people will always try to steer the conversation towards something they know about.  That doesn&#8217;t make it relevant or useful. Keep the conversation focused on the matter at hand.</li>
<li>If you didn&#8217;t ask for advice, why are you still listening?</li>
<li>Don&#8217;t make quick decisions if you can avoid it.  Give your mind at least a good night&#8217;s sleep to let everything sink in.</li>
</ol>
<p>Make sure the advice you&#8217;re receiving is relevant, actionable, and timely.  Take everything into consideration. Then ultimately <strong>go with your gut instinct.</strong></p>
<p>&nbsp;</p>
<hr />
<p>If you enjoyed this post, <a title="Follow me on Twitter" href="http://twitter.com/#!/daviddripps" target="_blank">please follow me on Twitter.</a></p>
<div></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DavidDripps?a=jXpyPk9VsKE:vDaGwpBSZWM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DavidDripps?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DavidDripps?a=jXpyPk9VsKE:vDaGwpBSZWM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DavidDripps?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DavidDripps/~4/jXpyPk9VsKE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.daviddripps.com/2012/07/03/most-opinions-suck-but-thats-just-my-opinion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.daviddripps.com/2012/07/03/most-opinions-suck-but-thats-just-my-opinion/</feedburner:origLink></item>
	</channel>
</rss>
