<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
  <title>josh earl on scriptogr.am</title>
  <link>http://whiletruecode.com</link>
  <description>code, tech, and getting things done.</description>
  <pubDate>2013</pubDate>
 
  <item>
    <title>Sublime Text ebook beta launches Thursday</title>
    <pubDate>Mon, 24 Sep 2012 00:00:00 -0400</pubDate>
    <link>http://whiletruecode.com/post/sublime-text-ebook-beta-launches-september-29</link>
    <guid>http://whiletruecode.com/post/sublime-text-ebook-beta-launches-september-29</guid>     
    <description><![CDATA[<p>I'm publishing a beta version of my Sublime Text 2 ebook, <a href="http://www.sublimeproductivity.com">Sublime Productivity</a>, 
at <strong>1 p.m. EST this Thursday, September 27, 2012</strong>.</p>

<p>If you <a href="http://www.sublimeproductivity.com">visit the book page now</a> and sign up for email updates before I hit the publish 
button, you'll get an email with a <strong>30% discount code</strong> when the book goes live.</p>

<p>The beta release includes more than 50 pages of examples, walkthroughs and keyboard mappings, including in-
depth coverage of:</p>

<ul>
<li>Common editing tasks like sorting items, joining lines, transposing words and commenting code</li>
<li>Precision selection with Sublime’s multi-select and quick add and quick skip features</li>
<li>Navigating among project files and jumping around in the current file</li>
<li>Using projects to organize your files and improve team collaboration  </li>
</ul>

<p>Since I still have a lot of ground to cover before I can call this done, the beta is priced lower than what
I'll be charging for the final version. It's a one-time purchase, so if you 
<a href="http://www.sublimeproductivity.com">buy the beta</a> you'll <strong>get future updates for free</strong> as I publish them.</p>

<p>Among the topics I plan to include in the near future:</p>

<ul>
<li>Automating tasks with macros</li>
<li>Creating and using code snippets</li>
<li>Introduction to vintage mode</li>
<li>Extending Sublime with the best plugins </li>
<li>Writing plugins</li>
</ul>

<p>Part of the reason I decided to publish a beta version is to get early feedback from readers on my
organization and the Sublime features I'm choosing to cover. If you have any suggestions for other features
you'd like me to cover in the book, I'd love to hear about it in  the comments!</p>
]]></description>
  </item>
 
  <item>
    <title>Five lessons from The 4-Hour Work Week</title>
    <pubDate>Mon, 03 Sep 2012 00:00:00 -0400</pubDate>
    <link>http://whiletruecode.com/post/five-lessons-from-the-4-hour-work-week</link>
    <guid>http://whiletruecode.com/post/five-lessons-from-the-4-hour-work-week</guid>     
    <description><![CDATA[<p>The negative reviews for Tim Ferriss’s <strong><a href="http://rcm.amazon.com/e/cm?lt1=_blank&amp;bc1=000000&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=programproduc-20&amp;o=1&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=ss_til&amp;asins=0307465357">The 4-Hour Work Week</a></strong> scared me off three
times.</p>

<blockquote>
  <p>A con man who needs to be taken down.</p>
  
  <p>Modern day snake oil.</p>
  
  <p>This advice works if you’re already making $40,000 a month, otherwise forget it.</p>
</blockquote>

<p>When my curiosity finally won out, I was braced for a hyper-ventilating sermon: "Start a 'business,'
scam gullible people out of millions, then abscond to the Caribbean and guzzle piña coladas until
your dying day."</p>

<p>Fortunately, that's not the message of <strong><a href="http://rcm.amazon.com/e/cm?lt1=_blank&amp;bc1=000000&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=programproduc-20&amp;o=1&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=ss_til&amp;asins=0307465357">The 4-Hour Work Week</a></strong>. Instead, this is
a funny, engaging book about focus, freedom and choosing the life you want to lead, rather than
accepting your current conditions as your permanent lot.</p>

<p>It's the most exciting book I've read since David Allen's <strong><a href="http://rcm.amazon.com/e/cm?lt1=_blank&amp;bc1=000000&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=programproduc-20&amp;o=1&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=ss_til&amp;asins=0142000280">Getting Things Done</a></strong>, 
and it promises to have a similar long term impact on me. The phrase "life-changing" seems a bit 
overheated, but it's certainly changed my outlook in important ways.</p>

<p>The following are five takeaways from the book that I've already started applying.</p>

<p>(Quick aside: Some of the links in this post are Amazon affiliate links, and I'll make a small 
commission if you choose to use them.)</p>

<h2>Minimize input to maximize output</h2>

<p>I'm an information addict. While I've lowered my intake of information junk food over the last few
months, I still check my email frequently, scan my RSS feeds a few times a day, read several 
books a month, and listen to 10 or so podcasts a week. Oh, and lately I've added obsessive
checking of my various analytics metrics to the list. How many hits today?</p>

<p>This voracious consumption was necessary to jumpstart my late entry into the software development
industry. Now that I'm established, it's become just something that I do. I'm feel a little like
Jack Bauer, still shooting up long after taking down the drug kingpin. The habit has outlived its
usefulness, and it's time to kick it.</p>

<p>Ferriss writes that free <strong>time</strong> is useless without free <strong>attention</strong>, and by filling every free
moment with new information I'm fragmenting my attention until I barely notice that my 
22-month-old son just said a new word.</p>

<p>Another downside of this constant flood of information for me is that it generates a constant 
stream of ideas and things that I might want to do, which my GTD-trained brain reflexively 
grabs, processes and categorizes. I'm already quite capable of generating endless lists of 
ideas to keep myself busy; I don't need any help.</p>

<p>Ferriss proposes a week-long information fast, in which you shun all non-essential information
intake. No nonfiction reading, news, TV, podcasts. It's shock therapy to help you refocus and 
reclaim your attention.</p>

<p>I haven't mustered the courage to go cold turkey yet, but I plan to do it soon. In the mean time,
I've further ratcheted down my access to my favorite time sinks with <a href="http://www.rescuetime.com">RescueTime</a> and
the StayFocusd chrome browser extension.</p>

<p>Maybe next week I'll take a full seven days off. Yeah, that sounds good. Next week.</p>

<h2>Trade control for freedom</h2>

<p>Ferriss's promotion of personal outsourcing is at once controversial and one of the main action
items that readers latch onto. But he's not suggesting that hiring a virtual assistant will 
allow you to offload 36 hours of your week onto some poor schlub in a developing country. The
VA chapters are part of a larger theme: Letting go of control in some smaller aspects of your 
life will allow you to focus on the areas where your efforts will generate maximum impact.</p>

<p>He recommends practicing the art of "letting small bad things happen." Given the choice between 
finishing an important project or rushing out to return a DVD to avoid a $5 fine, he'll take the 
fine.</p>

<p>This was a bit of a shock to my system. In my world, incurring a late fee on a payment is a failure
of the highest magnitude and deserving of days of self recrimination.</p>

<p>Ferriss isn't suggesting that you let your life go to seed, but he is prompting you to ask, What 
am I giving up to avoid this $5 fee?</p>

<p>Outsourcing is part of this mental shift. By nature entrepreneurs think they can and should excel at
everything. That's me to a T, but now I'm looking for small ways to change this.</p>

<p>I know my way around tools, but I have a growing list of small home repairs and improvements that
putting off for months or years. No more; I'm going to hire a handyman to do them. It's worth an
extra $100 or $200 to have those things done, and as a programmer I can probably make a profit if I
freelance while the guy works.</p>

<p>Similarly, I'm bursting with ideas for infoproducts that I want to create, so I'm starting to hire
freelancers to get a jump on the content while I am busy with my day job. I can also use help
scheduling interviews, doing preliminary research and transcribing interview recordings. As much as
I like to be self sufficient, it's time to be realistic about my limitations.</p>

<h2>Automate income to create freedom</h2>

<p>Another controversial aspect of the 4HWW is the concept of an automated income stream. Ferriss
recommends a process for developing a product-based business that, once put in motion, can run with
minimal involvement from you.</p>

<p>He provides several hypothetical case studies that illustrate what types of products lend
themselves to creating low-maintenance income streams, how to ensure that there's a demand for a
product, how to bring it to market, and then how to set it to run on autopilot.</p>

<p>Critics knock this as impractical: Most people could never start a business that would generate
cash flow on its own so they could lead less soul-crushing lives.</p>

<p>While it's true that most people won't ever achieve this, I don't buy the argument that the reason 
they'll fail is that it's unattainable for most.</p>

<p>Case in point: An acquaintance of mine holds a low-paying blue collar job maintaining heavy
equipment for a municipal government, and he's frustrated and unfulfilled. His working conditions
are atrocious and the yokels he works with are mostly interested in lining their pockets with
taxpayer money.</p>

<p>He doesn't seem like a natural candidate for a 4HWW makeover, but when I look at his situation, I
see a gold mine. This guy is a highly skilled mechanic with decades of experience working on
everything from heavy equipment to race cars. He's sitting on a wealth of knowledge that many
people would be happy to pay for. Hobbyists spend thousands to restore classic cars, many of
which are the very cars my friend spent his youth servicing. Might some of them be willing to pay
$50 or $80 for a DVD or downloadable video to learn how to properly reline a set of antique brakes
or correctly hone the cylinders in their garage queen?</p>

<p>If he could find 1,000 hobbyists who want his help, he'd likely double his current income,
and he'd barely have to work to do it. Then with his extra cash, he could open a machine
shop that catered to classic car buffs.</p>

<p>Guaranteed to succeed? Nope. Realistic and achievable with some work? Certainly.</p>

<p>Don't expect the 4HWW to answer every question you'll before you can start your own business, but 
it provides a solid blueprint that will allow you to generate income and increase your freedom,
without continuing to trade time for money.</p>

<h2>Separate your life's work from your income</h2>

<p>Reading <strong>The 4-Hour Work Week</strong> challenged me to reexamine my goals and dreams in a different
light: What would I do with myself if the majority of my waking hours weren't spent in the pursuit
of income?</p>

<p>In one of my previous jobs, I spent days and weeks building websites that virtually no one ever saw
or used. It's demoralizing to spend the majority of your day on something you know is virtually
meaningless.</p>

<p>My current job is far from meaningless. I'm helping to solve hard problems, and the results help
real people do their work more effectively. Our company culture is fun, and my coworkers are 
smart and personable. If I have to work for someone else until I retire, I want to work at 
companies like this one.</p>

<p>But what if I didn't have to work? That's a scary thought.</p>

<p>To Ferriss, the point of creating a low-maintenance income stream isn't to grow fat and happy while
lounging by the pool. An automated business is a lever to create freedom so you focus on things
that bring greater satisfaction: learning and service to others.</p>

<p>If I succeed in setting up my own automated income stream, I plan to keep plenty busy:</p>

<ul>
<li>Enjoy every minute possible with my wife and sons. </li>
<li>Teach urban teens how to build successful careers and bootstrap their way out of poverty. It 
frustrates me to no end that people think they can't get ahead when the entire store of the 
world's knowledge is literally at their fingertips. I want to help a few people find the 
freedom I'm enjoying.</li>
<li>Write and write some more. Writing was my first career choice, and I'd love for it to become
my primary occupation again someday.</li>
<li>Get back into activities that I've allowed to languish, like playing my beautiful Taylor 
guitar, practicing martial arts and playing soccer.</li>
</ul>

<p>Others might use such a revene-generating business to finance dream of starting a company to tackle
"the big problems." Who says the only way to do a startup is kowtowing to venture capitalists or
eating Ramen while sleeping on a friends couch?</p>

<h3>Live life today</h3>

<p>Probably the biggest lesson I'm taking away from <strong><a href="http://rcm.amazon.com/e/cm?lt1=_blank&amp;bc1=000000&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=programproduc-20&amp;o=1&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=ss_til&amp;asins=0307465357">The 4-Hour Work Week</a></strong> is this: Stop
deferring life for a day that may never come. Don't trade 40 or 50 years in a cubicle for a vision
of 401K-funded leisure that might never materialize. Instead, Ferriss recommends taking "mini
retirements" by living abroad for a few months or a year at a time, using the income generated by
your low-maintenance business.</p>

<p>I have a goal to "retire" early, which to me means building a large enough reserve that I'm not 
dependent on a job. I hope I never have to retire in the traditional sense, but I want my choices
to be unconstrained by the requirement of scraping out a living.</p>

<p>I enjoy working toward this goal, and often it is exhilarating and doesn't even feel like work. But
I'm not giving my family the time and attention they deserve.</p>

<p>Instead of plowing ahead at 70 or 80 hours a week, trading my kids’ childhoods for a dream of an
early retirement, I'm looking for ways I can limit my work hours and maximize my results by 
outsourcing parts of my projects.</p>

<p>I’m also investing in myself: I'm almost one third of the way through the <a href="http://www.amazon.com/gp/product/B000TG8D6I/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B000TG8D6I&amp;linkCode=as2&amp;tag=programproduc-20">P90X</a> extreme
fitness program, and I'm determined to kick my scrawny butt into something resembling good shape.
It’s a commitment of more than an hour a day. All the more reason to sharpen my focus in the time
I've allotted for work.</p>

<h2>What's my plan?</h2>

<p>I don't know yet what my main passive income stream will eventually be, and that's fine by me. When
I define a goal and keep it in the back of my mind, I've found I'm able to recognize the right
opportunity when it arises.</p>

<p>But I'm exploring two potential revenue streams that lend themselves well to automation and are a
natural fit for my current skill set and interests: infoproducts and software-as-a-service products.</p>

<p>One of my all time favorite books is <strong><a href="http://www.amazon.com/gp/product/B007K4GKVM/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B007K4GKVM&amp;linkCode=as2&amp;tag=programproduc-20">Paper Lions</a></strong> by George Plimpton. Plimpton was
a practitioner of "gonzo journalism," which involved putting yourself in extreme circumstances and
then writing about your experiences. In college, I wanted to be George Plimpton.</p>

<p>Thanks to the rising popularity of ebooks, those dreams are reawakening. I’m wired to acquire new
skills, achieve a satisfactory level of proficiency, then move on to something else. That’s one thing
that appealed to me about journalism; my daily task was to become an instant expert in some new
field or skill I’d never encountered before. I have a list of things I’d like to do someday that’s
so long it makes my head spin.</p>

<p>What better way to harness this temperament then building a business around learning new things and
communicating them to others in a tight, 50-80 page ebook?</p>

<p>My wife, also is an avid writer, is lighting up at the possibility of working together with me to
build a ebook-based business. Together, we'd be an entrepreneurial, content-generating machine.</p>

<p>Another avenue I'd like to pursue is creating a software-as-a-service product, tightly targeted to
solve a painful business problem for a group of professionals. I have some strong existing
relationships in the real estate industry, so that's where I'll be looking first. I'm not worried
about having The Idea yet; it'll come when I understand the pain of my target market. And with the
technical skills I've cultivated over the last few years, I'm confident I'll be able to execute when
The Idea presents itself.</p>

<h2>One small step ...</h2>

<p>This month I began my journey. I saw a small trickle of passive income. A few dollars earned from
effort expended weeks ago. The money arrived while my wife and I spent a weekend visiting family and
enjoying our boys. My mission over the next couple of years is to turn that trickle into a flood.</p>

<p>Sure, not everyone will be able to pull this off. Maybe I'll be one of the ones who come up short.
But when I look back at what I've been able to accomplish that I never thought possible, I can't
help but think, "Yeah, I got this."</p>
]]></description>
  </item>
 
  <item>
    <title>My $47 collapsible standing desk</title>
    <pubDate>Sun, 15 Jul 2012 00:00:00 -0400</pubDate>
    <link>http://whiletruecode.com/post/my-47-dollar-collapsable-standing-desk</link>
    <guid>http://whiletruecode.com/post/my-47-dollar-collapsable-standing-desk</guid>     
    <description><![CDATA[<p>I've wanted a standing desk ever since I first read about the idea three or four years ago.</p>

<p>But even though the <a href="http://well.blogs.nytimes.com/2010/07/14/phys-ed-the-men-who-stare-at-screens/">health benefits</a> seem clear, it takes a <a href="http://www.nbc.com/the-office/video/this-will-not-stand/1371438/">special kind of guy</a> to stand tall
amongst an acre of of low-walled cubicles.</p>

<p>That guy I am not, and during my corporate career I stowed the standing desk idea away, alongside my
once-held ambition to be a professional magician.</p>

<p>Now that I work remotely every day, the only thing that's prevented me from springing for a 
<a href="http://www.geekdesk.com/">Geek Desk</a> is limited space. The lower level family room where I work is just about tapped out 
in the furniture department, and adding another desk would entail getting rid of a nice, solid 
wood desk we already own.</p>

<p>I do have a little open wall space in my office, though, and I've thought about cobbling together
a makeshift desk with some repurposed shelving.</p>

<p>Then I stumbled across Ikea's <a href="http://www.amazon.com/gp/product/B0050S7CK8/ref=as_li_qf_sp_asin_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B0050S7CK8&amp;linkCode=as2&amp;tag=programproduc-20">wall-mounted drop leaf folding table</a> (affiliate link), available 
on Amazon for $35.49, plus $11.99 for shipping. It seemed too good to pass up, and I'm 
glad I ordered one.</p>

<h2>Installation</h2>

<p>Setup was simple. The desk comes with all the hardware required for assembly, but you'll have to
supply your own fasteners to actually mount it to the wall. As it happens, the back side of my
office wall is unfinished, so I framed in some extra supports between the studs and installed the
desk with some long wood screws. If you don't have access to the other side of the wall,
heavy duty drywall anchors will provide adequate support as long as you don't do any swan dives
off of your desk.</p>

<p>Before drilling any holes, I propped the desktop up on various objects to find the ideal height.
I'm 5'9", and a height of 41" puts the desk surface just above my belly button. My elbows are bent
just a little more than 45 degrees, and I can work comfortably on my paper-thin MacBook Air and my
chunkier ThinkPad W520, which raises my hands about 1" from the desktop.</p>

<p>Instead of following the Ikea assembly instructions, I'd recommend first just putting together the
section that mounts to the wall, which looks like a T, then using it as a template to help position
the fasteners. I loosely screwed one end to the wall first, then set a level on top of the T while I
drilled the remaining holes.</p>

<p>It's also a good idea not to tighten any one screw fully until the other holes are drilled and their
respective screws partially tightened. Otherwise the frame will probably shift and throw itself
off level.</p>

<p>To finish the project off I ordered a 1" desk grommet similar to <a href="http://www.amazon.com/Black-Desk-Grommet-pc/dp/B000M4XVKU/">this one</a> from eBay for $4
shipped. It'll be nicer not to have to run cords around the side of the desk when I need to plug in.</p>

<h2>Impressions</h2>

<p>I'm pretty happy with how this desk fits in my office and its overall appearance:</p>

<p><img src="https://dl.dropbox.com/u/1042234/blog/images/posts/2012-07-15/desk-side.jpg" alt="&quot;Standing desk side view&quot;" />
<img src="https://dl.dropbox.com/u/1042234/blog/images/posts/2012-07-15/desk-front.jpg" alt="&quot;Standing desk front view&quot;" />
<img src="https://dl.dropbox.com/u/1042234/blog/images/posts/2012-07-15/desk-bottom.jpg" alt="&quot;Standing desk bottom view&quot;" />
<img src="https://dl.dropbox.com/u/1042234/blog/images/posts/2012-07-15/desk-folded.jpg" alt="&quot;Standing desk folded view&quot;" /></p>

<p>This desk is nothing fancy, but for the price it's well constructed. It's solid wood with a clear
satin finish. The surface doesn't flex or bounce when extended, even thought the desk top itself is
only about 1" thick. When folded, it protrudes about 4" from the wall, making it quite unobtrusive.</p>

<p>One minor annoyance that I noticed soon after completing the installation: If I put a little weight
on the front edge, the desk makes a slight creak. Initially I assumed this was coming from the
screws holding the desk to the wall, but it's actually just the top shifting slightly where it meets
the swing-out arm. Putting a little foam rubber padding on top of the arm eliminated the noise and
made the whole assembly feel more solid.</p>

<p>Overall I'm quite pleased. If you're looking to augment your existing standing desk and don't 
mind putting a few holes in your wall, this is a great option.</p>
]]></description>
  </item>
 
  <item>
    <title>Hosting an ASP.NET site in IIS Express using Parallels on Mac OSX</title>
    <pubDate>Fri, 13 Jul 2012 00:00:00 -0400</pubDate>
    <link>http://whiletruecode.com/post/hosting-an-aspnet-site-in-iis-express-using-parallels-on-mac-osx</link>
    <guid>http://whiletruecode.com/post/hosting-an-aspnet-site-in-iis-express-using-parallels-on-mac-osx</guid>     
    <description><![CDATA[<p>I'm getting my MacBook Air set up for some ASP.NET MVC3 development, using <a href="http://www.parallels.com/products/desktop/">Parallels Desktop</a> to
run the Windows 8 release preview as a virtual machine. Even with the stingy 1GB of RAM I allotted
for the VM, Windows 8 screams and Visual Studio 2010 runs great.</p>

<p>For this particular project, the team I'm working with is using IIS Express 7.5. It was a logical
choice because it generally requires less configuration and fiddling than the full version of IIS,
which tends to throw a hissy if you don't get all the directory permissions just so.</p>

<p>Setting up the site in my VM was no trouble at all. But then I decided to make my own life
difficult: I just <strong>had</strong> to be able to view the site in my Mac's installation of Chrome so that
I could use OSX Lion's amazing multitouch gestures to switch between Visual Studio and the
browser. I do this all the time when working in Vim and Sublime Text, and it's a smooth and natural
workflow.</p>

<p>So, to recap, I needed to develop my site in a Windows 8 VM running in Parallels, and I wanted to
be able to serve the site up through IIS Express to my native Mac browser.</p>

<p>This simple scenario morphed into a bit of a multi-headed Hydra, and it took me a while to work
through each step. Here's an overview of what I did to get it working.</p>

<h2>Network and Firewall</h2>

<p>The first step is enabling bridged networking in Parallels. This allows your virtual machine 
to have its own IP address, and makes it visible on your network just like any other machine.</p>

<p>To enable bridged networking:</p>

<ul>
<li>Click <strong>Main Menu | Virtual Machine | Configure</strong>. </li>
<li>Click the <strong>Hardware</strong> icon.</li>
<li>Select the appropriate network option from the left navigation. This might take some 
trial and error. Mine is called <strong>Network1</strong>. </li>
<li>Select the <strong>Default Adapter</strong> option under <strong>Type</strong>. Again, you might need to experiment
here. I had several adapters listed, but the default one worked.</li>
</ul>

<p>The next step is poking a hole through the Windows Firewall to allow traffic through. I added
rules for port 80 and port 8080. Here's a brief walkthrough on how to <a href="http://windows.microsoft.com/en-US/windows-vista/Open-a-port-in-Windows-Firewall">add firewall rules</a>. 
You'll want both inbound and outbound rules.</p>

<p>Once I enabled bridged networking and created the firewall rules, I was able to hit a quick test
site I set up with IIS 8 on port 80, using the virtual machine's host name, like this:
<code>http://my-virtual-machine-name</code>. (To find out the host name of your virtual machine, open cmd or
PowerShell and run <code>ipconfig /all</code>.)</p>

<h2>IIS Express Configuration</h2>

<p>However, when I fired up my IIS Express site and tried to access it from outside the VM, I received
the following nondescript error:</p>

<pre class="prettyprint"><code>400 Hostname is Invalid
</code></pre>

<p>Eventually I learned that this error is caused by missing bindings in the IIS Express configuration
file. My site was bound to <code>*:8080:localhost</code>, and when the request came in, it was specifying a
host name of <code>my-virtual-machine-name</code>, which IIS Express didn't know anything about.</p>

<p>The configuration file is located at:</p>

<pre class="prettyprint"><code>%USERPROFILE%\Documents\IISExpress\config\applicationhost.config
</code></pre>

<p>Open it in a text editor and update your site's <code>bindingInformation</code> value with your virtual
machine's host name:</p>

<pre class="prettyprint"><code>&lt;site name="MySite" id="1"&gt;
    &lt;application path="/" applicationPool="Clr4IntegratedAppPool"&gt;
        &lt;virtualDirectory path="/" physicalPath="C:\Users\myusername\MySite" /&gt;
    &lt;/application&gt;
    &lt;bindings&gt;
        &lt;binding protocol="http" bindingInformation=":8080:my-virtual-machine-name" /&gt;
    &lt;/bindings&gt;
&lt;/site&gt;
</code></pre>

<p>I also removed the leading <code>*</code> wildcard for good measure.</p>

<p>Now hitting the site from the Mac's browser generated a new error:</p>

<pre class="prettyprint"><code>503 Service Unavailable
</code></pre>

<p>It's a little sad to get excited just because you're seeing a <strong>different error</strong>, but after a few 
dozen 400 errors I was happy to see the 503. No idea how to fix it, but it seemed like progress.</p>

<p>After some googling with <a href="http://duckduckgo.com">DuckDuckGo</a> I learned that this error is an indication that IIS
Express doesn't have permissions to handle external requests. Makes sense, since it's designed
to be a lightweight web server that you can set up without having admin rights to your 
machine. This <a href="http://learn.iis.net/page.aspx/1005/handling-url-binding-failures-in-iis-express/">article from Microsoft</a> describes the fix, which involves running a command
with <code>netsh</code>. I eventually hit a good <a href="http://stackoverflow.com/questions/5442551/iisexpress-returns-a-503-error-from-remote-machines">Stack Overflow post</a> that helped me get the command
syntax right.</p>

<p>To enable external access for your IIS Express site, open cmd or PowerShell as an administrator and
run:</p>

<pre class="prettyprint"><code>netsh http add urlacl url=http://my-virtual-machine-name:8080/ user=everyone
</code></pre>

<p>Finally, the stupid obvious step that tripped me up for a while: <strong>Restart IIS Express</strong>. Just 
right click on the IIS Express tray icon and click <strong>Exit</strong>, then relaunch your site in Visual Studio.</p>

<p>Hit the URL <code>http://my-virtual-machine-name:8080</code> from your Mac's browser and the site should 
load right up.</p>
]]></description>
  </item>
 
  <item>
    <title>Stop seizure-inducing screen flicker in join.me</title>
    <pubDate>Fri, 13 Jul 2012 00:00:00 -0400</pubDate>
    <link>http://whiletruecode.com/post/stop-seizure-inducing-screen-flicker-in-joinme</link>
    <guid>http://whiletruecode.com/post/stop-seizure-inducing-screen-flicker-in-joinme</guid>     
    <description><![CDATA[<p>At <a href="http://www.trackabout.com">work</a> we spend hours every day doing remote pair programming over Skype. Since Skype's 
share screens feature isn't always reliable, we've explored just about every other screensharing 
tool on the market, and we've settled on <a href="http://join.me">join.me</a> for its ease of use.</p>

<p>On my ThinkPad, though, I've consistently seen performance issues when sharing either of my 
large external monitors. Anyone watching my screen would notice that it would seem to flicker
as it was redrawn, allowing them to see any windows I had open behind the one I was currently 
working in. It almost looked as if it was rendering each layer on my desktop in Z order. 
The resulting flash made join.me almost unusable.</p>

<p>On my smaller ThinkPad screen the problem was less pronounced, so for a while I coped by putting up
with the cramped display. I've noticed the same problem from time to time on my teammates' computers
as well, which led me to assume that join.me struggled with higher resolution monitors.</p>

<p>I got frustrated with the situation this week, and I updated the video drivers on my ThinkPad in 
an attempt to resolve it. Instead of fixing the issue, though, the new drivers made it worse.</p>

<p>After the update, join.me showed just a black screen (oh, and my mouse pointer!) when I shared
my larger displays. The ThinkPad screen showed a picture, but the flicker went from distracting
to seizure-inducing.</p>

<p>I swallowed my programmer pride and called join.me's <a href="https://join.me/welcome/webhelp/joinme/join.me/jm_faq_troubleshooting.html">tech support</a> team.</p>

<p>The technician quickly walked me through a resolution, which involved configuring join.me 
to disable Windows Aero when it launches.</p>

<p>Here are the steps we used to fix the flicker:</p>

<ol>
<li>Download and run the <code>.msi</code> installer to install join.me as an app. I typically use the 
 single-run version from the website, but we needed to modify some settings, so the 
 installed version is required.</li>
<li><p>Open Windows Explorer and locate the installation directory for join.me. On my system it
 is:</p>

<pre class="prettyprint"><code> %USERPROFILE%\AppData\Local\join.me
</code></pre></li>
<li>Open <code>params.txt</code> in your text editor of choice. I hope for your sake that it's not Notepad.</li>
<li><p>Append <code>-noaero</code> to the end of the file's contents, then save the changes. Here's what
 mine looked like after the modification:</p>

<pre class="prettyprint"><code>-site join.me -lang en-US -trackinfo A4097310-7167-2035-R361-9231H994E6Y5_75945 
-hook -blocksize 64x64 -noaero
</code></pre></li>
<li><p>Launch join.me from the Start menu. Your screens should flicker as Aero is turned off.</p></li>
<li>Enjoy screensharing goodness!</li>
</ol>

<h2>Update (2012/07/25)</h2>

<p>After an update today, join.me seems to be ignoring the <code>-noaero</code> flag. Here's <a href="http://www.techrepublic.com/blog/window-on-windows/quick-tip-disable-the-aero-interface-for-just-the-problem-applications/4494">another way</a> to accomplish the
same thing.</p>
]]></description>
  </item>
 
  <item>
    <title>Adding a vertical ruler to Vim</title>
    <pubDate>Tue, 10 Jul 2012 00:00:00 -0400</pubDate>
    <link>http://whiletruecode.com/post/adding-a-vertical-ruler-to-vim</link>
    <guid>http://whiletruecode.com/post/adding-a-vertical-ruler-to-vim</guid>     
    <description><![CDATA[<p>When I'm using Sublime Text 2 and Visual Studio, I like to create a "ruler" somewhere around
100 characters from the left margin. It gives me a visual cue that helps me keep my line lengths
reasonable.</p>

<p>Naturally, there's an easy way to do this in Vim as well. I added this to my <code>.vimrc</code>:</p>

<pre class="prettyprint"><code>set colorcolumn=85
</code></pre>

<p>To tone down the coloring, I added this to my <code>.gvimrc</code>:</p>

<pre class="prettyprint"><code>highlight ColorColumn guibg=Gray14
</code></pre>

<p>That makes a nice subtle column in MacVim. Here's a nice <a href="http://choorucode.wordpress.com/2011/07/29/vim-chart-of-color-names/">color chart</a> of the dozens of colors
avaiable in the GUI version of Vim. You can also display a partial list of available colors with 
the command <code>:help guibg</code>.</p>

<p>To set the colors in a terminal version of Vim, add the following to <code>.vimrc</code>:</p>

<pre class="prettyprint"><code>highlight ColorColumn ctermbg=DarkGray
</code></pre>

<p>To see the available color names, issue the command <code>:help ctermbg</code>.</p>
]]></description>
  </item>
 
  <item>
    <title>Get a transparent, Quake-style Windows console with ConEmu</title>
    <pubDate>Fri, 06 Jul 2012 00:00:00 -0400</pubDate>
    <link>http://whiletruecode.com/post/get-a-transparent-quake-style-windows-console-with-conemu</link>
    <guid>http://whiletruecode.com/post/get-a-transparent-quake-style-windows-console-with-conemu</guid>     
    <description><![CDATA[<p>For months, there's been a hole in my life: I discovered the joy of full-screen, transparent consoles in 
Linux, but I haven't found anything similar for Windows. I did my best to fill the void with <a href="http://sourceforge.net/projects/console/">Console2</a>,
but the best it could muster was a nice, minimal window with multi-tab support.</p>

<p>Thanks to a <a href="http://whiletruecode.com/post/command-line-wiki#comment-576548468">comment by Charles Roper</a> on another post, I decided to give <a href="https://code.google.com/p/conemu-maximus5/">ConEmu</a> a chance. I'd seen
<a href="http://www.hanselman.com/blog/ConEmuTheWindowsTerminalConsolePromptWeveBeenWaitingFor.aspx">Scott Hanselman's writeup</a> about it a few weeks back, but I have to admit I was turned off by the ...
um, less than beautiful UI in Scott's screenshots. But it looked pretty configurable, so I thought I'd 
see if I could turn it into the type of minimalist, instantly available console I've grown to love on my
Mac and in Linux.</p>

<p>Here's how I made ConEmu shine.</p>

<p><em>Note</em>: These instructions are based on build 120705. ConEmu is actively developed, so I'm sure some of 
the steps will be outdated soon. If something isn't where you're expecting it, just poke around.</p>

<h2>Installation</h2>

<p>The initial installation is dead simple. Download the latest build of <code>ConEmuSetup.exe</code> from the 
<a href="https://code.google.com/p/conemu-maximus5/downloads/list">Google Code site</a>. Run the installer. You know the drill.</p>

<h2>Configuration</h2>

<p>The default UI isn't what I was looking for:</p>

<p><img src="https://dl.dropbox.com/u/1042234/blog/images/posts/2012-07-06/default-ui.png" alt="ConEmu's sad default UI" /></p>

<p>And it ran cmd.exe instead of PowerShell by default.</p>

<p>I wanted to make several tweaks to the out-of-the-box ConEmu configuration:</p>

<ul>
<li>Load PowerShell when launched, set to my home directory.</li>
<li>Make the console instantly available from anywhere with a keyboard shortcut.</li>
<li>Set font to Consolas at my prefered size and make the background semi-transparent.</li>
<li>Run in true full screen mode with no tabs or other chrome visible.</li>
</ul>

<p>It took a little while to figure out how to do each of these, because the settings dialogs are complex and
not always user friendly.</p>

<h2>Run PowerShell at Startup</h2>

<p>Let's start by getting PowerShell loading correctly:</p>

<ol>
<li>Press <strong>Win+Alt+P</strong> to launch the <strong>Settings</strong> window.</li>
<li><p>Click <strong>Startup | Tasks</strong> and create a new task configured like this:</p>

<p>Task name: <strong>Default</strong><br />
Task parameters: <strong>/dir "C:\Users\mylogin"</strong><br />
Commands: <strong>>&#42;powershell.exe</strong></p></li>
<li><p>Click <strong>Startup</strong>.</p></li>
<li>Select the radio button next to <strong>Specified named task</strong>, then select the <strong>{Default}</strong> task.</li>
<li>Click <strong>Save settings</strong>. </li>
<li>Restart ConEmu. PowerShell should load and set the starting directory to your user's home folder.</li>
</ol>

<h2>Set a Global Hotkey</h2>

<p>I wanted to map a global hotkey for ConEmu to <strong>Win+<code>**, which is similar to the **Ctrl+</code></strong> shortcut
I use for Terminal on my MacBook.</p>

<ol>
<li>Press <strong>Win+Alt+P</strong> to launch the <strong>Settings</strong> window.</li>
<li>Click <strong>Keys &amp; Macro</strong>.</li>
<li>Click the global <strong>Minimize/Restore</strong> shortcut.</li>
<li>Remove the <strong>Shift</strong> modifier, and set the hotkey to <strong>`</strong>. Make sure <strong>Install keyboard hooks</strong> is 
 checked.</li>
<li>Remove the hotkey for the <strong>Recreate active console</strong> (or whatever shortcut conflicts with your chosen
 hotkey.)</li>
<li>Click <strong>Save settings</strong>.</li>
</ol>

<h2>Pretty it up</h2>

<p>Let's get that Quake-style goodness going now.</p>

<ol>
<li>Press <strong>Win+Alt+P</strong> to launch the <strong>Settings</strong> window.</li>
<li><del>Click <strong>Main</strong>.</del> These steps are unnecessary, per Maximus of ConEmu fame. </li>
<li><del>Select the <strong>Full screen</strong> radio button under <strong>Console size and window position</strong>.</del></li>
<li>Click <strong>Features</strong>.</li>
<li>Deselect <strong>Always show scrollbar</strong>.</li>
<li>Select <strong>Quake style slide down</strong> under <strong>Caption and border options</strong>.</li>
<li>Enter a <strong>Pad size (pix)</strong> of 8 under <strong>Caption and border options</strong>.</li>
<li>Click <strong>Features | Tabs</strong>. </li>
<li>Deselect <strong>Enable Tabs</strong> under <strong>Tabs (panels, editors, viewers)</strong>. This only hides tabs; you can 
 still open new tabs with <strong>Win+N</strong> and switch between them with <strong>Ctrl+Tab</strong>.</li>
<li>Click <strong>Features | Transparency</strong>.</li>
<li>Select the <strong>Active window transparency</strong> checkbox. </li>
<li>Move the <strong>Transparent</strong> slider until the opacity works for you.</li>
<li>Click <strong>Save settings</strong>.</li>
</ol>

<p>I did decide to leave the status bar, as it has a few handy bits of info like process IDs, the 
ConEmu version number and the number of open tabs. Each piece of information can be toggled on or off under<br />
<strong>Features | Status bar</strong>.</p>

<h2>Fix the fonts</h2>

<p>And to make the text look presentable:</p>

<ol>
<li>Click <strong>Main</strong>.</li>
<li>Select the <strong>Clear Type</strong> radio button under <strong>Anti-aliasing</strong>. </li>
<li>Select <strong>Consolas</strong> in the <strong>Font</strong> and <strong>Change frames font</strong> menus. I also bumped the size up to 20
 because I tend to sit back a bit from my hi-res monitors.</li>
<li>Click <strong>Features | Status bar</strong>.</li>
<li>Change the font to <strong>Consolas</strong> and set the size to <strong>20</strong>.</li>
</ol>

<h2>Enjoy!</h2>

<p>Here's what my instantly available, full screen console looks like when it's open:</p>

<p><img src="https://dl.dropbox.com/u/1042234/blog/images/posts/2012-07-06/tweaked-ui.png" alt="My tweaked ConEmu console" /></p>

<p>There's a lot more to explore with ConEmu. The <a href="https://code.google.com/p/conemu-maximus5/wiki/TableOfContents?tm=6">documentation</a> could use some serious help, so if you enjoy the
app, consider offering to help.</p>

<p>And let me know in the comments if I missed any great features that you've discovered.</p>
]]></description>
  </item>
 
  <item>
    <title>Command line tips wiki</title>
    <pubDate>Wed, 04 Jul 2012 00:00:00 -0400</pubDate>
    <link>http://whiletruecode.com/post/command-line-wiki</link>
    <guid>http://whiletruecode.com/post/command-line-wiki</guid>     
    <description><![CDATA[<p>Whether I'm on a Mac, Windows or Linux machine, I love working at the command line. My weapon
of choice on my &#42;nix is <a href="http://www.zsh.org">zsh</a> running inside a <a href="http://tmux.sourceforge.net/">tmux</a> session.</p>

<p>On Windows, I use PowerShell inside of <a href="http://sourceforge.net/projects/console/">Console2</a>, which provides some UI nicities like window
transparency. Lately I've added <a href="https://github.com/bmatzelle/gow">GNU on Windows</a> into the mix, which provides a collection of
handy &#42;nix utilities like grep ported to run on Windows.</p>

<p>This page is a little cheat sheet of miscellaneous tips that I have trouble remembering.</p>

<h2>bash and zsh</h2>

<p><strong>Ctrl+U</strong>: Clears the current line.</p>

<p><strong>Ctrl+Z</strong>: Unfreezes the screen after you inadvertently froze it with <strong>Ctrl+S</strong>. I <em>hate</em> this binding,
since every single program in the entire world uses this as a keyboard shortcut for save, and it's hardwired
into my muscle memory. Gah.</p>

<h2>PowerShell</h2>

<p><strong>Esc</strong>: Clears the current line.</p>
]]></description>
  </item>
 
  <item>
    <title>Search any site with Alfred or Launchy</title>
    <pubDate>Wed, 04 Jul 2012 00:00:00 -0400</pubDate>
    <link>http://whiletruecode.com/post/search-any-site-with-alfred-or-launchy</link>
    <guid>http://whiletruecode.com/post/search-any-site-with-alfred-or-launchy</guid>     
    <description><![CDATA[<p>My blog is a personal wiki of sorts. Instead of keeping things I want to remember in Evernote
or OneNote, I try to do a quick write up and put it where others could find it.</p>

<p>The blog is hosted on <a href="http://scriptogr.am/">Scriptogr.am</a>, which is somewhat bare bones and lacks a  built-in
search engine. When I need to refer to an old post, I use <a href="http://duckduckgo.com/">DuckDuckGo</a>'s site search feature by
entering my search terms, followed by <code>site:whiletruecode.com</code>.</p>

<p>Today I decided to make it easier to search my blog from my favorite app launchers, <a href="http://www.alfredapp.com/">Alfred</a> on 
Mac OS X and <a href="http://www.launchy.net/">Launchy</a> on Windows.</p>

<p>Here's how I set it up.</p>

<h2>Custom searches in Alfred</h2>

<p>To create a custom site search in Alfred:</p>

<ol>
<li><p>In your favorite search engine, perform a search for a simple term on whatever site
 you'd like to create a shortcut to. Here are examples searching my blog for <strong>javascript</strong>
 on Google and DuckDuckGo:</p>

<p>https://www.google.com/search?q=javascript+site:whiletruecode.com 
   http://duckduckgo.com/?q=javascript+site:whiletruecode.com</p></li>
<li><p>Open Alfred's Preferences panel.</p></li>
<li>Click the <strong>Custom Searches</strong> item under <strong>Web &amp; URL</strong> in the sidebar.</li>
<li>Click the <strong>+</strong> icon to add a new custom search.</li>
<li>Paste the search URL from step 1 into the <strong>Search URL</strong> field. </li>
<li><p>Delete the search term you used and substitute it with <code>{query}</code>. The result should look
 something like this:</p>

<p>http://duckduckgo.com/?q={query}+site:whiletruecode.com</p></li>
<li><p>Check the <strong>Encode spaces as +</strong> box.</p></li>
<li>In the <strong>Title</strong> field, enter <code>Search DuckDuckGo for {query}</code>.</li>
<li>Enter a short term in the <strong>Keyword</strong> field. This is the term you'll use to trigger your 
 custom search. I used <strong>blog</strong>.</li>
<li>Click <strong>Add</strong>.</li>
</ol>

<p>To use your custom site search:</p>

<ol>
<li>Launch Alfred.</li>
<li>Enter the keyword you chose in step 8 above, followed by a space, then your search terms.</li>
<li>Press <strong>Return</strong>. Your default browser will open with a new tab containing your search 
  results.</li>
</ol>

<h2>Custom searches in Launchy</h2>

<p>To create a custom site search in Launchy:</p>

<ol>
<li><p>In your favorite search engine, perform a search for a simple term on whatever site
 you'd like to create a shortcut to. Here are examples searching my blog for <strong>javascript</strong>
 on Google and DuckDuckGo:</p>

<p>https://www.google.com/search?q=javascript+site:whiletruecode.com 
   http://duckduckgo.com/?q=javascript+site:whiletruecode.com</p></li>
<li><p>Open Launchy's <strong>Options</strong> panel.</p></li>
<li>Click the <strong>Plugins</strong> tab.</li>
<li>Click the <strong>Weby</strong> plugin.</li>
<li>Click the <strong>+</strong> button to add a new entry.</li>
<li>Enter a short term in the <strong>Name</strong> field. This is the term you'll use to trigger your 
 custom search. I used <strong>blog</strong>.</li>
<li>Paste the search URL from step 1 into the <strong>URL</strong> field. </li>
<li><p>Delete the search term you used and substitute it with <code>%1</code>. The result should look
 something like this:</p>

<p>http://duckduckgo.com/?q=site:whiletruecode.com+%1</p>

<p><em>Note</em>: Launchy was dropping characters from the end of the URL when I put the <code>site</code>
 portion of the URL last, so I moved it to the front and appended the search term 
 variable <code>%1</code> to the end.</p></li>
<li><p>Click <strong>OK</strong>.</p></li>
</ol>

<p>To use your custom site search:</p>

<ol>
<li>Open Launchy.</li>
<li>Enter the keyword you chose in step 8 above. </li>
<li>Press <strong>Tab</strong>.</li>
<li>Enter your search terms.</li>
<li>Press <strong>Enter</strong>. Your default browser will open with a new tab containing your search 
 results.</li>
</ol>
]]></description>
  </item>
 
  <item>
    <title>MVC isn't dead, we're just abusing it</title>
    <pubDate>Tue, 03 Jul 2012 00:00:00 -0400</pubDate>
    <link>http://whiletruecode.com/post/mvc-isnt-dead-were-just-abusing-it</link>
    <guid>http://whiletruecode.com/post/mvc-isnt-dead-were-just-abusing-it</guid>     
    <description><![CDATA[<p>The MVC pattern has taken a bit of a beating lately, including a <a href="http://cirw.in/blog/time-to-move-on">declaration that it's dead</a>.</p>

<p>MVC, according to this detractor, is ill suited for modern applications because:</p>

<blockquote>
  <p>You have models, which are nice self-contained bits of state, views which are nice self-contained bits 
  of UI, and controllers which are nice self-contained bits of … What?</p>
  
  <p>… the problem with MVC as given is that you end up stuffing too much code into your controllers, 
  because you don't know where else to put it.</p>
</blockquote>

<p>This certainly happens all the time, and it's an issue with other MV* patterns like MVP and MVVM as well.</p>

<p>A <a href="http://thoughts.rockhymas.com/">colleague</a> and I have spent the first part of the week working on a Compact Framework Windows Mobile 
app that uses the MVP pattern. Many of the presenters in this app are a mishmosh of view, application and 
business logic. The presenters do all the real work, and the models are</p>

<p>As we've worked, it's become clear that the problematic parts of the code are really following more of a 
<em>VP</em> pattern, as the "model" mostly consists of simple business objects. Application flow and business
logic is mostly handled in the presenter. The result looks a lot like a slightly more testable codebehind file.</p>

<p>This tendency is far from an indictment of the MV* patterns. The real issue is that these patterns were never
intended to supply the full architecture for a complex application. MVC, MVP and MVVM are 
<em>presentational patterns</em> designed for building user interfaces that sit in front of full-on applications.</p>

<p>Relying on a presentation pattern to meet all of your application architecture needs is a more sophisticated 
version of styling your HTML page with inline styles. Shoving complex business and core application logic 
into what amounts to a dynamic view layer is an intermingling of concerns that won't end well.</p>

<p>Rails bears a good measure of blame for this misconception. A generation of programmers has learned 
application architecture from a framework that is optimized for rapidly developing small web applications. 
Rails doesn't provide any guidance once your app outgrows a simplistic MVC folder structure, so devs either 
make their models fatter or pile the pasta high in their controllers.</p>

<p>Rather than refashioning MVC or declaring it dead, let's remember what it was meant to do in the first place.
Let's dig up some of the hard-won lessons from older frameworks, maybe swallow a little of that scorn for 
Java and other ancient technologies, and rediscover useful concepts like tiered architectures with business 
and persistence layers.</p>

<p><a href="http://www.confreaks.com/videos/759-rubymidwest2011-keynote-architecture-the-lost-years">Uncle Bob would be proud</a>.</p>
]]></description>
  </item>
    
</channel>
</rss>