Skip to content

Commit

Permalink
Use smartypants filtering to keep @tomstuart happy
Browse files Browse the repository at this point in the history
  • Loading branch information
tomafro committed Nov 11, 2012
1 parent 59d3c67 commit 27bc141
Show file tree
Hide file tree
Showing 121 changed files with 862 additions and 859 deletions.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -3,3 +3,4 @@ source :rubygems
gemspec

gem 'recap', '~> 1.0.0'
gem 'rack'
2 changes: 2 additions & 0 deletions Gemfile.lock
Expand Up @@ -38,6 +38,7 @@ GEM
open4 (1.3.0)
pygments.rb (0.2.12)
rubypython (~> 0.5.3)
rack (1.4.1)
rdiscount (1.6.8)
recap (1.0.2)
capistrano (~> 2.9.0)
Expand All @@ -62,4 +63,5 @@ PLATFORMS

DEPENDENCIES
lanyon!
rack
recap (~> 1.0.0)
2 changes: 1 addition & 1 deletion lib/lanyon/filters.rb
Expand Up @@ -24,7 +24,7 @@ def sql(text)
end

def markdown(text)
RDiscount.new(render(text)).to_html
RDiscount.new(render(text), :smart).to_html
end

def youtube(video)
Expand Down
26 changes: 13 additions & 13 deletions public/2009/05.html
Expand Up @@ -41,7 +41,7 @@
<h1><a href="/2009/05/read-active-record-columns-directly-from-the-class">Read ActiveRecord columns directly from the class</a></h1>
</header>
<div class="content">
<p>Sometimes you want to read just a single column from a collection of records, without the overhead of instantiating each and every one. You could just execute raw SQL, but it's a shame to do away with the nice type conversion <code>ActiveRecord</code> provides. It'd also be a pity to get rid of find scoping, amongst other goodness.</p>
<p>Sometimes you want to read just a single column from a collection of records, without the overhead of instantiating each and every one. You could just execute raw SQL, but it&rsquo;s a shame to do away with the nice type conversion <code>ActiveRecord</code> provides. It&rsquo;d also be a pity to get rid of find scoping, amongst other goodness.</p>

<p>Enter <code>Tomafro::ColumnReader</code>:</p>

Expand All @@ -65,7 +65,7 @@ <h1><a href="/2009/05/read-active-record-columns-directly-from-the-class">Read A
</div>


<p>Once you've extended <code>ActiveRecord::Base</code> with it, usage is simple. In your models, declare which columns you want access to:</p>
<p>Once you&rsquo;ve extended <code>ActiveRecord::Base</code> with it, usage is simple. In your models, declare which columns you want access to:</p>

<div class="highlight"><pre><span class="no">ActiveRecord</span><span class="o">::</span><span class="no">Base</span><span class="o">.</span><span class="n">extend</span> <span class="no">Tomafro</span><span class="o">::</span><span class="no">ColumnReader</span>

Expand All @@ -79,7 +79,7 @@ <h1><a href="/2009/05/read-active-record-columns-directly-from-the-class">Read A
</div>


<p>Once you've done this, you can access values directly from the class, respecting scope, limits and other finder options.</p>
<p>Once you&rsquo;ve done this, you can access values directly from the class, respecting scope, limits and other finder options.</p>

<div class="highlight"><pre><span class="no">Animal</span><span class="o">.</span><span class="n">names</span>
<span class="c1">#=&gt; [&#39;Lion&#39;, &#39;Tiger&#39;, &#39;Zebra&#39;, &#39;Gazelle&#39;]</span>
Expand Down Expand Up @@ -113,9 +113,9 @@ <h1><a href="/2009/05/read-active-record-columns-directly-from-the-class">Read A
<h1><a href="/2009/05/an-objective-c-implementation-of-active-supports-inflector">An Objective-C implementation of ActiveSupport's Inflector</a></h1>
</header>
<div class="content">
<p>Over the last week I've been playing with Objective-C, for fun rather than profit. Here's the first result of this dabbling - <a href="http://github.com/tomafro/ActiveSupportInflector/tree/master">an Objective-C implementation</a> of ActiveSupport's pluralize and singularize methods.</p>
<p>Over the last week I&rsquo;ve been playing with Objective-C, for fun rather than profit. Here&rsquo;s the first result of this dabbling &ndash; <a href="http://github.com/tomafro/ActiveSupportInflector/tree/master">an Objective-C implementation</a> of ActiveSupport&rsquo;s pluralize and singularize methods.</p>

<p>It's my first piece of code in the language, so I'd appreciate comments and feedback.</p>
<p>It&rsquo;s my first piece of code in the language, so I&rsquo;d appreciate comments and feedback.</p>

</div>
<footer>
Expand Down Expand Up @@ -160,7 +160,7 @@ <h1><a href="/2009/05/using-rack-middleware-for-good-and-evil">Using Rack Middle
<div class="content">
<p>So we all know that <a href="http://rack.rubyforge.org/">Rack</a> is awesome, and that we can use Rack::Middleware for all sorts of things: <a href="http://github.com/brynary/rack-bug/tree/master">debugging</a>, <a href="http://tomayko.com/src/rack-cache/">caching</a> and a <a href="http://github.com/rack/rack-contrib/tree/master">whole host more</a>.</p>

<p>What all these have in common (apart from maybe <a href="http://github.com/rack/rack-contrib/blob/8b6323c8eecc8279088987c52b27dda5d4cadf7b/lib/rack/contrib/evil.rb">Rack::Evil</a>) is that they're all helpful. They all make writing Rack applications easier. Not my Middleware though.</p>
<p>What all these have in common (apart from maybe <a href="http://github.com/rack/rack-contrib/blob/8b6323c8eecc8279088987c52b27dda5d4cadf7b/lib/rack/contrib/evil.rb">Rack::Evil</a>) is that they&rsquo;re all helpful. They all make writing Rack applications easier. Not my Middleware though.</p>

<h3>Introducing Rack::Shuffler</h3>

Expand All @@ -183,7 +183,7 @@ <h3>Introducing Rack::Shuffler</h3>
</div>


<p>I suggest you add it to a colleague's app late on a Friday afternoon, and see how long it takes to drive them to insanity.</p>
<p>I suggest you add it to a colleague&rsquo;s app late on a Friday afternoon, and see how long it takes to drive them to insanity.</p>

</div>
<footer>
Expand All @@ -203,7 +203,7 @@ <h3>Introducing Rack::Shuffler</h3>
<h1><a href="/2009/05/imitation-is-the-sincerest-form-of-flattery">If imitation is the sincerest form of flattery...</a></h1>
</header>
<div class="content">
<p><a href="http://www.tiagoluchini.eu/">...consider me flattered</a>.</p>
<p><a href="http://www.tiagoluchini.eu/">&hellip;consider me flattered</a>.</p>

</div>
<footer>
Expand All @@ -221,7 +221,7 @@ <h1><a href="/2009/05/imitation-is-the-sincerest-form-of-flattery">If imitation
<h1><a href="/2009/05/automatching-rails-paths-in-cucumber">Automatching rails paths in cucumber</a></h1>
</header>
<div class="content">
<p>If you're using <a href="http://cukes.info/">cucumber</a> as part of your testing, you probably have a <code>paths.rb</code> file that looks something like this:</p>
<p>If you&rsquo;re using <a href="http://cukes.info/">cucumber</a> as part of your testing, you probably have a <code>paths.rb</code> file that looks something like this:</p>

<div class="highlight"><pre><span class="k">module</span> <span class="nn">NavigationHelpers</span>
<span class="k">def</span> <span class="nf">path_to</span><span class="p">(</span><span class="n">page_name</span><span class="p">)</span>
Expand All @@ -246,9 +246,9 @@ <h1><a href="/2009/05/automatching-rails-paths-in-cucumber">Automatching rails p
</div>


<p>This let's us use nice descriptive names in our scenarios, but it starts to become a pain when we add more and more paths. So how can we make it better?</p>
<p>This let&rsquo;s us use nice descriptive names in our scenarios, but it starts to become a pain when we add more and more paths. So how can we make it better?</p>

<p>By automatically matching some rails paths. Here's the code:</p>
<p>By automatically matching some rails paths. Here&rsquo;s the code:</p>

<div class="highlight"><pre><span class="k">module</span> <span class="nn">NavigationHelpers</span>
<span class="k">def</span> <span class="nf">path_to</span><span class="p">(</span><span class="n">page_name</span><span class="p">)</span>
Expand Down Expand Up @@ -281,7 +281,7 @@ <h1><a href="/2009/05/automatching-rails-paths-in-cucumber">Automatching rails p

<p>What it does is pretty simple. Given a page name <code>the clients page</code> (with no other matches defined) it will try and send <code>clients_path</code>. If successful, then it returns the result, otherwise nil.</p>

<p>Not the biggest improvement in the world, but it's made my cucumber tests just a little bit easier to write.</p>
<p>Not the biggest improvement in the world, but it&rsquo;s made my cucumber tests just a little bit easier to write.</p>

</div>
<footer>
Expand Down Expand Up @@ -335,7 +335,7 @@ <h1><a href="/2009/05/adam-sandersons-open-gem">Adam Sanderson's open_gem</a></h
</div>


<p>If you're running on OS X and use TextMate, you may have already set <code>$EDITOR</code> to <code>mate -w</code>, which let's you use TextMate as the editor for git commit messages and much more. However, the <code>-w</code> flag doesn't work with open_gem, so set the <code>$GEM_OPEN_EDITOR</code> variable, and open_gem will use that instead:</p>
<p>If you&rsquo;re running on OS X and use TextMate, you may have already set <code>$EDITOR</code> to <code>mate -w</code>, which let&rsquo;s you use TextMate as the editor for git commit messages and much more. However, the <code>-w</code> flag doesn&rsquo;t work with open_gem, so set the <code>$GEM_OPEN_EDITOR</code> variable, and open_gem will use that instead:</p>

<div class="highlight"><pre><span class="nv">$ </span><span class="nb">export </span><span class="nv">GEM_OPEN_EDITOR</span><span class="o">=</span>mate
</pre>
Expand Down
2 changes: 1 addition & 1 deletion public/2009/05/adam-sandersons-open-gem.html
Expand Up @@ -75,7 +75,7 @@ <h1><a href="/2009/05/adam-sandersons-open-gem">Adam Sanderson's open_gem</a></h
</div>


<p>If you're running on OS X and use TextMate, you may have already set <code>$EDITOR</code> to <code>mate -w</code>, which let's you use TextMate as the editor for git commit messages and much more. However, the <code>-w</code> flag doesn't work with open_gem, so set the <code>$GEM_OPEN_EDITOR</code> variable, and open_gem will use that instead:</p>
<p>If you&rsquo;re running on OS X and use TextMate, you may have already set <code>$EDITOR</code> to <code>mate -w</code>, which let&rsquo;s you use TextMate as the editor for git commit messages and much more. However, the <code>-w</code> flag doesn&rsquo;t work with open_gem, so set the <code>$GEM_OPEN_EDITOR</code> variable, and open_gem will use that instead:</p>

<div class="highlight"><pre><span class="nv">$ </span><span class="nb">export </span><span class="nv">GEM_OPEN_EDITOR</span><span class="o">=</span>mate
</pre>
Expand Down
Expand Up @@ -41,9 +41,9 @@
<h1><a href="/2009/05/an-objective-c-implementation-of-active-supports-inflector">An Objective-C implementation of ActiveSupport's Inflector</a></h1>
</header>
<div class="content">
<p>Over the last week I've been playing with Objective-C, for fun rather than profit. Here's the first result of this dabbling - <a href="http://github.com/tomafro/ActiveSupportInflector/tree/master">an Objective-C implementation</a> of ActiveSupport's pluralize and singularize methods.</p>
<p>Over the last week I&rsquo;ve been playing with Objective-C, for fun rather than profit. Here&rsquo;s the first result of this dabbling &ndash; <a href="http://github.com/tomafro/ActiveSupportInflector/tree/master">an Objective-C implementation</a> of ActiveSupport&rsquo;s pluralize and singularize methods.</p>

<p>It's my first piece of code in the language, so I'd appreciate comments and feedback.</p>
<p>It&rsquo;s my first piece of code in the language, so I&rsquo;d appreciate comments and feedback.</p>

</div>
<footer>
Expand Down
8 changes: 4 additions & 4 deletions public/2009/05/automatching-rails-paths-in-cucumber.html
Expand Up @@ -41,7 +41,7 @@
<h1><a href="/2009/05/automatching-rails-paths-in-cucumber">Automatching rails paths in cucumber</a></h1>
</header>
<div class="content">
<p>If you're using <a href="http://cukes.info/">cucumber</a> as part of your testing, you probably have a <code>paths.rb</code> file that looks something like this:</p>
<p>If you&rsquo;re using <a href="http://cukes.info/">cucumber</a> as part of your testing, you probably have a <code>paths.rb</code> file that looks something like this:</p>

<div class="highlight"><pre><span class="k">module</span> <span class="nn">NavigationHelpers</span>
<span class="k">def</span> <span class="nf">path_to</span><span class="p">(</span><span class="n">page_name</span><span class="p">)</span>
Expand All @@ -66,9 +66,9 @@ <h1><a href="/2009/05/automatching-rails-paths-in-cucumber">Automatching rails p
</div>


<p>This let's us use nice descriptive names in our scenarios, but it starts to become a pain when we add more and more paths. So how can we make it better?</p>
<p>This let&rsquo;s us use nice descriptive names in our scenarios, but it starts to become a pain when we add more and more paths. So how can we make it better?</p>

<p>By automatically matching some rails paths. Here's the code:</p>
<p>By automatically matching some rails paths. Here&rsquo;s the code:</p>

<div class="highlight"><pre><span class="k">module</span> <span class="nn">NavigationHelpers</span>
<span class="k">def</span> <span class="nf">path_to</span><span class="p">(</span><span class="n">page_name</span><span class="p">)</span>
Expand Down Expand Up @@ -101,7 +101,7 @@ <h1><a href="/2009/05/automatching-rails-paths-in-cucumber">Automatching rails p

<p>What it does is pretty simple. Given a page name <code>the clients page</code> (with no other matches defined) it will try and send <code>clients_path</code>. If successful, then it returns the result, otherwise nil.</p>

<p>Not the biggest improvement in the world, but it's made my cucumber tests just a little bit easier to write.</p>
<p>Not the biggest improvement in the world, but it&rsquo;s made my cucumber tests just a little bit easier to write.</p>

</div>
<footer>
Expand Down
Expand Up @@ -41,7 +41,7 @@
<h1><a href="/2009/05/imitation-is-the-sincerest-form-of-flattery">If imitation is the sincerest form of flattery...</a></h1>
</header>
<div class="content">
<p><a href="http://www.tiagoluchini.eu/">...consider me flattered</a>.</p>
<p><a href="http://www.tiagoluchini.eu/">&hellip;consider me flattered</a>.</p>

</div>
<footer>
Expand Down
Expand Up @@ -41,7 +41,7 @@
<h1><a href="/2009/05/read-active-record-columns-directly-from-the-class">Read ActiveRecord columns directly from the class</a></h1>
</header>
<div class="content">
<p>Sometimes you want to read just a single column from a collection of records, without the overhead of instantiating each and every one. You could just execute raw SQL, but it's a shame to do away with the nice type conversion <code>ActiveRecord</code> provides. It'd also be a pity to get rid of find scoping, amongst other goodness.</p>
<p>Sometimes you want to read just a single column from a collection of records, without the overhead of instantiating each and every one. You could just execute raw SQL, but it&rsquo;s a shame to do away with the nice type conversion <code>ActiveRecord</code> provides. It&rsquo;d also be a pity to get rid of find scoping, amongst other goodness.</p>

<p>Enter <code>Tomafro::ColumnReader</code>:</p>

Expand All @@ -65,7 +65,7 @@ <h1><a href="/2009/05/read-active-record-columns-directly-from-the-class">Read A
</div>


<p>Once you've extended <code>ActiveRecord::Base</code> with it, usage is simple. In your models, declare which columns you want access to:</p>
<p>Once you&rsquo;ve extended <code>ActiveRecord::Base</code> with it, usage is simple. In your models, declare which columns you want access to:</p>

<div class="highlight"><pre><span class="no">ActiveRecord</span><span class="o">::</span><span class="no">Base</span><span class="o">.</span><span class="n">extend</span> <span class="no">Tomafro</span><span class="o">::</span><span class="no">ColumnReader</span>

Expand All @@ -79,7 +79,7 @@ <h1><a href="/2009/05/read-active-record-columns-directly-from-the-class">Read A
</div>


<p>Once you've done this, you can access values directly from the class, respecting scope, limits and other finder options.</p>
<p>Once you&rsquo;ve done this, you can access values directly from the class, respecting scope, limits and other finder options.</p>

<div class="highlight"><pre><span class="no">Animal</span><span class="o">.</span><span class="n">names</span>
<span class="c1">#=&gt; [&#39;Lion&#39;, &#39;Tiger&#39;, &#39;Zebra&#39;, &#39;Gazelle&#39;]</span>
Expand Down
4 changes: 2 additions & 2 deletions public/2009/05/using-rack-middleware-for-good-and-evil.html
Expand Up @@ -43,7 +43,7 @@ <h1><a href="/2009/05/using-rack-middleware-for-good-and-evil">Using Rack Middle
<div class="content">
<p>So we all know that <a href="http://rack.rubyforge.org/">Rack</a> is awesome, and that we can use Rack::Middleware for all sorts of things: <a href="http://github.com/brynary/rack-bug/tree/master">debugging</a>, <a href="http://tomayko.com/src/rack-cache/">caching</a> and a <a href="http://github.com/rack/rack-contrib/tree/master">whole host more</a>.</p>

<p>What all these have in common (apart from maybe <a href="http://github.com/rack/rack-contrib/blob/8b6323c8eecc8279088987c52b27dda5d4cadf7b/lib/rack/contrib/evil.rb">Rack::Evil</a>) is that they're all helpful. They all make writing Rack applications easier. Not my Middleware though.</p>
<p>What all these have in common (apart from maybe <a href="http://github.com/rack/rack-contrib/blob/8b6323c8eecc8279088987c52b27dda5d4cadf7b/lib/rack/contrib/evil.rb">Rack::Evil</a>) is that they&rsquo;re all helpful. They all make writing Rack applications easier. Not my Middleware though.</p>

<h3>Introducing Rack::Shuffler</h3>

Expand All @@ -66,7 +66,7 @@ <h3>Introducing Rack::Shuffler</h3>
</div>


<p>I suggest you add it to a colleague's app late on a Friday afternoon, and see how long it takes to drive them to insanity.</p>
<p>I suggest you add it to a colleague&rsquo;s app late on a Friday afternoon, and see how long it takes to drive them to insanity.</p>

</div>
<footer>
Expand Down

1 comment on commit 27bc141

@tomstuart
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YESSS

Please sign in to comment.