<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.simpable.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">

  <title><![CDATA[Scott Watermasysk]]></title>
  
  <link href="http://www.scottw.com/" />
  <updated>2012-02-01T16:03:01+00:00</updated>
  <id>http://www.scottw.com/</id>
  <author>
    <name><![CDATA[Scott Watermasysk]]></name>
    <email><![CDATA[scottwater@gmail.com]]></email>
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.simpable.com/Simpable" /><feedburner:info uri="simpable" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
    
  	<title type="html"><![CDATA[Deploying Octopress to Heroku With a Custom Buildpack &#10150;]]></title><!-- add in a glyph or [link-post] here so people know where they're ending up -->
  	<link href="http://feeds.simpable.com/~r/Simpable/~3/NyqUxv1eM2o/" />
  	
    <updated>2012-02-01T10:09:00+00:00</updated>
    <id>http://www.scottw.com/deploying-octopress-to-heroku</id>
    
    <content type="html">&lt;p&gt;Why is this important? It means no more committing the public directory into git.&lt;/p&gt;

&lt;p&gt;Even with just 200 or so posts, my git history felt like it was exploding every time I wrote a new post.&lt;/p&gt;

&lt;p&gt;I went ahead and nuked my old blog repo and &lt;a href="http://github.com/scottwater/scottw.com"&gt;recommitted this cleaner&lt;/a&gt; (and leaner) version if you need a starting place.&lt;/p&gt;

&lt;p&gt;Jason&amp;#8217;s steps were great, but I did run into two snags:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I could not set the buildpack directly when creating the app. I had to add the heroku config var for it instead.&lt;/li&gt;
&lt;li&gt;I got an error about a missing daemon gem. Heroku&amp;#8217;s cedar stack is still in beta and running a RC version of bundler (as of today). I haven&amp;#8217;t dug any further, but nuking my gem vendor folder and starting over seemed to do the trick.&lt;/li&gt;
&lt;/ol&gt;

&lt;a rel="full-article" href="http://www.scottw.com/deploying-octopress-to-heroku"&gt;Permalink&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Simpable/~4/NyqUxv1eM2o" height="1" width="1"/&gt;</content><!-- add in a glyph or some way to denote that the permalink goes back to your site -->
  	
  <feedburner:origLink>http://jasongarber.com/blog/2012/01/10/deploying-octopress-to-heroku-with-a-custom-buildpack/</feedburner:origLink></entry>
  
  <entry>
    
  	<title type="html"><![CDATA[Octopress Linked List &#10150;]]></title><!-- add in a glyph or [link-post] here so people know where they're ending up -->
  	<link href="http://feeds.simpable.com/~r/Simpable/~3/8IBp3dxg0N0/" />
  	
    <updated>2012-02-01T06:39:00+00:00</updated>
    <id>http://www.scottw.com/octopress-linked-list</id>
    
    <content type="html">&lt;p&gt;I have been meaning to implement this on my own for a while.&lt;/p&gt;

&lt;p&gt;I did make one minor adjustment David&amp;#8217;s example. Instead of inlining the glyph, I am adding it via CSS:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='css'&gt;&lt;span class='line'&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nc"&gt;.external-link&lt;/span&gt;&lt;span class="nd"&gt;:after&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;content&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot; \27A6&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;a rel="full-article" href="http://www.scottw.com/octopress-linked-list"&gt;Permalink&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Simpable/~4/8IBp3dxg0N0" height="1" width="1"/&gt;</content><!-- add in a glyph or some way to denote that the permalink goes back to your site -->
  	
  <feedburner:origLink>http://www.candlerblog.com/2012/01/30/octopress-linked-list/</feedburner:origLink></entry>
  
  <entry>
    
  	<title type="html"><![CDATA[Async Emails With Sorcery]]></title>
  	<link href="http://feeds.simpable.com/~r/Simpable/~3/X6rP4Hl4fRs/async-emails-with-sorcery" />
  	
    <updated>2011-11-28T12:27:00+00:00</updated>
    <id>http://www.scottw.com/async-emails-with-sorcery</id>
    
    <content type="html">&lt;p&gt;For &lt;a href="http://www.kickofflabs.com"&gt;KickoffLabs&lt;/a&gt;, we rolled our own authentication. This worked really well, but doing it (even if we packaged it up) for future projects is less than appealing.&lt;/p&gt;

&lt;p&gt;I have used/tried Devise, Clearance, and AuthLogic but none of them seemed to fit.&lt;/p&gt;

&lt;p&gt;Enter &lt;a href="https://github.com/NoamB/sorcery"&gt;Sorcery&lt;/a&gt;. Sorcery is a relatively new player in the rails authentication arms race.&lt;/p&gt;

&lt;!--more--&gt;


&lt;p&gt;So far, I am really liking Sorcery[1]. It stays out of the way, has decent documentation, useful testing helpers, etc.&lt;/p&gt;

&lt;p&gt;Unfortunately, out of the box, Sorcery sends emails inline (same UI thread). In local development, this is not an issue. However, in production is this not acceptable.&lt;/p&gt;

&lt;p&gt;Looking through the Sorcery source code, I did not see a configuration hook related to this. But with a little bit of monkey patching, we can alter the behavior:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;span class='line-number'&gt;10&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='ruby'&gt;&lt;span class='line'&gt;&lt;span class="k"&gt;module&lt;/span&gt; &lt;span class="nn"&gt;Sorcery&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;module&lt;/span&gt; &lt;span class="nn"&gt;Model&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="k"&gt;module&lt;/span&gt; &lt;span class="nn"&gt;InstanceMethods&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;generic_send_email&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;method&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mailer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;        &lt;span class="n"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sorcery_config&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;        &lt;span class="n"&gt;mail&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mailer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;enqueue&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;method&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;In this case, I am simply overriding the generic_send_email method. The enqueue method comes from my own &lt;a href="https://github.com/scottwater/resque_mail_queue"&gt;Resque Mail Queue&lt;/a&gt; gem. You could very easily do something similar with delayed_job, etc.&lt;/p&gt;

&lt;p&gt;Since I am using Resque, I also updated my mailer actions to use the user (model) id instead of the user model. Otherwise, nothing else in Sorcery needs to change.&lt;/p&gt;

&lt;p&gt;I doubt this is the ideal way to &amp;#8216;fix&amp;#8217; this issue, but it works for now and allows me to move forward.&lt;/p&gt;

&lt;p&gt;[1] &lt;em&gt;Well, I should clarify I am liking the ActiveRecord adapter. I haven&amp;#8217;t been able to get the Mongoid one working properly&amp;#8230;but that could be something on my side.&lt;/em&gt;&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Simpable/~4/X6rP4Hl4fRs" height="1" width="1"/&gt;</content>
  	
  <feedburner:origLink>http://www.scottw.com/async-emails-with-sorcery</feedburner:origLink></entry>
  
  <entry>
    
  	<title type="html"><![CDATA[Heroku SSL via DNSimple]]></title>
  	<link href="http://feeds.simpable.com/~r/Simpable/~3/bSx9XTMljc0/heroku-ssl-and-dnsimple" />
  	
    <updated>2011-11-22T09:56:00+00:00</updated>
    <id>http://www.scottw.com/heroku-ssl-and-dnsimple</id>
    
    <content type="html">&lt;p&gt;If you google for Heroku SSL you will find a surprisingly long list of blog posts usually with many steps.&lt;/p&gt;

&lt;p&gt;However, it is actually much easier than what most of them list, especially if you are using &lt;a href="https://dnsimple.com/r/a2fb5da9458e27"&gt;DNSimple&lt;/a&gt; (note: affiliate link).&lt;/p&gt;

&lt;p&gt;Here is how to setup a &lt;strong&gt;Hostname Based&lt;/strong&gt; certificate on Heroku:&lt;/p&gt;

&lt;!--more--&gt;


&lt;p&gt;&lt;em&gt;Note: For wildcard certificates check out &lt;a href="http://ryan.mcgeary.org/2011/09/16/how-to-add-a-dnsimple-ssl-certificate-to-heroku/"&gt;Ryan McGeary&amp;#8217;s blog post&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Head over to &lt;a href="https://dnsimple.com/r/a2fb5da9458e27"&gt;DNSimple&lt;/a&gt; and buy a certificate.&lt;/li&gt;
&lt;li&gt;After you click purchase, DNSimple will give you a private key. Download and save this to a file called private.key.&lt;/li&gt;
&lt;li&gt;After jumping through a couple hoops with RapidSSL you will receive an email with 2 certificates. Save the first (web server certificate) as web.crt and the second (intermediate) as chain.crt.&lt;/li&gt;
&lt;li&gt;You will now need to combine these two files. cat web.crt chain.crt &gt; domain.pem did the trick for me with &lt;strong&gt;ONE&lt;/strong&gt; major exceptions. There needs to be a line break between END CERTIFICATE and BEGIN CERTIFICATE (web and chain). This could be a copy and paste issue on my part, but they were not separated and caused an issue.&lt;/li&gt;
&lt;li&gt;Now you can add them to Heroku with: &lt;em&gt;heroku ssl:add domain.pem private.key&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Next enable the cert on Heroku: &lt;em&gt;heroku addons:add ssl:hostname&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Finally, in a minute or two you will receive an email with CNAME you need add to your DNS settings.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;The file names private.key, web.crt, chain.crt, and domain.pem should be named something more appropriate for your domain. The exact names have no meaning.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Simpable/~4/bSx9XTMljc0" height="1" width="1"/&gt;</content>
  	
  <feedburner:origLink>http://www.scottw.com/heroku-ssl-and-dnsimple</feedburner:origLink></entry>
  
  <entry>
    
  	<title type="html"><![CDATA[Static Files using Sinatra::Base on Heroku]]></title>
  	<link href="http://feeds.simpable.com/~r/Simpable/~3/McwayR0tAeU/sinatra-public-heroku" />
  	
    <updated>2011-11-01T10:11:00+00:00</updated>
    <id>http://www.scottw.com/sinatra-public-heroku</id>
    
    <content type="html">&lt;p&gt;I deployed a small &lt;a href="http://www.sinatrarb.com/"&gt;Sinatra&lt;/a&gt; app last night to &lt;a href="http://www.heroku.com"&gt;Heroku&lt;/a&gt; for the new &lt;a href="http://api.kickofflabs.com"&gt;KickoffLabs API&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Most of the Sinatra apps I have deployed in the past have been small prototypes and used the inline Sinatra app style.&lt;/p&gt;

&lt;p&gt;However, in this case, I made the decision early on to use the Sinatra::Base class style since we plan on growing the API codebase (ie, we are going to keep it around for a long time).&lt;/p&gt;

&lt;!--more--&gt;


&lt;p&gt;Everything was working as expected locally, but once I deployed to Heroku none of the static files in the public directories were rendering properly (all were 404&amp;#8217;ing).&lt;/p&gt;

&lt;p&gt;It turns out that when you use the Sinatra::Base class style, you need to set the public directory explicitly like this:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='ruby'&gt;&lt;span class='line'&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;KickoffAPI&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;Sinatra&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="n"&gt;set&lt;/span&gt; &lt;span class="ss"&gt;:public&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;public&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Now this makes a lot of sense since in hindsight, but took me longer than I would like to admit to figure out. Hopefully this post and a little Google foo will save others a couple of hours.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Simpable/~4/McwayR0tAeU" height="1" width="1"/&gt;</content>
  	
  <feedburner:origLink>http://www.scottw.com/sinatra-public-heroku</feedburner:origLink></entry>
  
  <entry>
    
  	<title type="html"><![CDATA[My Favorite Tools For A Simple Development Environment]]></title>
  	<link href="http://feeds.simpable.com/~r/Simpable/~3/DYeLnViRgX4/simple-dev-tools" />
  	
    <updated>2011-09-13T10:41:00+00:00</updated>
    <id>http://www.scottw.com/simple-dev-tools</id>
    
    <content type="html">&lt;p&gt;Here is an updated list of the tools I use daily to try and make development both simple and enjoyable.&lt;/p&gt;

&lt;!--more--&gt;


&lt;p&gt;&lt;a href="http://www.iterm2.com/#/section/home"&gt;iTerm2&lt;/a&gt; - I practically live in this thing. As I said before, &lt;a href="http://www.scottw.com/why-iterm-dope"&gt;iterm2 is absolutely dope&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://code.google.com/p/macvim/"&gt;MacVim&lt;/a&gt; - I am back to using MacVim more than vim in iTerm2. I still copy and paste lazily and MacVim feeds that laziness.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://mocksmtpapp.com/"&gt;MockSMTP&lt;/a&gt; - I know there are some free browser alternatives, but this thing is so damn simple to use, I love it.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.charlesproxy.com/"&gt;CharlesProxy&lt;/a&gt; - If you really need to dig into a request, CharesProxy rocks (and no, the browser developer tools don&amp;#8217;t count).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/mxcl/homebrew"&gt;HomeBrew&lt;/a&gt; - install just about anything you need for development with ease.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/kennethreitz/osx-gcc-installer"&gt;OS X GCC installer&lt;/a&gt; - works perfectly with Homebrew and removes the need to install Xcode. My only recent issue with this was the rb-fsevent gem which appears to look for Xcode. You can fix that (temporarily) by using this branch: pre-compiled-gem-one-off&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/sstephenson/rbenv"&gt;rbenv&lt;/a&gt; - I have only had a couple minor issues with RVM, so I decided to give rbenv a try. I have been using it for 3 to 4 weeks and so far it has been great (and solid).&lt;/p&gt;

&lt;p&gt;&lt;a href="http://pow.cx/"&gt;pow&lt;/a&gt; - I don&amp;#8217;t use Pow as much for active rails development (restarting rails too slow) but when you need to run multiple websites that interact locally it is amazing. In addition, it is a great way to host small local apps (like this blog).&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.zsh.org/"&gt;zsh&lt;/a&gt; - sadly I am still noobish in the shell, but starting to get better.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://ethanschoonover.com/solarized"&gt;Solarized&lt;/a&gt; - What I really love about solarized is having a consistent set of colors across multiple tools (iTerm2, vim, macvim, textmate, etc.).&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Simpable/~4/DYeLnViRgX4" height="1" width="1"/&gt;</content>
  	
  <feedburner:origLink>http://www.scottw.com/simple-dev-tools</feedburner:origLink></entry>
  
  <entry>
    
  	<title type="html"><![CDATA[My Favorite Startup and Ruby Podcasts]]></title>
  	<link href="http://feeds.simpable.com/~r/Simpable/~3/JQQ3F4nEijQ/my-favorite-podcasts" />
  	
    <updated>2011-09-08T19:18:00+00:00</updated>
    <id>http://www.scottw.com/my-favorite-podcasts</id>
    
    <content type="html">&lt;p&gt;My taste in podcasts varies by what is actually going on in my life. Right now it is mostly startups (&lt;a href="http://www.kickofflabs.com"&gt;KickoffLabs&lt;/a&gt;) and Ruby.&lt;/p&gt;

&lt;p&gt;Here are my current favorites:&lt;/p&gt;

&lt;!--more--&gt;


&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.lifestylebusinesspodcast.com/"&gt;The Lifestyle Business Podcast&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Don&amp;#8217;t let the name full you. These guys are seriously focused on solid business skills. I have only been listening to them for a month or two, but it is one the few podcasts I now listen to every week.&lt;/p&gt;

&lt;p&gt;Two recent episodes stand out to me:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="http://www.lifestylebusinesspodcast.com/tough-truths-about-business/"&gt;9 Tough Truths About Running a Business and Changing Your Life&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.lifestylebusinesspodcast.com/define-hustle/"&gt;The Tao of the Hustle&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&lt;strong&gt;&lt;a href="http://mixergy.com"&gt;Mixergy&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Mixergy might be the podcast I have been subscribed to the longest. What I really like about Mixergy is the mix interviews: Founders of big and small companies, VCs, and everyone in-between.&lt;/p&gt;

&lt;p&gt;Recent favorites:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="http://mixergy.com/bruno-bornsztein-curbly-interview/"&gt;Curbly’s Founder Tells Me To Stop Ignoring Lifestyle Businesses – with Bruno Bornsztein&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://mixergy.com/tom-rossi-molehill-interview/"&gt;Molehill’s Founder: Aim For Lifestyle, Not A Jackpot – with Tom Rossi&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://mixergy.com/paperless-pipeline-maxwell-interview/"&gt;How To Build A Profitable Lifestyle Web App, Even If You’re Not A Developer – with Dane Maxwell&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://mixergy.com/oren-klaff-pitch-anything-interview/"&gt;Pitch Anything&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://mixergy.com/derek-sivers-blog-interview/"&gt;Leadership Through Stories?! – with Derek Sivers&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&lt;em&gt;Note: Looks like the last two require a premium membership&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="http://ruby5.envylabs.com/"&gt;Ruby 5&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Quick and concise updates on what is going in the Ruby world. Published twice a week and as you might guess, they are about 5 minutes long.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="http://railscasts.com/"&gt;RailsCasts&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://twitter.com/rbates"&gt;Ryan Bates&lt;/a&gt; publishes a weekly screencast on Rails. If you do work with Rails (or want to) you absolutely must subscribe to this podcast.&lt;/p&gt;

&lt;p&gt;Recent interesting episodes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="http://railscasts.com/episodes/280-pry-with-rails"&gt;Pry with Rails&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://railscasts.com/episodes/279-understanding-the-asset-pipeline"&gt;Understanding the Asset Pipeline&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Others that I occasionaly listen to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="http://thisdeveloperslife.com/"&gt;This Developers Life&lt;/a&gt; - Great developer stories.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://thechangelog.com/"&gt;The Changelog&lt;/a&gt; - This used to be one of my top 5, but it has fallen off the radar for me.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://rubyrogues.com/"&gt;Ruby Rogues&lt;/a&gt; - Really good Ruby discussion on a single topic or two per week.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://vimcasts.org/"&gt;VimCasts&lt;/a&gt; - I continue to be shocked at what can be done in Vim.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.startupsfortherestofus.com/"&gt;Startups For the Rest of Us&lt;/a&gt; - If you are a developer and want to build your own startup, you can&amp;#8217;t go wrong with this one.&lt;/li&gt;
&lt;/ol&gt;

&lt;img src="http://feeds.feedburner.com/~r/Simpable/~4/JQQ3F4nEijQ" height="1" width="1"/&gt;</content>
  	
  <feedburner:origLink>http://www.scottw.com/my-favorite-podcasts</feedburner:origLink></entry>
  
  <entry>
    
  	<title type="html"><![CDATA[Resque Mail Queue Gem]]></title>
  	<link href="http://feeds.simpable.com/~r/Simpable/~3/fsRq5dUCORA/resque-mail-queue-gem" />
  	
    <updated>2011-09-07T07:29:00+00:00</updated>
    <id>http://www.scottw.com/resque-mail-queue-gem</id>
    
    <content type="html">&lt;p&gt;I have written two times (&lt;a href="http://www.scottw.com/simple-resque-mail-queue"&gt;Simple Resque Mail Queue&lt;/a&gt; and &lt;a href="http://www.scottw.com/simple-resque-mail-queue-ii"&gt;Simple Resque Mail Queue II&lt;/a&gt;) before about a simple module &lt;em&gt;MailQueue&lt;/em&gt; which can be used to easily send email asynchronously with &lt;a href="http://github.com/defunkt/resque"&gt;Resque&lt;/a&gt;.&lt;/p&gt;

&lt;!--more--&gt;


&lt;p&gt;Thanks to &lt;a href="https://twitter.com/leshill/"&gt;Les Hill&amp;#8217;s&lt;/a&gt; really simple instructions on &lt;a href="http://blog.leshill.org/blog/2011/08/21/write-your-own-gemspec.html"&gt;writing your own gemspec&lt;/a&gt;, I have finally published it as a ruby gem: &lt;a href="https://github.com/scottwater/resque_mail_queue"&gt;resque_mail_queue&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Assuming you already have Resque installed, to use it, you simply need to add this to your GemFile:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='ruby'&gt;&lt;span class='line'&gt;&lt;span class="n"&gt;gem&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;resque\_mail\_queue&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;From there, similar to the previous examples, to use it simply add &lt;em&gt;enqueue&lt;/em&gt; before you Action Mailer methods:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='ruby'&gt;&lt;span class='line'&gt;&lt;span class="no"&gt;UserMailer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;enqueue&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;welcome_email&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;The version is set at 0.2.0, but I am not expecting too many changes. I will bump it to 1.0 as soon as I add a custom matcher for cleaner specs and get some additional outside feedback.&lt;/p&gt;

&lt;p&gt;If you are using the previous Gist versions, here are the changes I made:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;No dependency on Active Support. This is probably not a big deal for most rails projects, but less dependencies is always a good thing.&lt;/li&gt;
&lt;li&gt;The object passed to Resque is now the mailer class instead of MailQueue. This makes specs a little cleaner to read since you are referencing the actual mailer.&lt;/li&gt;
&lt;li&gt;The queue the emails are placed in can now be changed per mailer.&lt;/li&gt;
&lt;li&gt;The module is now injected into ActionMailer::Base and available on all of your mailers.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;This was my first &lt;em&gt;real&lt;/em&gt; gem. So if you see anything odd in it, please let me know.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Simpable/~4/fsRq5dUCORA" height="1" width="1"/&gt;</content>
  	
  <feedburner:origLink>http://www.scottw.com/resque-mail-queue-gem</feedburner:origLink></entry>
  
  <entry>
    
  	<title type="html"><![CDATA[Improving Automated Timezone Detection]]></title>
  	<link href="http://feeds.simpable.com/~r/Simpable/~3/-A4hdHxMxgw/automated-timezone-detection" />
  	
    <updated>2011-09-06T08:30:00+00:00</updated>
    <id>http://www.scottw.com/automated-timezone-detection</id>
    
    <content type="html">&lt;p&gt;tl;dr - Just using the Javascript getTimezoneOffset to auto-detect timezone information will not work properly during daylight savings and has a couple of other minor gotchas. Check out the &lt;a href="https://bitbucket.org/pellepim/jstimezonedetect/wiki/Home"&gt;jsTimezoneDetect&lt;/a&gt; and my simple &lt;a href="https://github.com/scottwater/jquery.detect_timezone"&gt;jQuery detect_timezone plugin&lt;/a&gt; for more accurate timezone information. I also put together a gem, &lt;a href="https://github.com/scottwater/detect_timezone_rails"&gt;detect_timezone_rails&lt;/a&gt;, to automate the process in Rails.&lt;/p&gt;

&lt;!--more--&gt;


&lt;h3&gt;What are we trying to do?&lt;/h3&gt;

&lt;p&gt;Rails makes it very easy to display dates/times are translated and offset properly for the current user.&lt;/p&gt;

&lt;p&gt;The standard approach is to display a list of known timezones (time_zone_options_for_select) and then take that value and assign it to Time.zone somewhere early in your request.&lt;/p&gt;

&lt;p&gt;With this setting, dates in things like your ActiveRecord models will be translated into your users local time (assuming you know what it is).&lt;/p&gt;

&lt;h3&gt;Automate It!&lt;/h3&gt;

&lt;p&gt;Anytime you can remove an unnecessary task for a user, your application gets better. Timezone selection is increasingly a thing of the past. By now you have probably seen plenty of articles explaining how you do this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Wire up a bit of javascript and grab the value of new Date().getTimezoneOffset()&lt;/li&gt;
&lt;li&gt;Take this value and store it in a cookie or a hidden field (or just send it to the server via ajax)&lt;/li&gt;
&lt;li&gt;Use this value to offset time values&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;In Rails, this is particularly easy because not only does Time.zone accept a string representing the timezone name, but you can also specify an offset directly.&lt;/p&gt;

&lt;p&gt;And this method works perfectly well&amp;#8230;.until you hit daylight saving time.&lt;/p&gt;

&lt;p&gt;For example, on April 28th in Eastern Standard Time, using getTimezoneOffset() it correctly reported my offset as 14,400 seconds (4 hours). However, this is only because of daylight savings. Normally my offset would be 5 hours.&lt;/p&gt;

&lt;p&gt;Setting my current timezone with a four hour offset gets me close, but ends up putting me off by 1 hour.&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='ruby'&gt;&lt;span class='line'&gt;&lt;span class="no"&gt;Time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;zone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;240&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;minutes&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="no"&gt;Time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;zone&lt;/span&gt; &lt;span class="c1"&gt;# =&amp;gt; (GMT-4:00) Atlantic Time (Canada)&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="no"&gt;Time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;current&lt;/span&gt; &lt;span class="c1"&gt;# =&amp;gt;  Thu, 28 Apr 2011 10:13:03 ADT -03:00&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Now this kind of makes sense. Setting Time.zone via an offset does not have anyway of knowing whether or not it is daylight savings, so it simply ignores it. Adding even more complexity is the fact there are quite a few timezone overlaps. Running rake time:zones:local shows there are 5 different timezones which are UTC -05:00. So even if I did manage to figure out the offset should be 300 minutes, how would we know which of the five to choose? (btw, it defaults to the first in the list, which for -05:00 is Bogota).&lt;/p&gt;

&lt;h3&gt;The Answer&lt;/h3&gt;

&lt;p&gt;The downer hear is there really is no perfect option here. Timezones are simply a mess and there will always be edge cases.&lt;/p&gt;

&lt;p&gt;However, there is a bit of hope by using &lt;a href="https://bitbucket.org/pellepim/jstimezonedetect/wiki/Home"&gt;jsTimezoneDetect&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Determining timezones using javascript is not trivial out of the box. Different browsers use different acronyms and conventions for representing names of timezones, it also differs depending on the user&amp;#8217;s operating system. This little script tries to take a pragmatic approach by using a few simple algorithms using the JavaScript Date object.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;With jsTimezoneDetect you can retrieve the Olson timezone name, offset, and whether or not it daylight savings time or not. Even better, with the Olson name you can remove most of the ambiguity in setting the Time.zone.&lt;/p&gt;

&lt;p&gt;We are using jsTimezoneDetect on &lt;a href="http://www.kickofflabs.com"&gt;KickoffLabs&lt;/a&gt; and it has worked great. We have never had to ask our customers to choose from a monster list of timezones and we can send them reminders/etc at times that are much more likely to get a response (ie, status emails are sent at 8 am local time).&lt;/p&gt;

&lt;p&gt;I am going to use jsTimezoneDetect in a couple of other projects, so over the past weekend I took some time to automate it&amp;#8217;s usage.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/scottwater/jquery.detect_timezone"&gt;jquery.detect_detect_timezone&lt;/a&gt; is a jquery plugin which makes grabbing the Olson timezone name from jsTimezoneDetect trivial.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/scottwater/detect_timezone_rails"&gt;detect_timezone_rails&lt;/a&gt; is a ruby gem which takes advantage of Rails 3.1 asset pipeline. Using the jQuery plugin is optional, but it is nice to have it easily available.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;img src="http://feeds.feedburner.com/~r/Simpable/~4/-A4hdHxMxgw" height="1" width="1"/&gt;</content>
  	
  <feedburner:origLink>http://www.scottw.com/automated-timezone-detection</feedburner:origLink></entry>
  
  <entry>
    
  	<title type="html"><![CDATA[Multiple Smtp Servers With Action Mailer]]></title>
  	<link href="http://feeds.simpable.com/~r/Simpable/~3/Ebdd5CCUfHo/multiple-smtp-servers-with-action-mailer" />
  	
    <updated>2011-09-04T09:25:00+00:00</updated>
    <id>http://www.scottw.com/multiple-smtp-servers-with-action-mailer</id>
    
    <content type="html">&lt;p&gt;We recently started using &lt;a href="http://postmarkapp.com"&gt;PostMark&lt;/a&gt; on &lt;a href="http://www.kickofflabs.com"&gt;KickoffLabs&lt;/a&gt;. So far the service has been excellent. Unfortunately, not all of our emails fit their terms of service. I looked around for how configure an addition SMTP server via Action Mailer (and Mail gem). Surprisingly, this is not supported.&lt;/p&gt;

&lt;!--more--&gt;


&lt;p&gt;However, &lt;a href="http://stackoverflow.com/questions/2662759/how-to-send-emails-with-multiple-dynamic-smtp-using-actionmailer-ruby-on-rails"&gt;this question on StackOverflow&lt;/a&gt; helped point me towards a solution.&lt;/p&gt;

&lt;div&gt;&lt;script src='https://gist.github.com/1192857.js?file='&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;module Postmarker

  def postmark_mail(*args)

    mail_message = mail(*args)
    
   if can_use_postmark?(mail_message.From.to_s) 

     mail_message.delivery_method.settings.merge!(
        :address =&amp;gt; 'smtp.postmarkapp.com', 
        :user_name =&amp;gt; ENV['POSTMARK_API_KEY'],
        :password =&amp;gt; ENV['POSTMARK_API_KEY'], 
        :port =&amp;gt; 2525, 
        :authentication =&amp;gt; 'plain', 
        :enable_starttls_auto =&amp;gt; true, 
        :domain =&amp;gt; 'kickofflabs.com')

    end

    mail_message
  end

  def can_use_postmark?(from_address)
    ENV['POSTMARK_API_KEY'] &amp;amp;&amp;amp; Rails.env.production? &amp;amp;&amp;amp; valid_address?(from_address)
  end

  def valid_address?(from_address)
    %w{scott@kickofflabs.com support@kickofflabs.com}.include?(from_address)
  end
end&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;&lt;/div&gt;


&lt;p&gt;From here, the Postmarker module can be included in a mailer subclass, or injected in ActionMailer::Base&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='ruby'&gt;&lt;span class='line'&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ActionMailer&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="kp"&gt;include&lt;/span&gt; &lt;span class="no"&gt;Postmarker&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;A quick overview of what is happening here:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The Postmarker module adds a new method, postmark_mail, to all of our mailers. I initially tried to simply override mail, but the meta-magic in the mailers was making it too complicated. Also, in the end, there were some emails which passed the Postmarker validation but where not appropriate for Postmark. Put another way, it was simply better to be explicit.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The postmark_mail method calls the main mail method. It then optionally overrides the SMTP server settings if the mail is valid for Postmark (in our case, this is just validating the environment and from address).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;postmark_mail simply returns the Mail::Message and everything else progresses as normal.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;In the end, this really has nothing to do with PostMark, so it should be applicable to other providers. I chose to keep it simply and did not worry about further customization.&lt;/p&gt;

&lt;p&gt;One change I would still love to make is supporting multiple &lt;em&gt;delivery_methods&lt;/em&gt;, but as of now that does not appear feasible. If you have any suggestions, please let me know.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Simpable/~4/Ebdd5CCUfHo" height="1" width="1"/&gt;</content>
  	
  <feedburner:origLink>http://www.scottw.com/multiple-smtp-servers-with-action-mailer</feedburner:origLink></entry>
  
  <entry>
    
  	<title type="html"><![CDATA[Octopress Tips]]></title>
  	<link href="http://feeds.simpable.com/~r/Simpable/~3/AXWud-Qzd3Q/octopress-tips" />
  	
    <updated>2011-08-25T17:38:00+00:00</updated>
    <id>http://www.scottw.com/octopress-tips</id>
    
    <content type="html">&lt;p&gt;I am really digging using &lt;a href="http://octopress.org"&gt;Octopress&lt;/a&gt; (see &lt;a href="http://www.scottw.com/moving-to-octopress"&gt;Moving to Octopress&lt;/a&gt; and &lt;a href="http://www.scottw.com/octopress-customizations"&gt;Octopress Customizations&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Here are a couple of tips to make your experience using it even better.&lt;/p&gt;

&lt;!--more--&gt;


&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Be willing to delete posts. Every post in Octopress carries some kind of &lt;em&gt;generate cost&lt;/em&gt;. If the post is no longer relevant relevant/helpful/etc, delete it. Nothing from the web is ever truly deleted, so don&amp;#8217;t think you can erase something stupid. However, there is no reason to keep junk around. Besides, since your blog lives in git, you can always resurrect the post in the future.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;At least for me, writing is a trial and error process. I write something, review it, rewrite it, etc. Waiting for your site to recompile (even using watcher) can be a drag once you get past a hand full of posts. If you run &lt;em&gt;rake isolate[&amp;#8216;post-name&amp;#8217;]&lt;/em&gt; Octopress will hide all your other posts and allow your site to be regenerated much quicker. When you are all done execute &lt;em&gt;rake integrate&lt;/em&gt; and everything comes back. And of course since you are using git nothing is ever really gone anyway.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&amp;lt;!&amp;#8211;more&amp;#8211;&amp;gt; is your friend against duplicate content. You can place this anywhere in your post to mark an excerpt. I like doing this for older posts to keep my lists small and tidy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use &lt;a href="http://pow.cx"&gt;Pow&lt;/a&gt; to preview your site locally. I have mine wired up to scottw.dev. Now anytime I need to review something locally it is ready. Run rake watcher while writing and it will (almost) always be up to date.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do not forget you can preview both markdown and textile via Vim and Textmate. You will not get the full benefit of Octopress&amp;#8217;s plugins, but it is a really quick way to preview your post.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Any other suggestions?&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Simpable/~4/AXWud-Qzd3Q" height="1" width="1"/&gt;</content>
  	
  <feedburner:origLink>http://www.scottw.com/octopress-tips</feedburner:origLink></entry>
  
  <entry>
    
  	<title type="html"><![CDATA[Octopress Customizations]]></title>
  	<link href="http://feeds.simpable.com/~r/Simpable/~3/YgpbH-Gj0ss/octopress-customizations" />
  	
    <updated>2011-08-23T09:39:00+00:00</updated>
    <id>http://www.scottw.com/octopress-customizations</id>
    
    <content type="html">&lt;p&gt;Here is a quick list of non-style changes I made before deploying my &lt;a href="http://octopress.org"&gt;Octopress&lt;/a&gt; site (&lt;a href="https://github.com/scottwater/scottw.com"&gt;see it all on Github&lt;/a&gt;):&lt;/p&gt;

&lt;!--more--&gt;


&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Permalinks only contain the title. No need for other dates/etc. (permalink: /:title in _config.yml)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Moved archives out of the blog directory. I am not going to write a post called archives (at least I hope not), so there is no need for the extra directory.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Added a &lt;a href="https://github.com/scottwater/scottw.com/blob/53f501550cf4f2a1c95b6f16417c2e6cdf131828/source/404.html"&gt;404 page&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Swapped the order of &lt;a href="https://github.com/scottwater/scottw.com/blob/master/source/_includes/head.html"&gt;page title and site title&lt;/a&gt;. All sites should do this. Might send this as a pull request.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Added the about me aside to my sidebar (custom/asides/about.html)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Added rel=&amp;#8221;author&amp;#8221; to the &lt;a href="https://github.com/scottwater/scottw.com/blob/master/source/_includes/post/author.html"&gt;author include&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Wired up the excellent &lt;a href="https://github.com/jtrupiano/rack-rewrite"&gt;Rack-Rewrite&lt;/a&gt; for handing old urls and forcing all requests to one domain.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;span class='line-number'&gt;10&lt;/span&gt;
&lt;span class='line-number'&gt;11&lt;/span&gt;
&lt;span class='line-number'&gt;12&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='ruby'&gt;&lt;span class='line'&gt; &lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="no"&gt;Rack&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Rewrite&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="n"&gt;r301&lt;/span&gt; &lt;span class="sr"&gt;%r{.*}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;http://www.scottw.com$&amp;amp;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:if&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;Proc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;rack_env&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="n"&gt;rack_env&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;SERVER_NAME&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;www.scottw.com&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="no"&gt;ENV&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;RACK_ENV&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;production&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="n"&gt;r301&lt;/span&gt; &lt;span class="sr"&gt;%r{^/life|code|business|software(/.+)}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;$1&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="n"&gt;r301&lt;/span&gt; &lt;span class="sr"&gt;%r{^/archive$}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/archives&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="n"&gt;r301&lt;/span&gt; &lt;span class="sr"&gt;%r{^(.+)/$}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;$1&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="n"&gt;r301&lt;/span&gt; &lt;span class="sr"&gt;%r{^/tags}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="n"&gt;r301&lt;/span&gt; &lt;span class="sr"&gt;%r{^/atom$}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/atom.xml&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;&lt;em&gt;Note: The 404 and rewrites only works with Octopress because I am using a Ruby (Heroku) host.&lt;/em&gt;&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Simpable/~4/YgpbH-Gj0ss" height="1" width="1"/&gt;</content>
  	
  <feedburner:origLink>http://www.scottw.com/octopress-customizations</feedburner:origLink></entry>
  
  <entry>
    
  	<title type="html"><![CDATA[Moving to Octopress]]></title>
  	<link href="http://feeds.simpable.com/~r/Simpable/~3/Cv0W6-6R8OY/moving-to-octopress" />
  	
    <updated>2011-08-21T23:03:00+00:00</updated>
    <id>http://www.scottw.com/moving-to-octopress</id>
    
    <content type="html">&lt;p&gt;If you are reading this, my move to &lt;a href="http://octopress.org/"&gt;Octopress&lt;/a&gt; should be complete.&lt;/p&gt;

&lt;p&gt;Octopress is a framework built on &lt;a href="https://github.com/mojombo/jekyll"&gt;Jekyll&lt;/a&gt; and maintained by &lt;a href="http://brandonmathis.com/"&gt;Brandon Mathis&lt;/a&gt;. It adds two killer features to Jekyll.&lt;/p&gt;

&lt;!--more--&gt;


&lt;ol&gt;
&lt;li&gt;A simple theme/template with easy to follow conventions&lt;/li&gt;
&lt;li&gt;A nice community contributing patches/plugins/etc.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Most people appear to run Octopress on GitHub pages. This is a great choice, but for this site, I decided to stay on &lt;a href="http://heroku.com"&gt;Heroku&lt;/a&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Everything else I host is now on Heroku.&lt;/li&gt;
&lt;li&gt;I have some old urls I want to handle with redirects, so I need the ability to execute some code.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Octopress just about works out of the box on Heroku. The only change your absolutely need to make is to remove the &lt;em&gt;public&lt;/em&gt; folder from your .gitignore file.&lt;/p&gt;

&lt;p&gt;However, there was one other change I made in &lt;a href="https://github.com/scottwater/octopress"&gt;my own Octopress fork&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Octopress comes with a simple rack server you can use to preview the site locally. For most users this should work quite well. Unfortunately, the included server has two minor draw backs for production usage:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It always sets the content type to text/html for each file request.&lt;/li&gt;
&lt;li&gt;It does not honor/set other http conventions such as last_modified_headers.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Many moons ago, I mucked around with &lt;a href="https://github.com/bry4n/rack-jekyll"&gt;Rack_Jekyll&lt;/a&gt;. Then I wrote a &lt;a href="http://www.scottw.com/sinatra-jekyll-server"&gt;simple alternative&lt;/a&gt; using &lt;a href="http://sinatrarb.com"&gt;Sinatra&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I figured why not try the same thing, so I forked Ocotopress, swapped out the code, and added a dependency to Sinatra. There is of course the extra dependency on Sinatra, but for that you get just about everything done right almost no code.&lt;/p&gt;

&lt;p&gt;I am going to submit a pull request shortly. Hopefully they accept it. If not, feel free to just start your new Octopress site with my fork.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Simpable/~4/Cv0W6-6R8OY" height="1" width="1"/&gt;</content>
  	
  <feedburner:origLink>http://www.scottw.com/moving-to-octopress</feedburner:origLink></entry>
  
  <entry>
    
  	<title type="html"><![CDATA[Ship Faster With These Three Awesome Services]]></title>
  	<link href="http://feeds.simpable.com/~r/Simpable/~3/J1_qg9z-7mk/ship-faster-three-awesome-services" />
  	
    <updated>2011-08-17T13:03:00+00:00</updated>
    <id>http://www.scottw.com/ship-faster-three-awesome-services</id>
    
    <content type="html">&lt;p&gt;Building software is increasingly mixing and matching a variety of services with a small bit of your own special sauce.&lt;/p&gt;

&lt;p&gt;I recently shipped a new service, &lt;a href="http://www.dearemmy.com"&gt;DearEmmy&lt;/a&gt; in just a couple of hours leveraging three phenomenal services.&lt;/p&gt;

&lt;!--more--&gt;


&lt;p&gt;&lt;a href="http://twilio.com"&gt;Twilio&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Twilio provides infrastructure APIs for businesses to build scalable, reliable voice and text messaging apps.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Two things really stick out to me with Twilio.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Phone/Voice/SMS is complicated to work with, yet their API is beyond simple.  With just a couple lines of code and little XML  you can send, receive, record, and transcribe voice.&lt;/li&gt;
&lt;li&gt;Facebook/Twitter/LinkedIn/etc all have staggering numbers and their own importance, but they will never replace direct (by phone) communication with those I care most about. Twilio is your life line to real communication.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&lt;a href="http://pusherapp.com"&gt;Pusher&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Pusher is a hosted API for quickly, easily and securely adding scalable realtime functionality via WebSockets to web and mobile apps.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Put another way, Pusher almost instantly changes your website into an application. The content/data on your pages instantly avoids being stale.&lt;/p&gt;

&lt;p&gt;Also, the fact it works so well across devices (including iOS) is simply amazing to me.&lt;/p&gt;

&lt;p&gt;I have only recently started using Pusher, but it will quickly be part of everything I do from now on. I really don&amp;#8217;t see myself shipping anything anytime soon without using pusher.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://heroku.com"&gt;Heroku&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Heroku provides super simple cloud based hosting.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I started building DearEmmy late on a Wednesday night. My goal was to ship something useful by Sunday night and enter it into a Twilio developer contest.&lt;/p&gt;

&lt;p&gt;Because of Heroku I spent exactly zero seconds planning how to ship this product. I knew I could have it live whenever I was ready in just a couple of minutes. This is an amazingly liberating feeling.&lt;/p&gt;

&lt;p&gt;Those are my favorites.  I highly recommend all of them, but I am sure you have your own favorites. Let me know on &lt;a href="http://twitter.com/scottw"&gt;twitter&lt;/a&gt;.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Simpable/~4/J1_qg9z-7mk" height="1" width="1"/&gt;</content>
  	
  <feedburner:origLink>http://www.scottw.com/ship-faster-three-awesome-services</feedburner:origLink></entry>
  
  <entry>
    
  	<title type="html"><![CDATA[Using Twilio Client and Pusher Together]]></title>
  	<link href="http://feeds.simpable.com/~r/Simpable/~3/InbeGpIqjW0/using-twilio-client-pusher-together" />
  	
    <updated>2011-08-09T20:46:00+00:00</updated>
    <id>http://www.scottw.com/using-twilio-client-pusher-together</id>
    
    <content type="html">&lt;p&gt;Last week I started building a fun new project, &lt;a href="http://www.dearemmy.com"&gt;DearEmmy&lt;/a&gt; (more on this shortly). DearEmmy makes use of &lt;a href="http://twilio.com"&gt;Twilio&amp;#8217;s&lt;/a&gt; &lt;a href="http://www.twilio.com/api/client"&gt;new client&lt;/a&gt; feature as well as &lt;a href="http://pusherapp.com"&gt;Pusher&lt;/a&gt; for real time updates.&lt;/p&gt;

&lt;p&gt;Everything was going great, until I fired up Internet Explorer[1] and saw just about nothing in the app was working.&lt;/p&gt;

&lt;!--more--&gt;


&lt;p&gt;As a good web developer, my first thought was, &lt;em&gt;damn you IE&lt;/em&gt;. After digging through the errors, they seemed to point to a conflict between Twilio and Pusher.&lt;/p&gt;

&lt;p&gt;After a couple of support emails I learned both Twilio and Pusher are using the &lt;a href="https://github.com/gimite/web-socket-js"&gt;websocket-js&lt;/a&gt; library. This library enables browsers without websocket to act like real browsers and most importantly, there was indeed a conflict.&lt;/p&gt;

&lt;p&gt;Both companies have acknowledged the bug and hopefully by the time you read this it will be resolved (look for an update below).&lt;/p&gt;

&lt;p&gt;However, for better or worse I am impatient and started to look for a fix. I tried various methods of loading the scripts on demand which didn&amp;#8217;t work. I then moved the Pusher scripts to an iframe to isolate them from the main page. This worked great in Safari/Chrome, but failed in the same miserable way in IE and FF.&lt;/p&gt;

&lt;p&gt;Then, on a whim, I decided to swap the script order. Instead of loading Twilio first and Pusher second, I changed it to load Pusher before Twilio.  And now, everything works in IE, FireFox, Safari, and Chrome.&lt;/p&gt;

&lt;p&gt;I really hate not knowing why this worked, but I am confident the smart folks at Twilio and Pusher will figure it out. I can now go back to getting real work done.&lt;/p&gt;

&lt;p&gt;[1] I  later learned the bug also exists in FireFox which pretty much confirmed it was related to flash&amp;#8230;&lt;em&gt;damn you Adobe&lt;/em&gt;.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Simpable/~4/InbeGpIqjW0" height="1" width="1"/&gt;</content>
  	
  <feedburner:origLink>http://www.scottw.com/using-twilio-client-pusher-together</feedburner:origLink></entry>
  
  <entry>
    
  	<title type="html"><![CDATA[Adding a WYSIWYG Editor to ActiveAdmin]]></title>
  	<link href="http://feeds.simpable.com/~r/Simpable/~3/u4uOxV5XTfQ/adding-wysiwyg-editor-activeadmin" />
  	
    <updated>2011-07-29T11:04:00+00:00</updated>
    <id>http://www.scottw.com/adding-wysiwyg-editor-activeadmin</id>
    
    <content type="html">&lt;p&gt;&lt;a href="http://activeadmin.info/"&gt;ActiveAdmin&lt;/a&gt; is a nice way to quickly build admin pages. Think of it as a scaffolding on steriods. It is probably not ideal for most customers, but you can accomplish quite a bit with minimal effort.&lt;/p&gt;

&lt;p&gt;One of the models I was editing with ActiveAdmin accepts HTML in a textarea. I find the thought of writing even a single angle bracket nauseating these days, so I decided to convert the editor into a WYSIWYG editor with &lt;a href="http://tinymce.moxiecode.com/"&gt;TinyMCE&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;ActiveAdmin is a rails engine which plugs directly into your existing app. It provides a nifty little DSL for building UI screens. Getting the editor to work took just a couple of minutes once you understand the basic pieces.&lt;/p&gt;

&lt;!--more--&gt;


&lt;p&gt;&lt;strong&gt;First&lt;/strong&gt;, download (and install) TinyMCE. I went with the jQuery optimized version.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next&lt;/strong&gt;, create a new javascript file in your public/javascripts directory called active_admin_custom.js. In this file we are going to add a little javascript to wire up our editor.&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;load_editors&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;load_editors&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;.editor&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;tinymce&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="c1"&gt;//removed settings to keep it short.&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;I took the approach of using a specific CSS class as my selector, but you could use specific ids/etc if that worked better for you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next&lt;/strong&gt;, open up your active_admin.rb initializer, and configure your both tinymce and your custom.js file.&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='ruby'&gt;&lt;span class='line'&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;register_javascript&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;tiny_mce/jquery.tinymce.js&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;register_javascript&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;active_admin_custom.js&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;From here, the only thing potentially left to do is update your inputs to match the selector you chose (skip this if you went with specific ids).&lt;/p&gt;

&lt;p&gt;Note, Active Admin uses the excellent &lt;a href="https://github.com/justinfrench/formtastic"&gt;Formtastic&lt;/a&gt; gem. The trick to add CSS classes is pass a &amp;#8220;input_html&amp;#8221; hash&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='ruby'&gt;&lt;span class='line'&gt;&lt;span class="n"&gt;input_html&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="ss"&gt;:class&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;editor&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;FWIW, I generally hate WYSIWYG editors. When possible, I prefer either Markdown or Textile, but sometimes this is beyond your control (this post was written in Markdown).&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Simpable/~4/u4uOxV5XTfQ" height="1" width="1"/&gt;</content>
  	
  <feedburner:origLink>http://www.scottw.com/adding-wysiwyg-editor-activeadmin</feedburner:origLink></entry>
  
  <entry>
    
  	<title type="html"><![CDATA[KickoffLabs Is Ready For You!]]></title>
  	<link href="http://feeds.simpable.com/~r/Simpable/~3/EggQZFx1r9g/kickofflabs-ready-you" />
  	
    <updated>2011-06-27T18:07:00+00:00</updated>
    <id>http://www.scottw.com/kickofflabs-ready-you</id>
    
    <content type="html">&lt;p&gt;Today is the official launch day of &lt;a href="http://www.kickofflabs.com"&gt;KickoffLabs&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Today KickoffLabs is officially live and accepting customers! Scott and I want to thank everyone who signed up on our own KickoffLabs “coming soon” page, shared our blog posts and tweets, helped us kick the tires on the private beta, and sent encouraging words along the way. Thank You! &lt;a href="http://blog.kickofflabs.com/kickofflabs-is-open-for-business"&gt;KickoffLabs is Open for Business!&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;There are a lot of interesting lessons and observations to share over the next week or two, but for now, I am going to just take a deep breath and watch for all of your &lt;a href="http://www.kickofflabs.com/pricing"&gt;account confirmation&lt;/a&gt; signup emails. :)&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Simpable/~4/EggQZFx1r9g" height="1" width="1"/&gt;</content>
  	
  <feedburner:origLink>http://www.scottw.com/kickofflabs-ready-you</feedburner:origLink></entry>
  
  <entry>
    
  	<title type="html"><![CDATA[Running Pow Over SSL]]></title>
  	<link href="http://feeds.simpable.com/~r/Simpable/~3/NoEySx9N7og/using-ssl-pow" />
  	
    <updated>2011-06-22T15:12:00+00:00</updated>
    <id>http://www.scottw.com/using-ssl-pow</id>
    
    <content type="html">&lt;p&gt;We are just about ready to put &lt;a href="http://kickofflabs.com"&gt;KickoffLabs&lt;/a&gt; into production mode. One of the last big tasks was setting up SSL.&lt;/p&gt;

&lt;p&gt;Obviously, do not we want to push SSL support live without first testing it, so I set out to set it up locally.&lt;/p&gt;

&lt;p&gt;I considered a variety of approaches and eventually settled on using &lt;a href="http://pow.cx/"&gt;Pow&lt;/a&gt; with &lt;a href="http://nginx.net/"&gt;nginx&lt;/a&gt; as a &lt;a href="http://en.wikipedia.org/wiki/Reverse_proxy"&gt;reverse proxy&lt;/a&gt;.&lt;/p&gt;

&lt;!--more--&gt;


&lt;ol&gt;
&lt;li&gt;This is simple and lightweight.&lt;/li&gt;
&lt;li&gt;Pow doesn&amp;#8217;t require any additional configuration changes (ie, no host file entries).&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Here are the basic steps.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Pow (you are silly if this is not already done)&lt;/li&gt;
&lt;li&gt;Install nginx. I used &lt;a href="https://github.com/mxcl/homebrew"&gt;Homebrew&lt;/a&gt; because I value my time and sanity: brew install nginx&lt;/li&gt;
&lt;li&gt;By default, your nginx configuration wil be at /usr/local/etc/nginx. Open a terminal window and navigate to this directory.&lt;/li&gt;
&lt;li&gt;Create a directory here called ssl. (mkdir ssl)&lt;/li&gt;
&lt;li&gt;Download &lt;a href="https://gist.github.com/1040281#file_gen_cert.rb"&gt;this ruby script&lt;/a&gt; and place it in the ssl directory[1].&lt;/li&gt;
&lt;li&gt;Execute the script &lt;em&gt;ruby gen_cert.rb kickoff.dev&lt;/em&gt;. The script takes a single argument, the domain name of your site.[2]&lt;/li&gt;
&lt;li&gt;Replace the nginx.conf file located at /usr/local/etc/nginx/nginx.conf &lt;a href="https://gist.github.com/1040281#file_nginx.conf"&gt;with this one&lt;/a&gt;. Optionally, you can just copy the server section from the gist and place it in your existing configuration file.&lt;/li&gt;
&lt;li&gt;Change all of the kickoff.dev references to your own domain name.&lt;/li&gt;
&lt;li&gt;Test the nginx configuration with this command: &lt;em&gt;nginx -t&lt;/em&gt;. It should report back it was successful, but will likely give a warning about permissions. This is because we are specifying port 443 which cannot be used without sudo.&lt;/li&gt;
&lt;li&gt;Assuming everything went OK in the last step, you can start nginx with &lt;em&gt;sudo nginx&lt;/em&gt;.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;A couple of things to watch out for:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;To run nginx on port 443 (or 80) you need to start nginx with elevated privileges.&lt;/li&gt;
&lt;li&gt;If you start nginx and it says it is already bound/running, you can stop it with &lt;em&gt;nginx -s stop&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Make sure you have Pow running&lt;/li&gt;
&lt;li&gt;Make sure you pick a url that is valid for Pow (anything in .dev)&lt;/li&gt;
&lt;li&gt;This was my first time playing with nginx. If you stop something odd in the configuration file, please let me know.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Here is another link to the gist with the &lt;a href="https://gist.github.com/1040281"&gt;cert script and nginx.conf&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This has been tested on a exactly one computer. Please let me know if you run into any issues.&lt;/p&gt;

&lt;p&gt;[1] This script is based on the &lt;a href="http://www.cyberciti.biz/faq/howto-linux-unix-setup-nginx-ssl-proxy/"&gt;commands listed here&lt;/a&gt;. You can execute them manually if you want. I did this a couple of times already and decided to automate it.&lt;/p&gt;

&lt;p&gt;[2] I hard coded a bunch of the certificate data. All that matters for testing is the domain (common) name, but feel free to the edit the -subj argument.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Simpable/~4/NoEySx9N7og" height="1" width="1"/&gt;</content>
  	
  <feedburner:origLink>http://www.scottw.com/using-ssl-pow</feedburner:origLink></entry>
  
  <entry>
    
  	<title type="html"><![CDATA[Clicking on a DIV with Capybara]]></title>
  	<link href="http://feeds.simpable.com/~r/Simpable/~3/r8GGDL-yPnw/clicking-div-capybara" />
  	
    <updated>2011-06-17T14:55:00+00:00</updated>
    <id>http://www.scottw.com/clicking-div-capybara</id>
    
    <content type="html">&lt;p&gt;For the record, I am not sure this is a good practice. In fact, I am pretty for for accessibility it is probably the not the best solution&amp;#8230;but for now this is how it works.&lt;/p&gt;

&lt;p&gt;The scenario:&lt;/p&gt;

&lt;p&gt;When selecting a theme in &lt;a href="http://www.kickofflabs.com"&gt;KickoffLabs&lt;/a&gt; we allow a user to simply click on a preview image which is wrapped in a div. This executes a bit of javascript and properly stores the selected id so it can be sent to the server and stored in the database. In an earlier version this was simply a select element which &lt;a href="https://github.com/jnicklas/capybara"&gt;Capybara&lt;/a&gt; has a simple built in method for (select). Once this was changed to a div (or image) the spec broke.&lt;/p&gt;

&lt;p&gt;Thankfully, the fix is quite simple, just use &lt;a href="http://rubydoc.info/github/jnicklas/capybara/master/Capybara/Node/Finders#find-instance_method"&gt;find&lt;/a&gt; (which returns an element) and execute &lt;a href="http://rubydoc.info/github/jnicklas/capybara/master/Capybara/Node/Element#click-instance_method"&gt;click&lt;/a&gt;.&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='ruby'&gt;&lt;span class='line'&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;#Energy_Blue&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;click&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Also, since this is executing javascript, it requires the use of the javascript driver.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Simpable/~4/r8GGDL-yPnw" height="1" width="1"/&gt;</content>
  	
  <feedburner:origLink>http://www.scottw.com/clicking-div-capybara</feedburner:origLink></entry>
  
  <entry>
    
  	<title type="html"><![CDATA[Why iTerm2 is Dope]]></title>
  	<link href="http://feeds.simpable.com/~r/Simpable/~3/k8CvAIOZUeA/why-iterm-dope" />
  	
    <updated>2011-06-16T11:21:00+00:00</updated>
    <id>http://www.scottw.com/why-iterm-dope</id>
    
    <content type="html">&lt;p&gt;I tried &lt;a href="http://www.iterm2.com/"&gt;iTerm2&lt;/a&gt; about a year ago (or so) and didn&amp;#8217;t get it. Obviously, I wasn&amp;#8217;t trying very hard. I gave it another shot a couple of weeks ago and it has been pure love.&lt;/p&gt;

&lt;p&gt;Here are 5 really simple things that I love about it:&lt;/p&gt;

&lt;!--more--&gt;


&lt;ol&gt;
&lt;li&gt;Full Screen - I now do all of my coding directly in vim (not macvim). The full screen functionality has enabled me to plugin my external monitor far less. Spending so many years in Visual Studio, it is hard to express how liberating it feels to simply to simply use iTerm and my browser all day.&lt;/li&gt;
&lt;li&gt;Split Windows - While full screen is great for coding, it is a waste for most other tasks (dev server, logs, etc.) Splitting the screen allows me to run multiple tasks in a single tab. Most commonly, this is &lt;a href="http://www.scottw.com/ruby-guard"&gt;guard&lt;/a&gt; and the dev server split vertically.&lt;/li&gt;
&lt;li&gt;Tabs in the current directory - There is an option in iTerm to open tabs in the current directory. Since it is so easy to get back to your root directory, I think this is a really great option to change. You can also configure it per profile (because you can have multiple profiles) as well.&lt;/li&gt;
&lt;li&gt;Switching tabs - In iTerm you can switch tabs by pressing CMD + a number key. I had been using screen for this functionality (and more), but this is less keystrokes, less pokey, and a case where a 1 based array is a big improvement.&lt;/li&gt;
&lt;li&gt;Copy via highlighting - By default, any text you select in iTerm is copied to the clip board. How often do you highlight something and not copy it? Feels like this would be a good thing to change system wide if possible.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;I know I am just scratching the surface here, so please let me know your favorites via &lt;a href="http://twitter.com/scottw"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt; I am using iTerm2. I honestly don&amp;#8217;t remember which version I tried last year.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Simpable/~4/k8CvAIOZUeA" height="1" width="1"/&gt;</content>
  	
  <feedburner:origLink>http://www.scottw.com/why-iterm-dope</feedburner:origLink></entry>
  
</feed>

