<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Rails vs Whitewater</title>
	<atom:link href="http://justinspowers.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://justinspowers.com</link>
	<description>Whitewater enthusiast by day, Ruby on Rails programmer by night.</description>
	<lastBuildDate>Sat, 10 Dec 2011 07:42:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Rails 3.1 Asset Pipeline automation</title>
		<link>http://justinspowers.com/2011/12/rails-3-1-asset-pipeline-automation/</link>
		<comments>http://justinspowers.com/2011/12/rails-3-1-asset-pipeline-automation/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 07:35:44 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Github]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://justinspowers.com/?p=112</guid>
		<description><![CDATA[I&#8217;ve been spending a lot of time lately working on getting the asset pipeline for my application working. A lot of things weren&#8217;t very clear from the documentation at the time of this writing, so I am going to narrate the process I went through in case anybody else has the same issue. For a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been spending a lot of time lately working on getting the asset pipeline for my application working. A lot of things weren&#8217;t very clear from the documentation at the time of this writing, so I am going to narrate the process I went through in case anybody else has the same issue.</p>
<p>For a background on the asset pipeline, please read through the <a title="rails guide" href="http://guides.rubyonrails.org/asset_pipeline.html" onclick="pageTracker._trackPageview('/outgoing/guides.rubyonrails.org/asset_pipeline.html?referer=');">rails guide</a> and these two <a title="excellent" href="http://railscasts.com/episodes/279-understanding-the-asset-pipeline" onclick="pageTracker._trackPageview('/outgoing/railscasts.com/episodes/279-understanding-the-asset-pipeline?referer=');">excellent</a> <a title="railscasts" href="http://railscasts.com/episodes/282-upgrading-to-rails-3-1" onclick="pageTracker._trackPageview('/outgoing/railscasts.com/episodes/282-upgrading-to-rails-3-1?referer=');">railscast</a> by Ryan Bates. These got me about 90% of the way there.</p>
<p><span id="more-112"></span>One of the main goals of the asset pipeline is to bundle together all of your application&#8217;s javascript and stylesheets, condense them, and serve them to the end user with a sophisticated caching approach.  This works very well for many of the applications on the web.  In the case of my application, we had several javascript files that were specific to individual pages, and didn&#8217;t play well (for one reason or another) with other areas of the site.  It has long been a requirement that these javascripts are only loaded for these specific pages.  We were accomplishing this by creating a yield section in our application.html.erb like so:<br />
<code>&lt;%= yield :head_includes %&gt;</code><br />
Then, in the pages were we needed to load a javascript file, we would put the javascript_include_tag inside a content_for block, like so:<br />
<code>&lt;% content_for :head_includes do %&gt;<br />
&lt;%= javascript_include_tag "search.js" %&gt;<br />
&lt;% end %&gt;</code><br />
This worked quite well for us in rails 3.0.  However, in Rails 3.1 with the asset pipeline enabled, this would throw an error:<br />
<code>search.js isn't precompiled</code><br />
My first attempt at getting this to work was to run<br />
<code>bundle exec rake assets:precompile</code></p>
<p>This compiled all of my coffeescript assets, as well as application.js, however the default rails configuration doesn&#8217;t precompile files with .js or .css extensions (although .js.coffee or .css.scss would be precompiled).  I could have renamed all of my files to end with .js.coffee, but I wanted to move away from declaring individual files on various views, and I wanted javascript files that are run on similar pages to be bundled together.  The rails guide had this bit of advice:</p>
<p>You should put any JavaScript or CSS unique to a controller inside their respective asset files, as these files can then be loaded just for these controllers with lines such as <tt>&lt;%= javascript_include_tag params[:controller] %&gt;</tt> or <tt>&lt;%= stylesheet_link_tag params[:controller] %&gt;</tt>.</p>
<p>This was decent advice, however the assets still weren&#8217;t being compiled.  That would take a few more steps.  First, I created a manifest file for any controller that had controller specific javascripts.  For example, if a controller named EventsController had specific javascript files, I would create events.js (if it didn&#8217;t already exist).  To that file, I added the following statements:</p>
<p><code>//= require_tree "./events"</code></p>
<p>I would also include the following if the file already existed with existing javascript:</p>
<p><code>//= require_self</code></p>
<p>I would then dump any controller specific .js files into the folder specified by the require_tree directive.  I also had to add the manifest files to the list of files to precompile by adding the following to config/application.rb (with an entry for each manifest file, comma separated):</p>
<p><code>config.assets.precompile += ['events.js', 'pages.js']</code></p>
<p>For the sake of organization, I also moved a lot of javascript files to vendor/assets/javascripts and lib/assets/javascripts, as appropriate.  I then updated application.rb to list all of the files that needed to be included on every page, using require and require_tree directives.  I then was able to replace my various javascript_include_tag lines in my application.html.erb file with the following:</p>
<p><code>&lt;%= stylesheet_link_tag 'application'%&gt;<br />
&lt;%= stylesheet_link_tag controller.controller_name if individual_css_file_exists?(controller.controller_name) %&gt;<br />
&lt;%= javascript_include_tag 'application' %&gt;<br />
&lt;%= javascript_include_tag controller.controller_name if individual_js_file_exists?(controller.controller_name) %&gt;</code></p>
<p>Note that controller.controller_name is similar to params[:controller], except where you have namespaced controllers. For example, Admin::EventsController would return &#8220;events&#8221; for controller.controller_name, and &#8220;admin/events&#8221; if you use params[:controller].  I chose the former for simplicity&#8217;s sake.  I also created the following helpers in application_helper.rb</p>
<p><code>def individual_css_file_exists?(name)<br />
  !GoVoluntr::Application.assets.find_asset("#{name}.css").nil?<br />
end</p>
<p> def individual_js_file_exists?(name)<br />
  !GoVoluntr::Application.assets.find_asset("#{name}.js").nil?<br />
end</code></p>
<p>This helped to avoid the dreaded &#8220;controller.js is not precompiled&#8221; error when a manifest file didn&#8217;t exist for that specific controller.</p>
<p>This may seem like an awful lot of work for the application to essentially work the same as it did before.  The benefit, however, is that I can remove a lot of redundant code from each of my view files, and I get a reasonable tradeoff between combining multiple javascript files and only loading certain code on specific pages.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinspowers.com/2011/12/rails-3-1-asset-pipeline-automation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OMG CONSUMERIST</title>
		<link>http://justinspowers.com/2010/12/omg-consumerist/</link>
		<comments>http://justinspowers.com/2010/12/omg-consumerist/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 23:50:27 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Side Ventures]]></category>
		<category><![CDATA[Budget]]></category>
		<category><![CDATA[Consumerist]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[OMG OMG]]></category>

		<guid isPermaLink="false">http://justinspowers.com/?p=103</guid>
		<description><![CDATA[So, I read this cool article on one of my favorite blogs Consumerist. I fired off a quick note to the editor Ben to suggest a budget spreadsheet roundup. I also gave him access to collaborate on the document. I was just trying to be helpful and I expected to see a post in a [...]]]></description>
			<content:encoded><![CDATA[<p>So, I read this cool article on one of my favorite blogs <a href="http://consumerist.com/2007/02/math-problem-best-paying-off-credit-card-method-snowball-or-orzman.html" onclick="pageTracker._trackPageview('/outgoing/consumerist.com/2007/02/math-problem-best-paying-off-credit-card-method-snowball-or-orzman.html?referer=');">Consumerist</a>.  I fired off a quick note to the editor Ben to suggest a budget spreadsheet roundup.  I also gave him access to collaborate on the document.  I was just trying to be helpful and I expected to see a post in a few days to announce a roundup.   Much to my surprise, I got an <b><a href="http://consumerist.com/2010/12/dangerps-sweet-excel-budget-spreadsheet-with-debt-snowball.html" onclick="pageTracker._trackPageview('/outgoing/consumerist.com/2010/12/dangerps-sweet-excel-budget-spreadsheet-with-debt-snowball.html?referer=');">entire post of my own!</a></b></p>
<p>This threw me off quite a bit.  I wasn&#8217;t quite sure what the best distribution model for the spreadsheet was, but I&#8217;m pretty sure it&#8217;s not google docs.  Also, when converted to Excel the formulas get all wonky.  Now I have a good number of readers that are more annoyed by having to figure out how to properly get and use my spreadsheet than they are helped by using it.</p>
<p>I&#8217;m not quite sure what the best way to handle this is.  If anyone has any ideas, let me know.  I want to allow collaboration, but I don&#8217;t want the entire internet to be able to change it at will (if only to preserve the integrity of the formulas).</p>
<h2>Update:</h2>
<p>I&#8217;ve decided to host the file on AWS to simplify posting updates.  Here&#8217;s the linky:<br />
<a href="http://goo.gl/KL4Pd" onclick="pageTracker._trackPageview('/outgoing/goo.gl/KL4Pd?referer=');">Debt Spreadsheet</a></p>
]]></content:encoded>
			<wfw:commentRss>http://justinspowers.com/2010/12/omg-consumerist/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Be a pal, ditch IE</title>
		<link>http://justinspowers.com/2010/04/be-a-pal-ditch-ie/</link>
		<comments>http://justinspowers.com/2010/04/be-a-pal-ditch-ie/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 06:34:23 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://justinspowers.com/?p=96</guid>
		<description><![CDATA[Disclaimer: It is the middle of the night, and I&#8217;m still coding. And I&#8217;m not happy about it. This post is mostly for venting purposes. I work on a linux machine to do all of my coding (and, well, everything else). This has so far worked great, with one minor exception. I can&#8217;t test photify.net [...]]]></description>
			<content:encoded><![CDATA[<p>Disclaimer: It is the middle of the night, and I&#8217;m still coding.  And I&#8217;m not happy about it.  This post is mostly for venting purposes.</p>
<p>I work on a linux machine to do all of my coding (and, well, everything else).  This has so far worked great, with one minor exception.  I can&#8217;t test photify.net in Internet explorer (easily).  So far, my workaround has been to code and test using firefox and chrome, and then when things are nearly complete, hop over to my wife&#8217;s win7 laptop to make sure everything looks good.  Not efficient, but it has worked alright in the past.<br />
<span id="more-96"></span><br />
This was basically my process when I pushed out a major layout update a couple weeks ago.  Everything looked good on the wife&#8217;s computer, so I went ahead and pushed it out.  Fast forward to a couple days ago, and I get an email of frustration from a customer that says that &#8220;half the shopping cart is gone&#8221;.  After a ton of troubleshooting later, I find out that she is apparently using IE7 (my wife has IE8), and it was rendering things totally wrong.</p>
<p>Look.  I am aware that Firefox and Chrome are standards compliant, and therefore render things &#8220;correctly&#8221; according to how I have coded the CSS.  I am also aware that IE is not standards compliant, and if history is any indicator may never be (although IE 8 is certainly much closer).  I have always been in the habit of checking to make sure that the CSS that works for standards compliant browsers work for IE.  What I didn&#8217;t realize is that a page that works in IE6 (due to IE6 specific workarounds) doesn&#8217;t work in IE7, but does in IE8 (due to being more standards compliant).  Grrr.  Instead of fixing the bugs from IE6, they just made different ones.  After a lot of internet searching, I came up with a solution: force IE into quirks mode.</p>
<p>Logic would dictate that forcing the page into quirks mode would have the same effect on all browsers.  However, what I have found is that a proper comment in the very first line of the HTML page will confuse ALL versions of IE, sending them into quirks mode, but a standards compliant browser recognizes it for what it is: a comment.  Here is what I put as the very first line in all of my pages:</p>
<p><code>&lt;!--Friends don't let friends use Internet Explorer --!&gt;</code></p>
<p>Works like a charm.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinspowers.com/2010/04/be-a-pal-ditch-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A mountain of a man &#8211; Bob Powers</title>
		<link>http://justinspowers.com/2010/04/mountain-of-a-man-bob-powers/</link>
		<comments>http://justinspowers.com/2010/04/mountain-of-a-man-bob-powers/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 00:07:10 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://justinspowers.com/?p=64</guid>
		<description><![CDATA[Note: This blog post is a notable departure from the usual programming posts I tend to make. This article is one that I wrote for the Art Of Manliness Lessons in Manliness group writing project. The goal of the project was to write an article about a man in your life that taught you a [...]]]></description>
			<content:encoded><![CDATA[<p><em>Note: This blog post is a notable departure from the usual programming posts I tend to make.  This article is one that I wrote for the Art Of Manliness Lessons in Manliness group writing project.  The goal of the project was to write an article about a man in your life that taught you a valuable life lesson.  In this case I chose my grandfather.  Although it was conveniently timed for the project, it is an article I was wanting to write anyways, after being inspired by so many other stellar articles on the Art of Manliness blog.  Enjoy!<br />
</em></p>
<p><strong>Lessons in Manliness: A mountain of a man &#8211; Bob Powers</strong></p>
<p id="nzs4"><a href="http://justinspowers.com/wp-content/uploads/2010/04/bob-powers.png"><img src="http://justinspowers.com/wp-content/uploads/2010/04/bob-powers-272x300.png" alt="Bob Powers Cowboy Country" title="bob powers" width="272" height="300" class="aligncenter size-medium wp-image-88" /></a></p>
<p>Written by Justin Powers</p>
<p>My grandfather (Robert &#8220;Bob&#8221; L Powers, 6/7/1924 – 9/11/2002) was born in the beautiful and serene Kern River Valley in the majestic Sierra Nevada mountains of California.  He was the 5th generation of his family to live in the Valley.  He was born the son of a rancher, and spent his young days learning about the family trade.  At the age of one, his family made their yearly trip up into the mountains to set the cattle loose in the high sierra grazing grounds.  My grandfather made the 50+ mile trip on the front of his father&#8217;s saddle.  He was later told that he kept kicking the horse in the shoulders, nearly getting them bucked off several times.  He was riding a horse on his own at the age of three.</p>
<p><span id="more-64"></span></p>
<p>Over the course of his life, my grandfather fulfilled many roles.  He was a rancher for quite some time, working on the farm and driving the cattle into the high country every year.  He served in the U.S. Navy (although he didn&#8217;t last long due to a sleepwalking problem). He was a ranger in the Forest Service for many years, where he was regarded by all as the one that insisted on doing things the right way, the first time.  He was also a deeply virtuous man.  His loving marriage to his wife of 50+ years will be long remembered as the highest standard of a loving marriage.  He touched many lives during these years, although it is his later acts that make him truly remarkable.</p>
<p>In 1965, during my grandfather&#8217;s work in the Forest Service, he was approached by a stranger that was publishing a so called &#8220;mug book&#8221;, where a family would be able to purchase a page or two to write information or stories about their family, in order to preserve their heritage.  It sounded like a swell idea to my grandfather, so he took this man around to various families and old timers around the valley.  The stranger gathered the stories and information from these people, and collected the fees for publishing the book.  Shortly after collecting all this, the stranger disappeared, taking $175,00 with him, and leaving the stories.  This broke my grandfather&#8217;s heart as all of his friends had trusted him with their money and their heritage.</p>
<p>He decided there was only one thing to do.  He told his friends that he would gather some information and have someone write it up.  It would be a publication, rather than a book.  However, he just couldn&#8217;t find anyone that would write it the way that he wanted it to be written.  So he sat down and started writing a book about the history of the valley, compiled from the stories he had collected, along with his own knowledge, and conversations with others.  It soon became apparent that all of this simply wouldn&#8217;t fit in one book, so he wrote several books, each concentrating on a small but valuable piece of the valley&#8217;s rich heritage and history.  The books contained stories of stagecoach robbers, that would lie in wait for unsuspecting travelers coming through.  He told of the pioneers and ranchers, that fell in love with the area&#8217;s flowing rivers, and fertile soil.  Then there was the 49ers, that came in droves driven by the promise of gold.  The cowboys, and their deep relationship with each other and the land.  The Indians, with their rich culture and near-forgotten practices from before the coming of the white man, continuing to their mixed relationship with the white man, and how it occasionally turned violent.  There are stories of feuding families, and lawmen chasing outlaws that would make the greatest John Wayne movies seem boring in comparison.  All of this was printed alongside original photographs and journal entries of the people that made up the valley&#8217;s heritage.</p>
<p>As he started to write more books, people began to give him more stories and pictures.  After he had finished the first five books, he started on another.  He told his wife that this would be his last book.  He continued on to write more &#8220;last&#8221; books, up to the final total of 9 books.</p>
<p>Bob Powers died on the September 11th, 2002, the anniversary of the WTC attacks.  Many found this to be somewhat poetic, given his strong patriotism and love for his country.  Immediately following his death people from all walks of life came together to try to find a way to honor his memory.  A group formed to begin work on naming a mountain in his memory.  Overwhelming support was given in the form of letters of recommendation to government officials from the Forest Service, California congressmen and assemblymen, historical societies, various indian tribes, as well as numerous teachers and representatives from the local school district, who used his books to teach history to the schoolchildren, just to name a few.  Reading through the list of supporters gives a profound sense of the impact he made on other&#8217;s lives.</p>
<p id="byld"><a href="http://justinspowers.com/wp-content/uploads/2010/04/Powers-Peak.jpg"><img src="http://justinspowers.com/wp-content/uploads/2010/04/Powers-Peak-300x225.jpg" alt="Powers Peak Kernville, CA" title="Powers Peak" width="300" height="225" class="alignnone size-medium wp-image-87" /></a></p>
<p>On August 14th, 2008, the US Board on Geographic Names unanimously approved the naming of a previously unnamed peak to <span style="text-decoration: underline;">Powers Peak</span>.  This is the day that I first considered my grandfather to be a &#8216;mountain man&#8217;.  In a state that has borne many people that go on to become presidents, and yet do not get their own mountain, my grandfather, son of a rancher, and a man of little means, has had such a profound impact on so many people that an entire mountain was named in his honor.</p>
<p>It is beyond my skills as a writer to express the profound impression this had upon me.  My grandfather was never a great leader, never had a high level job, and never did any of the things that many of us think about when we ponder the meaning of success.  Yet in his simple life he managed to touch so many lives, that something so eternal and unmovable as a mountain was given his name.  He simply had a deep and undying love for his God, his family, his friends, his valley, and his country.  He never hesitated to do what he could for those that he loved.</p>
<p>I will likely never have a mountain named in my honor.  I also would not like to.  However, I often wonder if I have the integrity and strength of spirit to become that mountain man that my grandfather was.  As I write this article, I begin to search for the key attributes that make a mountain man, as demonstrated by my grandfather.</p>
<p><strong>Unconditional Love</strong></p>
<p>My grandfather had 5 great loves in his life: His God, his wife, his family, his country, and his valley.  I&#8217;m of course not talking about the romantic passionate love that is all the rage in the movies.  I&#8217;m talking about a sincere, dedicated virtuous love for those things that you hold important.  Aristotle referred to this as &#8220;Philia&#8221; love.  In his work Rhetoric, Aristotle defines this type of love as:</p>
<p><span style="font-family: sans-serif;">&#8220;wanting for someone what one thinks good, for his sake and not for one&#8217;s own, and being inclined, so far as one can, to do such things for him&#8221;(1380b36–1381a2)</span></p>
<p>His undying love for each of these was an integral part of what I believe made him a mountain man.  That unconditional love led him to perform such selfless acts as spend 35+ years painstakingly cataloging and conserving the history of the valley.  In today&#8217;s world, love is often exchanged in return for something else.  We will only love someone if they do things for us or treat us a certain way.  In watching my grandfather&#8217;s life, he loved because it was his duty, and his calling.  And doing so not only touched people&#8217;s lives, but it made his own life that much more fulfilling!</p>
<p>In today&#8217;s world, love is so often given away with a hint of selfishness. We often only commit loving acts when there is something in it for us.  My grandfather&#8217;s multi-decade quest to preserve that which would otherwise be lost certainly didn&#8217;t make him rich, and consumed a large part of his love.  But this quest earned him the respect and gratitude of the entire area.</p>
<p><strong>Integrity</strong></p>
<p>When it comes to the core traits that really make up a mountain man, integrity has to be at the top of the list.  Something about standing at the base of a mountain and looking up at it&#8217; permanence reminds me of the kind of unmoving integrity of character that embodies a mountain man.  After all, you could have all of the compassion and good intentions in the world, but if you lack the integrity to stand firm in your convictions, what good are they?</p>
<p>Princeton WordPress defines integrity as &#8220;moral soundness&#8221;.  However, this succint phrase fails to show the full picture of what I believe integrity is.  To me, you can sum up my grandfather&#8217;s integrity with this one statement:  He did the right thing, the right way, every time.</p>
<p><strong>Do the Right Thing</strong></p>
<p>It would have been extremely easy for my grandfather to just be the victim when that scoundrel took everyone&#8217;s money.  He could have dismissed it and went on with his life.  Instead, my grandfather spent the vast majority of his adult life researching and writing those 9 books, as well as finding and donating hundreds of items to the local museum, from pictures, to an old ranch stove, to an entire cabin!  All of this came about from one simple decision early on to do the right thing by his people, and to write those books.  It always isn&#8217;t the easy way to go, especially when it is at the expense of your future, and your hopes and dreams.  But these are the decisions that transform us into mountain men.</p>
<p><strong>Do it the Right Way</strong></p>
<p>While in the US Forest Service, a relatively new employee was tasked with the laborious job of creating a barbed wire fence that stretched for well over a mile.  He worked hard at his task, and after several hours my grandfather came by to see his work.  He took one look at the fence and told the man to start over.  When asked for a reason, he said that all of the posts must be driven to a certain depth, and they must all be at a uniform height.  The new employee tried in vain to convince my grandfather that the fence was structurally sound, and would likely last throughout the year (which was likely true).  My grandfather then explained to him how a little more time spent now would prevent someone else having to go back later on to fix the mistakes.  He also emphasized the sense of pride in completing a job well done.  That new employee&#8217;s entire career from that day forward was carried out following my grandfather&#8217;s advice.</p>
<p><strong>Do it Every Time:</strong></p>
<p>Many of us are content to perform some great act of selflessness, and then return straight to our normal ways.  After all, we did the right thing, now we deserve some time to ourselves. However, this was not the way that a mountain man sees things.  My grandfather was giving of himself all the way up to his very last days, by opening his home to those in need, giving in his church, finding more history that needed to be preserved, and loving his family every chance he got.  His selflessness never rested.  In our journey to become mountain men, we cannot give up on the doing the right thing, even if just for a moment, for it is in that moment that we fall short.</p>
<p><strong>How to be a Mountain Man:</strong></p>
<p>A stranger walked up to me on the day of my grandfather&#8217;s funeral, and said, &#8220;Your grandfather was a good man&#8221;.  Yes he was, but he was so much more than that.  He was a mountain man.  The great question is, and one that I struggle to answer every day, is what can I do myself to be a mountain man?  What have I done to impact the lives of others?  Can I be a mountain man? Can you? I believe that in order to become a mountain man, you must truly embody the principles of unconditional love and integrity, and never waver.  As men, we are not only able to be mountain men, but are called to it.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinspowers.com/2010/04/mountain-of-a-man-bob-powers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Out of sight, out of mind</title>
		<link>http://justinspowers.com/2009/12/out-of-sight-out-of-mind/</link>
		<comments>http://justinspowers.com/2009/12/out-of-sight-out-of-mind/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 15:19:54 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Photify.net]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Success]]></category>

		<guid isPermaLink="false">http://justinspowers.com/?p=55</guid>
		<description><![CDATA[So today I set up observe_form for one of my search forms. I&#8217;ve been wanting to get rid of the submit button for my form, so that when users change a search field, it would just update the search results, in real time. Think kayak.com. It took surprisingly minimal work, and the result just feels [...]]]></description>
			<content:encoded><![CDATA[<p>So today I set up observe_form for one of my search forms.  I&#8217;ve been wanting to get rid of the submit button for my form, so that when users change a search field, it would just update the search results, in real time.  Think kayak.com.  It took surprisingly minimal work, and the result just feels good.  One problem though, is that nothing happens when I change the time slider on my form.<br />
<span id="more-55"></span><br />
First things first.  There isn&#8217;t such thing as a slider on a form (at least until you get to HTML5, I believe), so I hacked a solution in.  Using a custom javascript slider, whenever the user moves the slider, a hidden_field_tag gets updated, by tying into the onSlide callback of the slider.  This hidden field is passed along with the rest of the form upon submission.  However, this hidden field isn&#8217;t being observed as part of observe_form.  I suspect it&#8217;s because javascript is doing the updating, and not the user.  Either way, I couldn&#8217;t find a rails way of fixing it.  Here&#8217;s my observe_form as it stands today:</p>
<p><code>&lt;%= observe_form  'search-form',<br />
  :before =&gt; "Element.show('spinner')",<br />
  :complete =&gt; "Element.hide('spinner')",<br />
  :url =&gt; {:action => 'search'}<br />
  %&gt;</code></p>
<p>My solution was to hook into the onChange callback of the slider itself (ignoring the hidden fields).  I used onChange instead of onSlide because I didn&#8217;t want a dozen requests going to the server per slide.  I simply added the following javascript.</p>
<p><code>Element.show('spinner');<br />
new Ajax.Request('/search',{asynchronous:true,<br />
  evalScripts:true,<br />
  onComplete:function(request){Element.hide('spinner')},<br />
  parameters:Form.serialize('search-form')});</code></p>
<p>A simple note: I suck at javascript.  Not that I&#8217;m particularly dense, I just haven&#8217;t taken the time to learn it.  I simply gleaned this little gem by using firebug to see what Rails had generated using the aforementioned observe_form, and simply modified it slightly.  Win!</p>
]]></content:encoded>
			<wfw:commentRss>http://justinspowers.com/2009/12/out-of-sight-out-of-mind/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Halfway to the O.K. Corral</title>
		<link>http://justinspowers.com/2009/11/halfway-to-the-o-k-corral/</link>
		<comments>http://justinspowers.com/2009/11/halfway-to-the-o-k-corral/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 04:46:07 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://justinspowers.com/?p=40</guid>
		<description><![CDATA[The saga of Movember is now officially halfway over (or halfway started, if you&#8217;re that type of person), and the Mo is coming along quite nicely. I feel confident that I&#8217;ll have a winning stash by the 30th. Here is a preview of the current status: Wanna support my efforts? You can do so in [...]]]></description>
			<content:encoded><![CDATA[<p>The saga of Movember is now officially halfway over (or halfway started, if you&#8217;re that type of person), and the Mo is coming along quite nicely.  I feel confident that I&#8217;ll have a winning stash by the 30th.  Here is a preview of the current status:</p>
<p><a href="http://justinspowers.com/2009/11/halfway-to-the-o-k-corral/img_0399_cropped/" rel="attachment wp-att-42"><img src="http://justinspowers.com/wp-content/uploads/2009/11/IMG_0399_cropped-300x259.jpg" alt="Where&#039;s the cowboy hat?" title="Justin Powers Movember " width="300" height="259" class="size-medium wp-image-42" /></a></p>
<p>Wanna support my efforts?  You can do so in only two simple steps.</p>
<p>1) Go to my <a href="http://us.movember.com/mospace/268892" onclick="pageTracker._trackPageview('/outgoing/us.movember.com/mospace/268892?referer=');">movember page</a>, and vote for my &#8216;stache!</p>
<p>2) Donate to the cause.  You can do so by visiting my <a href="http://us.movember.com/mospace/268892" onclick="pageTracker._trackPageview('/outgoing/us.movember.com/mospace/268892?referer=');">donation page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinspowers.com/2009/11/halfway-to-the-o-k-corral/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Movember &#8211; Changing the face of men&#8217;s health</title>
		<link>http://justinspowers.com/2009/11/movember-changing-the-face-of-mens-health/</link>
		<comments>http://justinspowers.com/2009/11/movember-changing-the-face-of-mens-health/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 16:41:17 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://justinspowers.com/?p=29</guid>
		<description><![CDATA[Movember is an awesome charity that I&#8217;ve been following for the past couple years. To the best of my knowledge, no other organization has harnessed the power of the moustache (aka &#8220;mo&#8221;) like these guys have. Movember is a month long moustache growing competition. As your moustache grows, you recruit sponsors, who give generously to [...]]]></description>
			<content:encoded><![CDATA[<p>Movember is an awesome charity that I&#8217;ve been following for the past couple years.  To the best of my knowledge, no other organization has harnessed the power of the moustache (aka &#8220;mo&#8221;) like these guys have.  Movember is a month long moustache growing competition.  As your moustache grows, you recruit sponsors, who give generously to the cause of fighting men&#8217;s health problems, specifically prostate and testicular cancer.  The month ends in parties and awesome &#8216;staches.</p>
<p>I have decided to join the fight.  Yesterday I honed my straight razor, and without mercy dispatched all of the manly hair from my face.  Here&#8217;s how I percieve the timeline:</p>
<p>Before:<br />
<img src="http://justinspowers.com/wp-content/uploads/2009/11/mugshot-237x300.jpg" alt="Before" title="Before" width="237" height="300" class="size-medium wp-image-30" /></p>
<p>Now:<br />
<img src="http://justinspowers.com/wp-content/uploads/2009/11/IMG_0357-300x225.jpg" alt="Now" title="Now" width="300" height="225" class="alignnone size-medium wp-image-31" /></p>
<p>29 Days from now:<br />
<img src="http://justinspowers.com/wp-content/uploads/2009/11/ron_burgundy-282x300.jpg" alt="After" title="After" width="282" height="300" class="alignnone size-medium wp-image-32" /></p>
<p>If anyone has any ideas for the particular style of moustache, let me know in the comments!  Use <a href="http://artofmanliness.com/2009/11/01/the-manliest-mustaches-of-all-time/" onclick="pageTracker._trackPageview('/outgoing/artofmanliness.com/2009/11/01/the-manliest-mustaches-of-all-time/?referer=');">this</a> for inspiration.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinspowers.com/2009/11/movember-changing-the-face-of-mens-health/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Of Capistrano, Github, and Branches (or, a forking mess)</title>
		<link>http://justinspowers.com/2009/10/of-capistrano-github-and-branches-or-a-forking-mess/</link>
		<comments>http://justinspowers.com/2009/10/of-capistrano-github-and-branches-or-a-forking-mess/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 01:58:25 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Efficiency]]></category>
		<category><![CDATA[Github]]></category>
		<category><![CDATA[Photify.net]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://justinspowers.com/?p=23</guid>
		<description><![CDATA[Disclaimer: I am a Github newbie, and I am still learning the various concepts. If I misrepresent something in this post, please let me know in the comments! I recently switched my project over from SVN to Github. My reasons were varied, but a large reason was because I needed to create various branches to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Disclaimer:</strong> I am a Github newbie, and I am still learning the various concepts.  If I misrepresent something in this post, please let me know in the comments!</p>
<p>I recently switched my project over from SVN to Github.  My reasons were varied, but a large reason was because I needed to create various branches to accomodate my ADD style of development (work on layouts for a bit, then switch to security, then switch to fine tuning my models).  I also need to create a branch for productions servers, as well as a branch for my staging server, which is set up at home.  The latter was a bit confusing at first, until I found a great tutorial <a href="http://weblog.jamisbuck.org/2007/7/23/capistrano-multistage" onclick="pageTracker._trackPageview('/outgoing/weblog.jamisbuck.org/2007/7/23/capistrano-multistage?referer=');">here</a>.</p>
<p>First, a couple of notes about my setup.  I am the sole contributor to my (private) repository.  Up until now, I have not had a need for this &#8220;forking&#8221; business that I see from time to time.  In configuring up my multistage setup, I ran into an issue when I tried to use <code>set :branch, "2.0"</code> in my staging deploy.rb file.  Even though I had created a branch for &#8220;2.0&#8243; like so:<br />
<code>git branch 2.0</code><br />
I was getting the following error:<br />
<code>`query_revision': Unable to resolve revision for 'invalid' on repository 'git@github.com:*****/******.git'. (RuntimeError)</code><br />
This confused me for quite some time, until I found out that the set :branch isn&#8217;t referring to the branches that I had created locally, but to github forks.  To create a fork from the branch, I simply had to do the following:<br />
<code>git checkout 2.0<br />
git push origin 2.0</code></p>
<p>The origin bit is what does the magic.  As soon as I refreshed, I was able to see the newly created fork in the github web UI, and my deploy recipe worked like magic.  Brilliant!</p>
<p>Note: I still have to find out how this will affect my git workflow, but since the clone URL is still the same, it seems that I should still be able to continue with my current way of doing things.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinspowers.com/2009/10/of-capistrano-github-and-branches-or-a-forking-mess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vanity</title>
		<link>http://justinspowers.com/2009/05/vanity/</link>
		<comments>http://justinspowers.com/2009/05/vanity/#comments</comments>
		<pubDate>Fri, 01 May 2009 21:54:00 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://justinspowers.com/?p=7</guid>
		<description><![CDATA[Lately I&#8217;ve been thinking a lot about my online presence. I mean, if I ever start to market Photify.net to other companies, and if anyone there is anything like me, then they&#8217;ll instantly type my name into google. So, I put myself in their shoes and did a little ego-search: It doesn&#8217;t look too promising. [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve been thinking a lot about my online presence. I mean, if I ever start to market Photify.net to other companies, and if anyone there is anything like me, then they&#8217;ll instantly type my name into google. So, I put myself in their shoes and did a little ego-search:</p>
<p><a href="http://2.bp.blogspot.com/_AbZcHH6oK1k/Si2KHhjQ9HI/AAAAAAAAEws/G0Tt3E0Ph2A/s1600-h/vanity.bmp" onclick="pageTracker._trackPageview('/outgoing/2.bp.blogspot.com/_AbZcHH6oK1k/Si2KHhjQ9HI/AAAAAAAAEws/G0Tt3E0Ph2A/s1600-h/vanity.bmp?referer=');"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 261px; height: 320px;" src="http://2.bp.blogspot.com/_AbZcHH6oK1k/Si2KHhjQ9HI/AAAAAAAAEws/G0Tt3E0Ph2A/s320/vanity.bmp" border="0" alt="" id="BLOGGER_PHOTO_ID_5345080194628646002" /></a></p>
<p>It doesn&#8217;t look too promising.  The first result is for the director of Pot Zombies.  Great.  The second?  An ad for penis enhancement pills (which, according to google, is also hosting malware.  Don&#8217;t go there).  Skip down a couple and you get a facebook profile.  That shouldn&#8217;t be too bad right?  Click on it and you&#8217;re greeted with a picture of some dude drinking what appears to be Jack Daniels straight out of the bottle with his buddy flipping of the camera.  Awesome.</p>
<p>None, however, are quite as disturbing as justinspowers.tripod.com.  This is most disturbing since the URL clearly has my middle initial, which so far is the only thing distinguishing me from the lower classes of Justin Powers.  It is a simple animated cartoon implying that I giggle, and openly announce that I am homosexual.  Promptly followed by a solicitation to kill me.  Please don&#8217;t.</p>
<p>Part of the point of this blog is to raise my google standing.  I suppose it will be some time before it breaks through the ranks on google.  I also created a google profile, which is nicely placed at the very bottom of the first page, forcing the would-be searcher to wade through mountains of the stoned undead, underage drinkers, and death threats.  Not so long ago my linked-in profile was at the top of the ranks (see <a href="http://www.linkedin.com/in/justinpowers" onclick="pageTracker._trackPageview('/outgoing/www.linkedin.com/in/justinpowers?referer=');">Justin Powers</a>), but it has fallen almost completely from Google&#8217;s view.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinspowers.com/2009/05/vanity/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ActiveMerchant nonsense</title>
		<link>http://justinspowers.com/2009/04/activemerchant-nonsense/</link>
		<comments>http://justinspowers.com/2009/04/activemerchant-nonsense/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 21:10:00 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[activemerchant]]></category>
		<category><![CDATA[Photify.net]]></category>
		<category><![CDATA[skipjack]]></category>

		<guid isPermaLink="false">http://justinspowers.com/?p=5</guid>
		<description><![CDATA[I&#8217;ve been a little hesitant about putting in credit card processing into Photify.net, and it turns out is was with good reason.  The set up is just plain annoying!  Due to client needs, I had to go with Skipjack as my portal.  They seem relatively developer friendly, except that their customer service is about 50/50, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been a little hesitant about putting in credit card processing into Photify.net, and it turns out is was with good reason.  The set up is just plain annoying!  Due to client needs, I had to go with Skipjack as my portal.  They seem relatively developer friendly, except that their customer service is about 50/50, literally.  I&#8217;ve called there several times during normal pacific hours, only to find out that in Eastern time I&#8217;m actually calling fairly late.  They only have two reps, one of which is helpless, and the other of which is knowleadgable and helpful.</p>
<p>After doing some digging, the best solution for processing payment in my rails app seems to be using ActiveMerchant.  It seems fairly well documented, at least if you are using a mainstream credit card processor like Authorize.net.  For skipjack though, it&#8217;s a little lacking.  For example, it&#8217;s not clear what, if anything, you need to put in the &#8216;password&#8217; field.  And no matter what I do, I can&#8217;t get any non-standard (by ActiveMerchant&#8217;s terms) fields to transmit, such as &#8220;comment&#8221;.  But perhaps the most frustrating thing of all, is when I had everything working and fine tuned in development, and I tried to throw the switch to production, by changing the login and using &#8220;:test =&gt; false&#8221; in the login hash.  After all, that is the only indication of where to send the transaction.  However, after several days of beating my head against the wall, I find this little gem (pardon the pun):</p>
<p><code>ActiveMerchant::Billing::Base.mode = :production</code></p>
<p>I almost slapped myself when I saw that.  Why in the world are there TWO places to set the mode?  Anyways, credit card processing now works, there is balance in the force, and everything is right in the world.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinspowers.com/2009/04/activemerchant-nonsense/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 1.637 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-20 05:28:42 -->

