<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[Trevor Oke]]></title>
  <link href="http://trevoroke.com/atom.xml" rel="self"/>
  <link href="http://trevoroke.com/"/>
  <updated>2012-01-18T11:19:56-05:00</updated>
  <id>http://trevoroke.com/</id>
  <author>
    <name><![CDATA[Trevor Oke]]></name>
    <email><![CDATA[trevor@trevoroke.com]]></email>
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Simple Alias for 'git rm']]></title>
    <link href="http://trevoroke.com/blog/2010/06/04/simple-alias-for-git-rm/"/>
    <updated>2010-06-04T00:00:00-04:00</updated>
    <id>http://trevoroke.com/blog/2010/06/04/simple-alias-for-git-rm</id>
    <content type="html"><![CDATA[<p>When I&#8217;m coding and I need to remove a file, I rarely remember to
use <code>git rm</code> instead of <code>rm</code>. It&#8217;s just ingrained in my fingers I
guess. Unfortunately, this means that when I create my commit I end
up with a bunch of files that I need to use git rm on.</p>

<p>It&#8217;s not exactly a hardship, but here&#8217;s a simple method for doing
that:</p>

<script src="https://gist.github.com/897804.js?file=gdel.sh"></script>


<p>Just put that into your .bashrc and you&#8217;re ready to go.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Testing attr_accessible with Test::Unit]]></title>
    <link href="http://trevoroke.com/blog/2010/02/03/testing-attr-accessible-with-test-unit/"/>
    <updated>2010-02-03T00:00:00-05:00</updated>
    <id>http://trevoroke.com/blog/2010/02/03/testing-attr-accessible-with-test-unit</id>
    <content type="html"><![CDATA[<p>I found a great way to test my protected attributes while looking
around <a href="http://snippets.dzone.com/posts/show/4712">online</a>.
like to code my model tests using the stock unit testing libraries.
It&#8217;s clean and simple and it does everything that I need. So I took
the existing rspec code and I converted it into a standard test
helper.</p>

<script src="https://gist.github.com/897817.js?file=assert_protected_attributes.rb"></script>


<p>Put this in your test_helper.rb file and you&#8217;re good to go.</p>

<p>Here&#8217;s what a standard unit test looks like now.</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'> <span class="nb">test</span> <span class="s2">&quot;protected attributes&quot;</span> <span class="k">do</span>
</span><span class='line'>  <span class="n">assert_protected_attribute</span> <span class="no">User</span><span class="p">,</span> <span class="ss">:is_admin</span>
</span><span class='line'> <span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>


<p>Note that you don&#8217;t have to instantiate anything now. No mucking
about with fixtures or factories.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Git Lessons at Learn.GitHub]]></title>
    <link href="http://trevoroke.com/blog/2009/09/12/git-lessons-at-learn-github/"/>
    <updated>2009-09-12T00:00:00-04:00</updated>
    <id>http://trevoroke.com/blog/2009/09/12/git-lessons-at-learn-github</id>
    <content type="html"><![CDATA[<p>They only really have the beginners Git tutorials in place right
now, but I can see this becoming a very useful link for me. I
particularly like the fact that the information has been segregated
into different levels and into different &#8220;tracks&#8221;.</p>

<p>I wish that more tutorial sites used a layout like this.</p>

<p><a href="http://learn.github.com/%22>Learn.GitHub&#8221;>Learn.Github</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Cheap Branches Ease Development]]></title>
    <link href="http://trevoroke.com/blog/2009/08/23/cheap-branches-ease-development/"/>
    <updated>2009-08-23T00:00:00-04:00</updated>
    <id>http://trevoroke.com/blog/2009/08/23/cheap-branches-ease-development</id>
    <content type="html"><![CDATA[<p>It looks like <a href="http://blog.hasmanythrough.com/2008/12/18/agile-git-and-the-story-branch-pattern">Josh Susser</a>
has much the same daily workflow as I have. Take a read,
it&#8217;s a good example of how cheap local branches can make your
development life a whole bunch easier.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Nice workaround guys]]></title>
    <link href="http://trevoroke.com/blog/2009/06/03/nice-workaround-guys/"/>
    <updated>2009-06-03T00:00:00-04:00</updated>
    <id>http://trevoroke.com/blog/2009/06/03/nice-workaround-guys</id>
    <content type="html"><![CDATA[<p>Not getting data from your oracle data source? Just
<a href="http://support.microsoft.com/kb/168702">move your mouse</a>
and the data might show up!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Setting Up a Git Server on Slicehost]]></title>
    <link href="http://trevoroke.com/blog/2009/05/03/setting-up-a-git-server-on-slicehost/"/>
    <updated>2009-05-03T00:00:00-04:00</updated>
    <id>http://trevoroke.com/blog/2009/05/03/setting-up-a-git-server-on-slicehost</id>
    <content type="html"><![CDATA[<p>Since my last post
I&#8217;ve been using <a href="http://git-scm.com/">git</a> more and
more. It really suits the way I work a lot better than subversion.
Because of this, I wanted to convert one of my projects from svn to
Git. It&#8217;s a private project, and while I could pony up the cash and
get a paid account on GitHub, I&#8217;d rather keep everything on
something under my control.</p>

<p>I&#8217;ve already moved the main project over to slicehost, and since
I&#8217;m already paying for the space I thought it would be a great idea
to host my repositories there.</p>

<p>It was a hell of a lot easier than I thought it would be.</p>

<p>One of the requirements of the install is that I connect to the git
repository over ssh. I&#8217;ve got it set up so that my ssh server is
listening on port 30000 and it authenticates using a public key. No
faffing about with passwords here!</p>

<p>Here&#8217;s what I did.</p>

<h3>Install Git</h3>

<p>The first thing we need to do is install git. I&#8217;m using aptitude,
so this would be done like this:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>sudo aptidude install git-core</span></code></pre></td></tr></table></div></figure>


<p>Now you&#8217;re ready to create the actual repository.</p>

<h3>Create Your Remote Repository</h3>

<p>While still connected to your slice, enter the following. Change
anything you need to, of course.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>mkdir ~/repos/example.git cd ~/repos/example.git git init</span></code></pre></td></tr></table></div></figure>


<p>It doesn&#8217;t really get much easier than that.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>### Create Your Local Repository</span></code></pre></td></tr></table></div></figure>


<p>Now we go to work on making the local repsitory. All of this is on
your local machine:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>mkdir example
</span><span class='line'>cd example
</span><span class='line'>git init
</span><span class='line'>touch README
</span><span class='line'>git add README
</span><span class='line'>git commit -m "initial repository import"
</span><span class='line'>git remote add origin ssh://username@yourdomain/example.git</span></code></pre></td></tr></table></div></figure>


<p>In my case, the ssh section would be:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>ssh://trevor@66.453.44.xxx:30000/home/trevor/repos/example.git</span></code></pre></td></tr></table></div></figure>


<h3>Push!</h3>

<p>Now all you have to do is push your local changes back to the
remote server. On your local machine: @ git push origin master @
That&#8217;s it. You&#8217;re done.</p>

<p>This is mostly based on the commonthread
<a href="http://blog.commonthread.com/2008/4/14/setting-up-a-git-server%22>tutorial&#8221;>tutorial</a>,
with some changes here and there.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Quick Edit in WordPress]]></title>
    <link href="http://trevoroke.com/blog/2009/04/18/quick-edit-in-wordpress/"/>
    <updated>2009-04-18T00:00:00-04:00</updated>
    <id>http://trevoroke.com/blog/2009/04/18/quick-edit-in-wordpress</id>
    <content type="html"><![CDATA[<p>I was going through my old posts and converting some of the old
uncategorized links to something a bit more useful. Uncategorized
doesn&#8217;t really count as useful as far as I can tell. Three edits
in, I notice the Quick Edit link and give that a try.</p>

<p>I honestly don&#8217;t know how I didn&#8217;t see this before.</p>

<p><em>edit</em> In a pique of stoopid, I just forgot to categorize this.
Nice.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Git Workflow]]></title>
    <link href="http://trevoroke.com/blog/2009/04/18/git-workflow/"/>
    <updated>2009-04-18T00:00:00-04:00</updated>
    <id>http://trevoroke.com/blog/2009/04/18/git-workflow</id>
    <content type="html"><![CDATA[<p>I still work more often in Subversion than I do in git, and the
commands aren&#8217;t quite under my fingers yet. So, more for my memory
than anything else, here&#8217;s my current git workflow for when I&#8217;m
working on my own stuff.</p>

<p>First, I create a local version of the repository to work on.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>git clone my-great-repository @</span></code></pre></td></tr></table></div></figure>


<p>Next, I&#8217;m going to create a branch for whatever it is I&#8217;m working
on at the moment. I tend to be a bit of a splitter when it comes to
branches. One change, feature or fix, per branch. Git is great for
that.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>git checkout -b "stuff_Im_working_on"</span></code></pre></td></tr></table></div></figure>


<p>After that, I do a small change at a time. Lots and lots of small
commits. Loop over this as many times as you need.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>git commit -a -m "Changed the text as requested."</span></code></pre></td></tr></table></div></figure>


<p>When I&#8217;ve finished everything and it&#8217;s time to check my code back
in, I checkout my master branch and make sure that I&#8217;ve got the
latest commit.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>git checkout master git pull</span></code></pre></td></tr></table></div></figure>


<p>At that point, I&#8217;m ready to merge my new code into the master
branch, run all of my tests, and push everything back up to the
origin.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>git merge "stuff_im_working_on" git push</span></code></pre></td></tr></table></div></figure>


<p>When I&#8217;m done, I usually just trash the branch I&#8217;ve been working
on.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>git branch -d "stuff_im_working_on"</span></code></pre></td></tr></table></div></figure>


<p>Please note, I generally work by myself and I&#8217;m not too worried
about conflicting merges and the like. This workflow would
obviously have to be modified to handle that.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[How to Log Exercise Progress Using Emacs]]></title>
    <link href="http://trevoroke.com/blog/2009/03/16/how-to-log-exercise-progress-using-emacs/"/>
    <updated>2009-03-16T00:00:00-04:00</updated>
    <id>http://trevoroke.com/blog/2009/03/16/how-to-log-exercise-progress-using-emacs</id>
    <content type="html"><![CDATA[<p>Recently, I started going back to the gym. Hours of working on web
applications have added to a puffier physique than I would like. I
find endless hours of cardio to be boring as hell, and the body
builders staring into the mirror while trying to &#8220;pump&#8221; make me
chuckle.</p>

<p>So I&#8217;m doing some powerlifting. I&#8217;m not at all interested in the
competitive nature of it, but I love the fact that everything is
quantifiable. And the goals are easy - increase your maximum lift
in the squat, the deadlift, and the bench press.</p>

<p>Anyway.</p>

<p>As a good little programmer and emacs addict, I&#8217;ve added a simple
function to my .emacs to help me keep track of what I&#8217;m lifting.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>  (defun log-workout (exercise sets reps weight)
</span><span class='line'>  (interactive "sExercise: \nNSets: \nNReps: \nNWeight(kg):")
</span><span class='line'>  (find-file "~/Documents/Exercise/exercise-log.org")
</span><span class='line'>  (end-of-buffer)
</span><span class='line'>  (insert (format "| %s | %s | %d | %d | %d | %d | %d |\n"
</span><span class='line'>                  (date-string)
</span><span class='line'>                  exercise sets reps weight
</span><span class='line'>                  (+ weight 20) ; weight plus bar (Kg)
</span><span class='line'>                  (* sets reps (+ weight 20)))) ; total weight lifted (Kg)
</span><span class='line'>  (save-buffer))</span></code></pre></td></tr></table></div></figure>


<p>And while I&#8217;m at it, here&#8217;s one for my weight:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>  (defun log-weight (weight)
</span><span class='line'>  (interactive "NWeight: ")
</span><span class='line'>  (find-file "~/Documents/Exercise/weight-log.org")
</span><span class='line'>  (end-of-buffer)
</span><span class='line'>  (insert
</span><span class='line'>   (format "| %s | %d | %.2f |\n"
</span><span class='line'>           (date-string)
</span><span class='line'>           weight
</span><span class='line'>           (* weight 0.453))) ; weight in Kg
</span><span class='line'>  (save-buffer))</span></code></pre></td></tr></table></div></figure>


<p>A lot of the heavy lifting is being done by org-mode. The table
mode makes everything line up nicely. You&#8217;ll probably want to add a
header for each column, but that&#8217;s not completely necessary.</p>

<p>Just pop these into your .emacs file, change the path on your
files, and start logging your progress.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Wordpress as a CMS Solution]]></title>
    <link href="http://trevoroke.com/blog/2009/01/31/wordpress-as-a-cms-solution/"/>
    <updated>2009-01-31T00:00:00-05:00</updated>
    <id>http://trevoroke.com/blog/2009/01/31/wordpress-as-a-cms-solution</id>
    <content type="html"><![CDATA[<p>After being burned and deciding to never again touch the unholy
fire that is Joomla, I still find myself in the need of crating CMS
solutions for people. They&#8217;re perfect for small businesses or
groups. In this case, I&#8217;m starting a new web project for my band.</p>

<p>We&#8217;ve become quite a bit more successful lately, and we really need
to get to work on getting our online presence shored up. It&#8217;s just
a bit embarrassing being a web developer with such a poor site. No
matter how much the technically-challenged spout, facebook and
myspace just don&#8217;t cut it.</p>

<p>Since I don&#8217;t have all that much time, I&#8217;m going to be working with
Wordpress. And since I&#8217;ve wanted to use it for some time, the
Blueprint CSS framework. It&#8217;ll also give me a chance to try a few
of the more popular plugins and try some SEO techniques I want to
experiment with.</p>

<p>In the past, I haven&#8217;t been the biggest fan of the Wordpress code
base, but I have to say that I&#8217;ve always liked the way that it
works. I&#8217;ll be mucking about a bit more in the code itself in the
near future. Hopefully I&#8217;m pleasantly surprised.</p>

<p>I&#8217;ll let you know how it goes.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Rails and Merb to Merge]]></title>
    <link href="http://trevoroke.com/blog/2008/12/24/rails-and-merb-to-merge/"/>
    <updated>2008-12-24T00:00:00-05:00</updated>
    <id>http://trevoroke.com/blog/2008/12/24/rails-and-merb-to-merge</id>
    <content type="html"><![CDATA[<p>Great news!</p>

<p>Rails and Merb are <a href="http://rubyonrails.org/merb">merging</a>.
All of the great ideas that the <a href="http://www.merbivore.com/">Merb</a>
folks have had over the last little while will now be part of
Rails 3.0.</p>

<p>To be honest, I don&#8217;t know much about Merb. The buzz was just
getting loud enough for me to check it out. It looked to solve a
lot of the problems that rails has, and I thought it would be worth
a look.</p>

<p>I&#8217;m certainly going to now.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Shin Kicking Fun]]></title>
    <link href="http://trevoroke.com/blog/2008/12/18/shin-kicking-fun/"/>
    <updated>2008-12-18T00:00:00-05:00</updated>
    <id>http://trevoroke.com/blog/2008/12/18/shin-kicking-fun</id>
    <content type="html"><![CDATA[<p>I really feel like kicking IntraWeb in the shins sometimes. I was
going to make a list of things that required shin-kicks, but the
list was way too long and I started to look whiny.</p>

<p>Honestly, I&#8217;ve had more fun working with Joomla.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[How Not To Get Realistic Estimates - Hard Limits]]></title>
    <link href="http://trevoroke.com/blog/2008/11/20/how-not-to-get-realistic-estimates-hard-limits/"/>
    <updated>2008-11-20T00:00:00-05:00</updated>
    <id>http://trevoroke.com/blog/2008/11/20/how-not-to-get-realistic-estimates-hard-limits</id>
    <content type="html"><![CDATA[<p>I&#8217;ve been looking through some freelancing site again. I often do
this to keep myself abreast of emerging markets and to look for new
gigs.</p>

<p>I&#8217;ve found that a certain segment of the gig-giving set like to
give limits on how long a project should take. Not in the &#8220;we&#8217;d
really like this finished by Friday&#8221; kind of way but in the &#8220;This
should not take an experienced developer more than one hour -
please ensure your estimate is less than this limit&#8221; kind of way.</p>

<p>Where are they getting this information? What makes them think that
they are qualified to make this call?</p>

<p>Hell - I just found one today that read &#8220;I believe the right person
can write this in twenty minutes.&#8221;</p>

<p>Twenty minutes!</p>

<p>I can&#8217;t think of any program that I could write for a person in
under twenty minutes. Twenty minutes to get the spec, think it
through, code up a solution, test the hell out of it, compile the
solution, and then bundle the thing up and send it on it&#8217;s way. I&#8217;m
a pretty quick programmer, but that&#8217;s just not going to happen.</p>

<p>Here&#8217;s a hint for the certain segment of the gig-giving set.
Recognize <em>why</em> you&#8217;re bringing in an expert. Make your request as
detailed as possible and ask for quotes with estimates from
multiple people. You should start to see an average after you get
some responses. This will give you a ballpark figure for how much
time (and therefore money) to budget. If someone gives you a wildly
overblown estimate you can either find out why (your spec might be
hard to understand) or try to find out why.</p>

<p>You&#8217;ll be happier and you&#8217;ll get some responses from people who
might actually be able to get you what you want.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Passing the Buck]]></title>
    <link href="http://trevoroke.com/blog/2008/08/06/passing-the-buck/"/>
    <updated>2008-08-06T00:00:00-04:00</updated>
    <id>http://trevoroke.com/blog/2008/08/06/passing-the-buck</id>
    <content type="html"><![CDATA[<p>I got called in to do a little support today. Nothing too big, but
any little bit hurts my soul. One of our clients has a web designer
that was trying to modify the left nav in one of our templates.</p>

<p>It&#8217;s a pretty common task. It&#8217;s one of the reasons I put a div with
the id of &#8220;leftNav&#8221; in there.</p>

<p>So.</p>

<p>Anyway.</p>

<p>Their web guy tried to make their own div for the navigational
elements and pooched it. Really badly. And then sent off a whiny
email about how we won&#8217;t help them with anything.</p>

<p>I can see screwing up. Everyone&#8217;s done it. Everyone&#8217;s made
stupid mistakes that they&#8217;re just completely blind to. Sometimes
you&#8217;re just too close to the code. And sometimes you just haven&#8217;t
learned enough yet.</p>

<p>Just don&#8217;t try to pin your mistakes on someone else.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Programming Rails with Script/Console]]></title>
    <link href="http://trevoroke.com/blog/2008/07/18/programming-rails-with-scriptconsole/"/>
    <updated>2008-07-18T00:00:00-04:00</updated>
    <id>http://trevoroke.com/blog/2008/07/18/programming-rails-with-scriptconsole</id>
    <content type="html"><![CDATA[<p>I&#8217;m completely enamoured of script/console. It makes working on
rails so much easier. Fr&#8217;instance, I blew up a migration just
recently and had to get rid of a rogue table. Just open the console
and:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="n">irb</span> <span class="no">ActiveRecord</span><span class="o">::</span><span class="no">Base</span><span class="o">.</span><span class="n">connection</span>
</span><span class='line'><span class="n">tables</span> <span class="n">drop_table</span> <span class="s2">&quot;rogue_table&quot;</span> <span class="n">tables</span>
</span></code></pre></td></tr></table></div></figure>


<p>Another fr&#8217;instance. When I&#8217;m learning the interface for a new
class, I often have to refer to it a few times. The consle along
with some meta=programming goodness make this a snap. So, to find
all methods with &#8220;tag&#8221; in it:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="no">MyClass</span><span class="o">.</span><span class="n">methods</span><span class="o">.</span><span class="n">sort</span><span class="o">.</span><span class="n">grep</span><span class="p">(</span><span class="sr">/tag/</span><span class="p">)</span>
</span></code></pre></td></tr></table></div></figure>


<p>That&#8217;s it.</p>

<p>Nice.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Ironing Out the Wrinkles]]></title>
    <link href="http://trevoroke.com/blog/2008/07/17/ironing-out-the-wrinkles/"/>
    <updated>2008-07-17T00:00:00-04:00</updated>
    <id>http://trevoroke.com/blog/2008/07/17/ironing-out-the-wrinkles</id>
    <content type="html"><![CDATA[<p>Issues are starting to come in for Spice, and they&#8217;re getting
solved just as quickly. As I said earlier, this is very much the
part I like. Not only does it mean that all of the few remaining
wrinkles are getting ironed out, it means that someone is using
it.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[has_many_polymorphs]]></title>
    <link href="http://trevoroke.com/blog/2008/07/17/has_many_polymorphs/"/>
    <updated>2008-07-17T00:00:00-04:00</updated>
    <id>http://trevoroke.com/blog/2008/07/17/has_many_polymorphs</id>
    <content type="html"><![CDATA[<p>I&#8217;ve been trying to get some tagging working using Rails, and it&#8217;s
supposed to be easy using <a href="http://wiki.rubyonrails.org/rails/pages/ActsAsTaggablePluginHowto">acts_as_taggable</a>.
And it would have been. Except that acts_as_taggable has been
deprecated. At least there&#8217;s a suggestion -
<a href="http://wiki.rubyonrails.org/rails/pages/ActsAsTaggablePluginHowto">has_many_polymorphs</a>.</p>

<p>Unfortunately my install didn&#8217;t work properly. I kept getting &#8220;is
not a taggable model&#8221; errors. And that just wouldn&#8217;t do.</p>

<h4>Solution:</h4>

<ol>
<li>move require &#8216;tagging_extensions&#8217; to above the initialization block;</li>
<li>add require &#8216;has_many_polymorphs&#8217; right above that;</li>
<li>restart Mongrel and console;</li>
</ol>


<p>You should be good to go now.</p>

<p><em>edit</em></p>

<p>Of course, it&#8217;s right there in the documentation if I had just
looked a little harder. Go Team Me!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Emacs and Rails]]></title>
    <link href="http://trevoroke.com/blog/2008/07/17/emacs-and-rails/"/>
    <updated>2008-07-17T00:00:00-04:00</updated>
    <id>http://trevoroke.com/blog/2008/07/17/emacs-and-rails</id>
    <content type="html"><![CDATA[<p>I&#8217;ve always kept emacs around for heavy text lifting. It&#8217;s always
sitting open on my desktop and stuff I&#8217;m working on gets cut into
and out of it all the time. The keyboard macros alone are enough
for that.</p>

<p>That being said, I haven&#8217;t used it as my primary code editor in a
very long time. I&#8217;ve been doing a lot of GUI work, and emacs isn&#8217;t
really cut out for that. Add in the refactoring support that most
modern IDEs and I&#8217;ve been quite willing to leave most of the work
to another program.</p>

<p>Now that I&#8217;m doing a lot more in rails, I find that I&#8217;m in emacs
more and more. I&#8217;ve dumped all of the other editors and i just
spend all of my time in emacs. I&#8217;m using emacs-rails which is a
minor mode that ties together the ruby major mode along with a
snippet editor, links to generation and migration methods, easy and
smart navigation (as in jump straight to the correct controller or
helper), and lots of little things I haven&#8217;t got around to playing
with yet.</p>

<p>On top of that, I get to keep all of the keyboard shortcuts that
I&#8217;ve already learned.</p>

<p>I&#8217;m going to post more about emacs in future posts. I&#8217;ll probably
show some parts of my .emacs file as well.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Converting to Rails]]></title>
    <link href="http://trevoroke.com/blog/2008/07/15/converting-to-rails/"/>
    <updated>2008-07-15T00:00:00-04:00</updated>
    <id>http://trevoroke.com/blog/2008/07/15/converting-to-rails</id>
    <content type="html"><![CDATA[<p>I&#8217;ve been working with Rails for the last week or so now. I&#8217;ve
loved ruby since the first time I saw it, but I never got the
chance to play around with rails. I&#8217;ve got too many PHP projects
out there.</p>

<p>I finally got the chance to change that last week on a test port of
some existing ASP.Net software. The existing codebase is a bit of a
nightmare, mainly due to the type of programming that ASP.Net
requires. All of the abstractions just feel wrong to me like
there&#8217;s this great mass of people who just don&#8217;t really get what
the web is all about. It&#8217;s really showing it&#8217;s roots. I love linq,
and I love C# with the .Net library, but that ASP.Net crap has to
curl up and die.</p>

<p>Anyway, back to rails. I&#8217;ve been coding PHP pages and sites for
years now and I&#8217;m really comfortable with the language. So much so
that I didn&#8217;t want to lose the advantages that experience bring
with it. Because of that was using MVC frameworks built in PHP
(<a href="http://codeigniter.com">Code Igniter</a> is the best that I found out there).</p>

<p>I should have changed a lot sooner.</p>

<p>I&#8217;m just blazing thorugh the code base. My PHP skills are helping
rather than hindering. The abstractions actually make sense.</p>

<p>I like it.</p>

<p>I&#8217;m not a fanboy yet (there are many places where rails would be
far too heavyweight) but I do like it a lot.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Out The Door]]></title>
    <link href="http://trevoroke.com/blog/2008/07/03/out-the-door/"/>
    <updated>2008-07-03T00:00:00-04:00</updated>
    <id>http://trevoroke.com/blog/2008/07/03/out-the-door</id>
    <content type="html"><![CDATA[<p><a href="http://spicednow.com">Spice</a> is now out the door and we&#8217;re running through all of the
little changes that have to happen whenever you release something.
Call me crazy, but this is actually the part I like.</p>

<p>I mean, I&#8217;m good at the greenfield design stage, and I do love the
flash of creativity. But I much prefer this stage. The final
extra-polishing that goes into making a product complete.</p>

<p>It&#8217;s pretty satisfying.</p>
]]></content>
  </entry>
  
</feed>

