<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SickBiscuit &#187; Ruby</title>
	<atom:link href="http://sickbiscuit.com/blog/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://sickbiscuit.com/blog</link>
	<description>The personal blog of Steven Wilkin</description>
	<lastBuildDate>Sun, 20 May 2012 01:11:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>An introduction to Sinatra</title>
		<link>http://sickbiscuit.com/blog/2012/03/27/an-introduction-to-sinatra/</link>
		<comments>http://sickbiscuit.com/blog/2012/03/27/an-introduction-to-sinatra/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 23:48:40 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Sinatra]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=613</guid>
		<description><![CDATA[Tonight I gave an introductory talk about Sinatra at the second meetup of BelfastRuby.
The Converser platform I&#8217;ve been building this last while uses a lot of Sinatra so when I was asked to give a talk about using Ruby to develop web apps without Rails it wasn&#8217;t hard to think of a subject.
This was my [...]]]></description>
			<content:encoded><![CDATA[<p>Tonight I gave an introductory talk about <a href="http://www.sinatrarb.com/">Sinatra</a> at the second meetup of <a href="http://belfastruby.com">BelfastRuby</a>.</p>
<p>The <a href="http://converser.io">Converser platform</a> I&#8217;ve been building this last while uses a lot of Sinatra so when I was asked to give a talk about using Ruby to develop web apps without Rails it wasn&#8217;t hard to think of a subject.</p>
<p>This was my first technical talk and apart from a touch of nerves and forgetting some of the jokes I had in mind I think things went well. Maybe I&#8217;ll end up giving another one before too long <img src='http://sickbiscuit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The slides are available at <a href="http://belfast-ruby-sinatra.heroku.com">belfast-ruby-sinatra.heroku.com</a> and make use of <a href="https://github.com/schacon/showoff">showoff</a> which itself uses Sinatra. Meta.</p>
<p>The source, including the code samples, is on <a href="https://github.com/stevenwilkin/belfast-ruby-sinatra">GitHub</a>.</p>
<p><strong>Update:</strong> some photos from the evening are now <a href="http://www.flickr.com/photos/fillyc/sets/72157629323664172">available on Flickr</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2012/03/27/an-introduction-to-sinatra/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tracking my coffee consumption with Redis, Sinatra and Cocoa</title>
		<link>http://sickbiscuit.com/blog/2012/03/07/tracking-my-coffee-consumption-with-redis-sinatra-and-cocoa/</link>
		<comments>http://sickbiscuit.com/blog/2012/03/07/tracking-my-coffee-consumption-with-redis-sinatra-and-cocoa/#comments</comments>
		<pubDate>Wed, 07 Mar 2012 22:00:17 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Coffee]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Redis]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Sinatra]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=608</guid>
		<description><![CDATA[I&#8217;ve often joked about putting together an app to track my coffee consumption, such is my reputation for consuming the black goodness. Like a lot of my other personal projects, the idea had a prolonged gestation period and was finally born through a welcome spark of motivation.
 Crafting fine web APIs
Over the past 6 months [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve often joked about putting together an app to track my coffee consumption, such is my reputation for consuming the black goodness. Like a lot of my other personal projects, the idea had a prolonged gestation period and was finally born through a welcome spark of motivation.</p>
<h2> Crafting fine web APIs</h2>
<p>Over the past 6 months the bulk of what I&#8217;ve been doing day to day with <a href="https://twitter.com/vigill">Vigill</a> has involved building web APIs for consumption by mobile clients. This has involved lots of <a href="http://www.sinatrarb.com/">Sinatra</a>, <a href="http://redis.io/">Redis</a> and <a href="http://mongodb.org/">MongoDB</a>.</p>
<p>In this time I&#8217;ve also put together a <a href="/blog/2011/11/01/my-also-ran-markdown-editor-for-os-x/">couple more</a> <a href="/blog/2012/01/31/a-simple-app-to-monitor-google-chrome-on-os-x/">Cocoa apps</a>.</p>
<h2>Thick client boogie</h2>
<p>An unexpected resurgance in enthusiam for developing desktop apps combined with a fluency in cranking out webservices put me in a good position to put together a simple API and client.</p>
<p>I&#8217;m not a big user of mobile apps but I do spend the bulk of my waking hours sitting in front of a Mac so producing a client for OS X was the logical choice.</p>
<p>For the API I considered using something a bit more esoteric than my standard toolkit, but no matter what combination of technologies I investigated not much seems to come close to the power and flexibilty I find with Ruby and it&#8217;s frameworks for performing the bulk of tasks required by the web applications of today.</p>
<h2>Areas of note</h2>
<p>A valid API key must be sent in the request headers when sending a POST to the Sinatra app. Validity of the key is determined by <a href="http://redis.io/commands/sismember">checking set membership</a> in Redis. A 4xx status code is returned if the key is missing or invalid.</p>
<p>The daily count is boosted with an <a href="http://redis.io/commands/hincrby">atomic increment of a hash field</a>.</p>
<p>The client is not much more than a GUI wrapper around some HTTP requests sent using <a href="https://github.com/AFNetworking/AFNetworking/">AFNetworking</a>. A <a href="/blog/2011/05/19/an-ios-client-for-my-uk-inflation-app/">previous native iOS client</a> I developed used <a href="https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSURLRequest_Class/Reference/Reference.html">NSURLRequest</a> directly and I found AFNetworking <em>much</em> simpler to use.</p>
<h2>Get the code</h2>
<p>The <a href="https://github.com/stevenwilkin/coffee-tracker">source for the API</a> and <a href="https://github.com/stevenwilkin/coffee-tracker-client-osx">the OS X client</a> is available on GitHub as usual and some further technical details are available in the READMEs.</p>
<p>You can keep up to date with my coffee consumption at <a href="http://coffee-tracker.herokuapp.com/">coffee-tracker.herokuapp.com</a>.</p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2012/03/07/tracking-my-coffee-consumption-with-redis-sinatra-and-cocoa/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A minimal Rack app to lookup your external IP address</title>
		<link>http://sickbiscuit.com/blog/2011/02/20/a-minimal-rack-app-to-lookup-your-external-ip-address/</link>
		<comments>http://sickbiscuit.com/blog/2011/02/20/a-minimal-rack-app-to-lookup-your-external-ip-address/#comments</comments>
		<pubDate>Sun, 20 Feb 2011 01:14:41 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=544</guid>
		<description><![CDATA[I think I first heard the term &#8220;Rack-app&#8221; when I started using Heroku to host a couple of projects. I didn&#8217;t know an awful lot about Rack but I did know that it helped a great deal when it came to getting my Rails and Sinatra apps off my workstation and onto the web.
Tonight I [...]]]></description>
			<content:encoded><![CDATA[<p>I think I first heard the term &#8220;Rack-app&#8221; when I started using <a href="http://heroku.com/">Heroku</a> to host a couple of projects. I didn&#8217;t know an awful lot about <a href="https://github.com/rack/rack">Rack</a> but I did know that it helped a great deal when it came to getting my Rails and Sinatra apps off my workstation and onto the web.</p>
<p>Tonight I thought I&#8217;d have another quick look at how it works, what it takes to build a Rack-app and what information about the request is available to the handler.</p>
<p>The result was the following, an object which responds to <em>call</em> and returns a HTTP response code, headers and a body:</p>
<pre class="ruby">ip = <span style="color:#CC0066; font-weight:bold;">lambda</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>env<span style="color:#006600; font-weight:bold;">|</span>
  <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">200</span>, <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#996600;">&quot;Content-Type&quot;</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;text/plain&quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span>env<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;REMOTE_ADDR&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
run ip</pre>
<p>I have this running on <a href="http://ip.stevenwilkin.com">ip.stevenwilkin.com</a> and it provides the same useful function as <a href="http://whatismyip.com">whatismyip.com</a> but without the ads <img src='http://sickbiscuit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The code is available on <a href="https://github.com/stevenwilkin/ip.stevenwilkin.com">GitHub</a> as always.</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2011/02/20/a-minimal-rack-app-to-lookup-your-external-ip-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backing up Delicious bookmarks to CouchDB</title>
		<link>http://sickbiscuit.com/blog/2011/01/11/backing-up-delicious-bookmarks-to-couchdb/</link>
		<comments>http://sickbiscuit.com/blog/2011/01/11/backing-up-delicious-bookmarks-to-couchdb/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 23:15:12 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[couchdb]]></category>
		<category><![CDATA[database]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=531</guid>
		<description><![CDATA[Last year I started researching how CouchDB could be used for the BodyGuard web-app QA platform. Unfortunately I had to put my tinkerings to one side when some extra freelance work came in; contracting during the day and freelancing in the evenings quickly put an end to any spare time and my fitness efforts took [...]]]></description>
			<content:encoded><![CDATA[<p>Last year I started researching how <a href="http://couchdb.apache.org/">CouchDB</a> could be used for the <a href="http://bodyguardapp.com/">BodyGuard</a> web-app QA platform. Unfortunately I had to put my tinkerings to one side when some extra freelance work came in; contracting during the day and freelancing in the evenings quickly put an end to any spare time and my fitness efforts took a hit but I was only self-employed for a short while and it seemed the thing to do.</p>
<p>Since the urgency of the freelance work died down I&#8217;ve been looking for a small project to help me get back up to speed with Couch again and when the rumours of <a href="http://delicious.com/stevebiscuit">Delicious</a> being shutdown surfaced I saw the opportunity.</p>
<p>The code is quite simple but it served to refresh my memory and has an actual practical aspect which is a bonus <img src='http://sickbiscuit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  It&#8217;s available on <a href="https://github.com/stevenwilkin/delicious-couch">GitHub</a> as usual and the instructions below should get you up and running.</p>
<h2>Prerequisites</h2>
<ul>
<li>a pre-Yahoo Delicious account  (they use HTTP Basic Auth for authentication)</li>
<li>CouchDB running on port 5984 on your local machine, I recommend the binary distributions from <a href="http://www.couchone.com/get">CouchOne</a></li>
<li>nokogiri and couchrest gems must be installed:
<pre class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> nokogiri couchrest</pre>
</li>
</ul>
<h2>Clone the code from GitHub</h2>
<pre class="bash">git clone https:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>stevenwilkin<span style="color: #000000; font-weight: bold;">/</span>delicious-couch
<span style="color: #7a0874; font-weight: bold;">cd</span> delicious-couch</pre>
<h2>Run the import script to fetch your saved bookmarks</h2>
<pre class="bash"><span style="color: #007800;">USER=</span>username <span style="color: #007800;">PASS=</span>password .<span style="color: #000000; font-weight: bold;">/</span>import.rb</pre>
<p>Substitute your Delicious username and password on the command line</p>
<h2>Create the design document</h2>
<pre class="bash">.<span style="color: #000000; font-weight: bold;">/</span>views.rb</pre>
<h2>Querying the data</h2>
<p>Now that the database had been populated and the views created, the contents can be queried</p>
<h3>View all urls</h3>
<pre class="bash">.<span style="color: #000000; font-weight: bold;">/</span>list_urls.rb</pre>
<h3>View all tags along with their count</h3>
<pre class="bash">.<span style="color: #000000; font-weight: bold;">/</span>count_tags.rb</pre>
<h3>View all urls with a specific tag</h3>
<pre class="bash">.<span style="color: #000000; font-weight: bold;">/</span>urls_by_tag.rb git</pre>
<p>Views all bookmarks tagged with &#8220;git&#8221;</p>
<p>This set of scripts is only scraping the surface of what is possible with CouchDB but it demonstrates the immense power of MapReduce along with the basics of interacting with CouchDB using Ruby. Clone <a href="https://github.com/stevenwilkin/delicious-couch">the code</a> and enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2011/01/11/backing-up-delicious-bookmarks-to-couchdb/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing RMagick on Debian Lenny</title>
		<link>http://sickbiscuit.com/blog/2010/12/25/installing-rmagick-on-debian-lenny/</link>
		<comments>http://sickbiscuit.com/blog/2010/12/25/installing-rmagick-on-debian-lenny/#comments</comments>
		<pubDate>Sat, 25 Dec 2010 01:39:16 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=520</guid>
		<description><![CDATA[Just a quick reminder to myself on how I installed RMagick on a Debian 5.0.4 &#8220;lenny&#8221; VPS. All commands to be run as root.
Build ImageMagick from source
curl -O ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar xvzf ImageMagick.tar.gz -C /usr/src/
cd /usr/src/ImageMagick-6.6.6-6/
./configure
make
make install
Install the RMagick Gem
gem install rmagick
Bingo!
As an interesting aside, ImageMagick handles a lot of image formats via delegate libraries. I previously [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick reminder to myself on how I installed RMagick on a Debian 5.0.4 &#8220;lenny&#8221; VPS. All commands to be run as root.</p>
<h2>Build ImageMagick from source</h2>
<pre>curl -O ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar xvzf ImageMagick.tar.gz -C /usr/src/
cd /usr/src/ImageMagick-6.6.6-6/
./configure
make
make install</pre>
<h2>Install the RMagick Gem</h2>
<pre>gem install rmagick</pre>
<p>Bingo!</p>
<p>As an interesting aside, ImageMagick handles a lot of image formats via delegate libraries. I previously installed RMagick on a CentOS box and had to seperately install TrueType fonts which were necessary for the project in question. These had to be installed <strong>before</strong> ImageMagick and were accessible through <em>yum</em> and the <em>xorg-x11-fonts-truetype</em> package.</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2010/12/25/installing-rmagick-on-debian-lenny/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Minder &#8211; a simple web-app monitoring tool written in Ruby</title>
		<link>http://sickbiscuit.com/blog/2010/12/13/minder-a-simple-web-app-monitoring-tool-written-in-ruby/</link>
		<comments>http://sickbiscuit.com/blog/2010/12/13/minder-a-simple-web-app-monitoring-tool-written-in-ruby/#comments</comments>
		<pubDate>Mon, 13 Dec 2010 23:00:38 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=502</guid>
		<description><![CDATA[Background
A few months ago I was tasked with migrating and maintaining a bunch of legacy Rails apps and a couple of them were misbehaving. Requests were hanging which was tying-up the front-end Apache child processes and resulting in all the web-apps on the server becoming unresponsive
At the time I didn&#8217;t know what was causing the [...]]]></description>
			<content:encoded><![CDATA[<h2>Background</h2>
<p>A few months ago I was tasked with migrating and maintaining a bunch of legacy Rails apps and a couple of them were misbehaving. Requests were hanging which was tying-up the front-end Apache child processes and resulting in all the web-apps on the server becoming unresponsive</p>
<p>At the time I didn&#8217;t know what was causing the hanging requests, it wasn&#8217;t happening in a predictable manner and on the surface I had all the apps dependencies in place.</p>
<p>Seeing as this was a job I was doing on the side I had very limited time to investigate the underlying issue and decided I would have to make do with just knowing when the apps went down so I could ssh in and manually kill off the offending processes.</p>
<p>My initial thought was to use Nagios for monitoring but it seemed excessively heavy-weight for the task at hand so I seized the opportunity to quickly develop a tool perfectly tailored to my needs.</p>
<p>The resulting script, minder, checks a list of domains and if the root of each can&#8217;t be read within 10 seconds a notication is sent via XMPP. Nothing more, nothing less. Simple.</p>
<p>Minder proved effective and I was bombarded with instant messages whenever any of the apps went under. Thankfully I found to bit more time to investigate more thoroughly and tracked the issue down to a missing TrueType font used by ImageMagick.</p>
<p>The first iteration of minder was very simple but I thought I&#8217;d put a bit of extra effort in to make it easier to customise and share it with the internet-at-large, hopefully someone will get some use out of it.</p>
<h2>Prerequisties</h2>
<ul>
<li>
<p>Two XMPP accounts:</p>
<ul>
<li>one to send notifications from, and</li>
<li>a second to receive notifications</li>
</ul>
<p>Google Talk or any regular Jabber/XMPP accounts will suffice
</li>
<li>
<p><a href="http://twitter.com/Blaine">Blaine</a>&#8217;s <a href="http://github.com/blaine/xmpp4r-simple">xmpp4r-simple</a> gem must be installed:</p>
<pre><code>sudo gem install xmpp4r-simple
</code></pre>
</li>
</ul>
<h2>Usage</h2>
<ul>
<li>copy minder.yaml.sample to minder.yaml</li>
<li>edit minder.yaml to specify the username and password of the sending XMPP account</li>
<li>specify your own personal XMPP account (xmpp_to)</li>
<li>modify the list of domains to monitor</li>
<li>run the script
<pre><code>$ ./minder.rb
</code></pre>
</li>
<li>
<p>Optionally run the script from a Cron job, the following will run every hour:</p>
<pre><code>0 * * * * /path/to/minder.rb &gt; /dev/null 2&gt;&amp;1
</code></pre>
</li>
</ul>
<h2>Get the code</h2>
<p>Clone the repo from <a href="https://github.com/stevenwilkin/minder">GitHub</a>. Fire any queries to <a href="http://twitter.com/stevebiscuit">@stevebiscuit</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2010/12/13/minder-a-simple-web-app-monitoring-tool-written-in-ruby/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Is it raining in Belfast? Redux</title>
		<link>http://sickbiscuit.com/blog/2010/08/01/is-it-raining-in-belfast-redux/</link>
		<comments>http://sickbiscuit.com/blog/2010/08/01/is-it-raining-in-belfast-redux/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 21:51:30 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Sinatra]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=493</guid>
		<description><![CDATA[Last year I created a nano-app which attempted to answer the question, is it raining in Belfast?
I was never completely pleased with it but the objective was to get something done and get it done fast, which was achieved.
This weekend I&#8217;ve been tinkering with another project and hit a bit of a stumbling block getting [...]]]></description>
			<content:encoded><![CDATA[<p>Last year I created a <a href="/blog/2009/01/26/nano-apps/">nano-app</a> which attempted to answer the question, <a href="http://isitraininginbelfast.com/">is it raining in Belfast?</a></p>
<p>I was never completely pleased with it but the objective was to get something done and get it done fast, which was achieved.</p>
<p>This weekend I&#8217;ve been tinkering with another project and hit a bit of a stumbling block getting various pieces of software to co-exist.</p>
<p>I decided a break from the problem would be beneficial but I still wanted to have some sense of achievement from the weekend and redeveloping this app seemed a good idea.</p>
<p>Some quick research showed that the <a href="http://weather.yahoo.com/northern-ireland/belfast/belfast-44544">Yahoo! weather report for Belfast</a> could provide the necessary information so I hacked up an RSS processing script and converted the old PHP frontend to a quick and simple Sinatra app.</p>
<p>The app now operates as originally envisioned: it answers the question with a straightforward yes or no. Hopefully it will be accurate as well <img src='http://sickbiscuit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The app is hosted at <a href="http://isitraininginbelfast.com">isitraininginbelfast.com</a> and the code is on <a href="http://github.com/stevenwilkin/isitraininginbelfast.com">GitHub</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2010/08/01/is-it-raining-in-belfast-redux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An experimental lifestream app</title>
		<link>http://sickbiscuit.com/blog/2010/06/27/an-experimental-lifestream-app/</link>
		<comments>http://sickbiscuit.com/blog/2010/06/27/an-experimental-lifestream-app/#comments</comments>
		<pubDate>Sun, 27 Jun 2010 21:48:49 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Sinatra]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=480</guid>
		<description><![CDATA[Some time ago DW and myself had an enthusiastic conversation about logging various aspects of our electronic lives: emails sent and received, RSS feeds read, incoming and outgoing phone calls, the list goes on.
At that time I&#8217;d already started tinkering with apps to track my efforts in the gym and changes in my bodyweight, I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago <a href="http://twitter.com/davidbelfast">DW</a> and myself had an enthusiastic conversation about logging various aspects of our electronic lives: emails sent and received, RSS feeds read, incoming and outgoing phone calls, the list goes on.</p>
<p>At that time I&#8217;d already started tinkering with apps to track my efforts in the gym and changes in my bodyweight, I&#8217;ve used notebooks for this for years and thought it&#8217;d be interesting to have this information in electronic form.</p>
<h3>Sharpening skills</h3>
<p>While I was on the bench waiting for my current contract to start I was sharpening my skills through developing some small projects with the technologies I&#8217;d be using. One of those technologies was <a href="http://www.sqlite.org/">SQLite</a> which I knew of but didn&#8217;t have much hands on experience with.</p>
<p>I started by playing with the <a href="http://github.com/luislavena/sqlite3-ruby">Ruby interface to SQLite</a>, using it to insert and retrieve data from a simple database. I&#8217;ve since grown to love the simplicity and flexibility of SQLite and will no doubt use it again in the future.</p>
<p>I needed a practical application and thought back to my intentions to track my online activities. Now was as good a time as any to to tick this off the list of potential projects.</p>
<p>When I&#8217;d glued together some Ruby to parse the RSS feed of this blog I knew the basics were in place so I started on a simple Sinatra app to act as a web interface.</p>
<h3>Stumbling block</h3>
<p>I scoured the web for design inspiration and got a good start to the visual aspect of this project but couldn&#8217;t make my mind up over a few subtle items. Next thing my agent called: the purchase order finally came through and my contract was to start the next day.</p>
<p>The demands of adjusting to a new work environment meant I felt little motivation to work on anything on my own time and I became more interested in funneling my excess income into the stockmarket. The project joined those other half-finished unfortunates.</p>
<h3>A fresh jolt of motivation</h3>
<p>After a couple of months on the contract I started feeling a renewed motivation to get something of my own out there. I couldn&#8217;t  bare the thought of starting another project to not finish it so I set out to to whip this latest app into shape and release it as soon as possible and no later.</p>
<p>I dug through the uncommited changes in my working copy and made some arbitrary decisions which resulted in a design I felt was &#8220;good enough.&#8221; I modified my RSS parsing script to feed into SQLite and extended it to process my <a href="http://delicious.com/stevebiscuit">Delicious bookmarks</a> and <a href="http://www.last.fm/user/ahSyd">loved tracks on Last.fm</a>. I created pagination links, wrote a README and sorted out the hosting and cron jobs. Bingo.</p>
<h3>Check it out</h3>
<p>My original intention was to track much more of my online life and there&#8217;s some details I&#8217;d like to change but I love releasing code and I&#8217;m pleased with this first iteration.</p>
<p>The app is hosted at <a href="http://life.stevenwilkin.com">life.stevenwilkin.com</a> and the code is available on <a href="http://github.com/stevenwilkin/life.stevenwilkin.com">GitHub</a>, I hope you like it.</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2010/06/27/an-experimental-lifestream-app/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Rails 3 Hello World</title>
		<link>http://sickbiscuit.com/blog/2010/06/08/rails-3-hello-world/</link>
		<comments>http://sickbiscuit.com/blog/2010/06/08/rails-3-hello-world/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 21:51:06 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=472</guid>
		<description><![CDATA[The past while I&#8217;ve been busy providing technical consultancy to BT and haven&#8217;t had much drive to work on anything on my own time. The itch has returned the past couple of weeks though so I thought I&#8217;d see what I&#8217;ve been missing in the Rails world and in what better way than getting a [...]]]></description>
			<content:encoded><![CDATA[<p>The past while I&#8217;ve been busy providing technical consultancy to <a href="http://bt.com">BT</a> and haven&#8217;t had much drive to work on anything on my own time. The itch has returned the past couple of weeks though so I thought I&#8217;d see what I&#8217;ve been missing in the Rails world and in what better way than getting a basic Rails 3 app up and running.</p>
<p>My environment was already setup for Rails 2.3.* and <a href="http://yehudakatz.com/2009/12/31/spinning-up-a-new-rails-app/">Yehuda Katz&#8217; post</a> served as a guide to get me up to speed with the beta loveliness.</p>
<h3>RubyGems 1.3.7 along with Thor and Bundler gems required</h3>
<p>My installed version of RubyGems was a couple of point releases behind, so I updated that and installed the necessary gems</p>
<pre>sudo gem update --system
sudo gem install thor bundler</pre>
<h3>Clone Edge Rails from GitHub</h3>
<pre>mkdir -p ~/code/rails/rails
git clone http://github.com/rails/rails.git ~/code/rails/rails</pre>
<h3>Generate a fresh app and install dependencies with Bundler</h3>
<pre>mkdir ~/code/rails/rails-3-demo
cd !$
ruby ~/code/rails/rails/bin/rails new . --dev
bundle install</pre>
<h3>Launch the web server</h3>
<pre>./script/rails server</pre>
<p>Browse to <a href="http://0.0.0.0:3000">http://0.0.0.0:3000</a> and you&#8217;re done!</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2010/06/08/rails-3-hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Home time revisited &#8211; redeveloping a CakePHP application with Sinatra</title>
		<link>http://sickbiscuit.com/blog/2010/03/24/home-time-revisited-redeveloping-a-cakephp-application-with-sinatra/</link>
		<comments>http://sickbiscuit.com/blog/2010/03/24/home-time-revisited-redeveloping-a-cakephp-application-with-sinatra/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 18:26:50 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Sinatra]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=466</guid>
		<description><![CDATA[I&#8217;ve just released the latest iteration of hometi.me, a little nano-app I&#8217;ve mentioned before.
Deliberate Practice
It&#8217;s only a trivial app but I&#8217;ve a bit of free time before the start of a contract so I thought it would be good practice to redevelop it, a task I&#8217;d been ignoring for a long time.
Goodbye CakePHP, Hello Sinatra
The [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just released the latest iteration of <a href="http://hometi.me">hometi.me</a>, a little <a href="http://sickbiscuit.com/blog/2009/01/26/nano-apps/">nano-app</a> I&#8217;ve <a href="http://sickbiscuit.com/blog/2008/08/12/is-it-home-time-yet/">mentioned</a> <a href="http://sickbiscuit.com/blog/2008/09/09/home-time-is-a-little-closer/">before</a>.</p>
<h3>Deliberate Practice</h3>
<p>It&#8217;s only a trivial app but I&#8217;ve a bit of free time before the start of a contract so I thought it would be good practice to redevelop it, a task I&#8217;d been ignoring for a long time.</p>
<h3>Goodbye CakePHP, Hello Sinatra</h3>
<p>The original app was put together quickly with <a href="http://cakephp.org/">CakePHP</a>, a PHP-based framework I&#8217;ve used since my first paid programming gig. Since then though my interest and proficiency with Ruby and it&#8217;s frameworks has come more to the forefront. By choosing <a href="http://sinatrarb.com">Sinatra</a>, the app was given access to the rich Ruby ecosystem, including the joyful <a href="http://haml-lang.com/">HAML</a> and <a href="http://sass-lang.com/">SASS</a>.</p>
<p>The interesting aspect of this release is that all the logic is now implemented on the client-side using <a href="http://jquery.com/">Javascript</a>. Originally the countdown was calculated on the server-side and passed to the client with an AJAX call, but the server is more-or-less just hosting the markup, stylesheets and Javascript files required to get the app up and running in the browser.</p>
<h3>Heroku</h3>
<p>As this app doesn&#8217;t make use of a database or Cron jobs etc I thought I&#8217;d take the opportunity to move it from my own infrastructure and onto the awesomeness of <a href="http://heroku.com/">Heroku</a> whose free offering is a lot more performant than my little <a href="http://vpslink.com/?ref=CM6S0S">VPS</a>. Heroku is a service I&#8217;ve been playing with for a while now and it makes deploying a Ruby web app into production a breeze, assuming your project can work within it&#8217;s limitations.</p>
<p>All that&#8217;s left now is for the DNS changes to propagate. I&#8217;d like to show a bit more love to this app in the future, the controls to specify your own home time could be more intuitive for instance, but for now I&#8217;m content with the improvements I&#8217;ve made to it and it&#8217;s new home.</p>
<p>Is it passed your home time yet?</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2010/03/24/home-time-revisited-redeveloping-a-cakephp-application-with-sinatra/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

