<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Storm Consultancy » Blog</title> <link>http://www.stormconsultancy.co.uk</link> <description>Web Design Bath</description> <lastBuildDate>Tue, 12 Mar 2013 08:54:00 +0000</lastBuildDate> <language>en-GB</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.5.1</generator> <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/storm-consultancy/Yedg" /><feedburner:info uri="storm-consultancy/yedg" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>Job: Full time Web Developer</title><link>http://feedproxy.google.com/~r/storm-consultancy/Yedg/~3/dUWiSlzwa3Y/</link> <comments>http://www.stormconsultancy.co.uk/blog/announcements/job-full-time-rails-developer/#comments</comments> <pubDate>Tue, 26 Feb 2013 13:55:49 +0000</pubDate> <dc:creator>Adam Pope</dc:creator> <category><![CDATA[Announcements]]></category> <category><![CDATA[job]]></category> <category><![CDATA[Rails]]></category> <category><![CDATA[Ruby]]></category> <category><![CDATA[Web Development]]></category><guid isPermaLink="false">http://www.stormconsultancy.co.uk/?p=2624</guid> <description><![CDATA[Storm is a web development agency based in Bath, UK with a growing reputation.  To meet our ever increasing demand we&#8217;re looking for some new talent to join our skilled team. Role: Web Developer Basis: Full time Salary: Based on experience Location: Storm HQ, Bath, UK We&#8217;re working with some fantastic clients on really interesting technical [...]]]></description> <content:encoded><![CDATA[<p>Storm is a web development agency based in Bath, UK with a growing reputation.  To meet our ever increasing demand we&#8217;re looking for some new talent to join our <a href="/team" target="_blank">skilled team</a>.</p><ul><li>Role: <strong>Web Developer</strong></li><li><span style="line-height: 13px;">Basis: <strong>Full time</strong></span></li><li>Salary: <strong>Based on experience<br /> </strong></li><li>Location: <strong>Storm HQ, Bath, UK</strong></li></ul><p><span id="more-2624"></span></p><p>We&#8217;re working with some fantastic clients on really interesting technical projects and you&#8217;ll be getting involved from day one. Storm are also working on a range of SaaS apps that we are hoping to release over the next 12 months.  As part of our development team, any downtime from client work will be spent on these.</p><p>If that sounds interesting, read on!</p><p>Our ideal candidate will:</p><ul><li>Be a capable programmer with good knowledge of OOP and MVC web frameworks who understands when, and more importantly, when not to use design patterns and buzz word technologies.</li><li><span style="line-height: 13px;">Know Ruby on Rails 3.2 well.  If not, we&#8217;d still be interested to hear from excellent programmers keen to learn Rails.</span></li><li>Be competent with HTML, CSS and JavaScript to produce clean, semantic markup.  Knowledge of their new overlords, SCSS and CoffeeScript, is helpful.</li><li>Consider source control essential.  Experience with Git helpful.</li><li>Follow a rough, but not religious Test-Driven Development approach.</li><li>Be adaptable and a quick learner.</li><li>Have excellent written and spoken English.</li><li>Be comfortable working in an agency environment, communicating directly with clients face-to-face and over the phone.  Previous experience in a client facing role is preferred, either at an agency or freelance.</li><li>Be available to work from our offices 5 days a week.</li><li>Thrive working in a young, dynamic company.  You&#8217;ll fit into the culture and become an integral part of the team.</li></ul><p>We don&#8217;t require you to be <del>a rockstar developer</del> the finished article, just have a solid understanding of the principles and be enthusiastic to learn from, and share ideas with the team.</p><p>Benefits</p><ul><li><span style="line-height: 13px;">Macbook Pro and 27&#8243; Cinema Display.</span></li><li>Office in central Bath with Xbox.</li><li>Flexible working hours.</li><li>Friday afternoon off.</li><li>Unrestricted holiday allowance.</li><li>Casual dress code.</li><li>Fantastic coffee from our awesome machine.  Tea + biccies too!</li></ul><p>To apply, please send a CV and covering letter, along with your salary expectations and when you&#8217;d be available to start to <a href="mailto:cv@stormconsultancy.co.uk" target="_blank">cv@stormconsultancy.co.uk</a>.</p><p>We&#8217;re interested in hearing from individuals, <strong>no</strong> recruitment agencies.</p> <img src="http://feeds.feedburner.com/~r/storm-consultancy/Yedg/~4/dUWiSlzwa3Y" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.stormconsultancy.co.uk/blog/announcements/job-full-time-rails-developer/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.stormconsultancy.co.uk/blog/announcements/job-full-time-rails-developer/</feedburner:origLink></item> <item><title>oAuth Twitter for PHP and WordPress developers: Version 2!</title><link>http://feedproxy.google.com/~r/storm-consultancy/Yedg/~3/yt2v-jX7rak/</link> <comments>http://www.stormconsultancy.co.uk/blog/development/oauth-twitter-for-php-and-wordpress-developers-version-2/#comments</comments> <pubDate>Fri, 01 Feb 2013 09:15:30 +0000</pubDate> <dc:creator>Liam Gladdy</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://www.stormconsultancy.co.uk/?p=2617</guid> <description><![CDATA[Yesterday, I released version 2.0 of our oAuth Twitter PHP class and WordPress plugin. It&#8217;s a simple way of handling all of the oAuth requirements in Twitter&#8217;s API v1.1 that become mandatory on 5th March 2013. For more information about the plugin itself, you can read my original post on the first release. Version 2.0 is [...]]]></description> <content:encoded><![CDATA[<p>Yesterday, I released version 2.0 of our oAuth Twitter PHP class and WordPress plugin.</p><p>It&#8217;s a simple way of handling all of the oAuth requirements in Twitter&#8217;s API v1.1 that become mandatory on <a href="https://dev.twitter.com/calendar">5th March 2013</a>. For more information about the plugin itself, you can read <a href="http://www.stormconsultancy.co.uk/blog/development/tools-plugins/oauth-twitter-feed-for-developers-library-and-wordpress-plugin/">my original post on the first release</a>.</p><p>Version 2.0 is vastly improved and allows you to:</p><ul><li><span style="line-height: 13px;">Use multiple Twitter accounts rather than just the one defined in the configuration</span></li><li>Define a custom cache expiry (and allows you to disable it for debug purposes)</li><li>Pass any <a href="http://dev.twitter.com/docs/api/1.1/get/user_timeline">custom parameters</a> you want to Twitter&#8217;s API, and override the defaults easily</li></ul><p>This update is fully backwards compatible with version 1.0. You can either upgrade the plugin using the WordPress admin panel, or just drop the updated class file in — but it will delete your cache the first time it runs, as the format has changed significantly to support the new features.</p><p>We suspect many people aren&#8217;t yet prepared for Twitter&#8217;s great API 1.0 switch off on 5th March 2013, so it&#8217;s worth checking any sites you manage or maintain to make sure they are using authenticated calls to Twitter.</p> <img src="http://feeds.feedburner.com/~r/storm-consultancy/Yedg/~4/yt2v-jX7rak" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.stormconsultancy.co.uk/blog/development/oauth-twitter-for-php-and-wordpress-developers-version-2/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.stormconsultancy.co.uk/blog/development/oauth-twitter-for-php-and-wordpress-developers-version-2/</feedburner:origLink></item> <item><title>How to save the uploaded file name with carrierwave_direct and S3</title><link>http://feedproxy.google.com/~r/storm-consultancy/Yedg/~3/kvxYYIKJCFw/</link> <comments>http://www.stormconsultancy.co.uk/blog/development/code-snippets/how-to-save-the-uploaded-file-name-with-carrierwave_direct-and-s3/#comments</comments> <pubDate>Thu, 17 Jan 2013 09:46:32 +0000</pubDate> <dc:creator>Adam Pope</dc:creator> <category><![CDATA[Code Snippets]]></category> <category><![CDATA[AWS]]></category> <category><![CDATA[carrierwave]]></category> <category><![CDATA[Rails]]></category> <category><![CDATA[Ruby]]></category> <category><![CDATA[s3]]></category><guid isPermaLink="false">http://www.stormconsultancy.co.uk/?p=2611</guid> <description><![CDATA[So you&#8217;ve setup carrierwave_direct and you&#8217;re happily uploading files to Amazon S3. In this example I&#8217;ve mounted CarrierWave on a field called csv_file, but that can be whatever is appropriate to your app.   You&#8217;ve probably got two controller methods def upload @model = Model.new @model.save @uploader = @model.csv_file @uploader.success_action_callback = upload_successful_model_url(@model) end def upload_successful @model [...]]]></description> <content:encoded><![CDATA[<p>So you&#8217;ve setup <a href="https://github.com/dwilkie/carrierwave_direct" target="_blank">carrierwave_direct</a> and you&#8217;re happily uploading files to Amazon S3.  In this example I&#8217;ve mounted CarrierWave on a field called csv_file, but that can be whatever is appropriate to your app.  </p><p>You&#8217;ve probably got two controller methods</p><pre class="brush:ruby">
def upload
  @model = Model.new
  @model.save

  @uploader = @model.csv_file
  @uploader.success_action_callback = upload_successful_model_url(@model)
end

def upload_successful
  @model = Model.find(params[:id])

  # Now what??
end
</pre><p>You need to save the file name to the model so that it can be referenced later.  The documentation (at the time of writing) offers no indication of how you might go about that.  The secret is in the <i>key</i> attribute that CarrierWave adds to your model.</p><pre class="brush:ruby">
def upload_successful
  @model = Model.find(params[:id])
  @model.key = params[:key]
  @model.save

  redirect_to model_path(@model)
end
</pre><p>Simple.  When you know how!</p> <img src="http://feeds.feedburner.com/~r/storm-consultancy/Yedg/~4/kvxYYIKJCFw" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.stormconsultancy.co.uk/blog/development/code-snippets/how-to-save-the-uploaded-file-name-with-carrierwave_direct-and-s3/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.stormconsultancy.co.uk/blog/development/code-snippets/how-to-save-the-uploaded-file-name-with-carrierwave_direct-and-s3/</feedburner:origLink></item> <item><title>Adam’s MacFormat interview</title><link>http://feedproxy.google.com/~r/storm-consultancy/Yedg/~3/SBQBwZc09Z4/</link> <comments>http://www.stormconsultancy.co.uk/blog/news/adam-macformat-interview/#comments</comments> <pubDate>Fri, 11 Jan 2013 13:40:01 +0000</pubDate> <dc:creator>Dave Kelly</dc:creator> <category><![CDATA[Storm News]]></category><guid isPermaLink="false">http://www.stormconsultancy.co.uk/?p=2600</guid> <description><![CDATA[We’re all Apple advocates here at Storm, but Adam has taken his passion a step further, giving MacFormat magazine an interview on just how much he loves his retina display Macbook Pro. What&#8217;s your preference — Mac or PC? Tweet us at @StormUK and let us know, we’d love to hear your reasons!]]></description> <content:encoded><![CDATA[<p>We’re all Apple advocates here at Storm, but <a href="http://www.stormconsultancy.co.uk/team/adam/">Adam</a> has taken his passion a step further, giving <a href="http://macformat.techradar.com/">MacFormat</a> magazine an interview on just how much he loves his retina display Macbook Pro.</p><p>What&#8217;s your preference — Mac or PC? Tweet us at <a href="https://twitter.com/stormuk">@StormUK</a> and let us know, we’d love to hear your reasons!</p><div id="attachment_2597" class="wp-caption alignnone" style="width: 233px"><a href="http://cdn.stormconsultancy.co.uk/wp-content/uploads/2013/01/Screen-Shot-2013-01-11-at-12.54.39.png"><img class="size-medium wp-image-2597" alt="Adam in MacFormat" src="http://cdn.stormconsultancy.co.uk/wp-content/uploads/2013/01/Screen-Shot-2013-01-11-at-12.54.39-223x300.png" width="223" height="300" /></a><p class="wp-caption-text">Adam in MacFormat</p></div> <img src="http://feeds.feedburner.com/~r/storm-consultancy/Yedg/~4/SBQBwZc09Z4" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.stormconsultancy.co.uk/blog/news/adam-macformat-interview/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.stormconsultancy.co.uk/blog/news/adam-macformat-interview/</feedburner:origLink></item> <item><title>Paul in Agenda magazine</title><link>http://feedproxy.google.com/~r/storm-consultancy/Yedg/~3/r4vMPQSIt_I/</link> <comments>http://www.stormconsultancy.co.uk/blog/news/paul-in-agenda-magazine/#comments</comments> <pubDate>Tue, 08 Jan 2013 13:56:11 +0000</pubDate> <dc:creator>Adam Pope</dc:creator> <category><![CDATA[Storm News]]></category><guid isPermaLink="false">http://www.stormconsultancy.co.uk/?p=2604</guid> <description><![CDATA[Happy new year from everyone here at Storm! We&#8217;re all looking forward to 2013 and like a lot of companies, we&#8217;re setting targets for the year ahead. However, now is also a good time to check that you&#8217;ve got all of the basics right in terms of your IT provision. Our own Paul Leader has [...]]]></description> <content:encoded><![CDATA[<p>Happy new year from everyone here at Storm!</p><p>We&#8217;re all looking forward to 2013 and like a lot of companies, we&#8217;re setting targets for the year ahead. However, now is also a good time to check that you&#8217;ve got all of the basics right in terms of your IT provision.</p><p>Our own <a href="http://www.stormconsultancy.co.uk/team/paul/">Paul Leader</a> has been giving advice to our local business community on just that &#8211; and you can read his piece below in Agenda, Bath&#8217;s local business magazine.</p><div id="attachment_2607" class="wp-caption alignnone" style="width: 220px"><a href="http://cdn.stormconsultancy.co.uk/wp-content/uploads/2013/01/Agenda.jpg"><img class="size-medium wp-image-2607" alt="Paul in Agenda magazine" src="http://cdn.stormconsultancy.co.uk/wp-content/uploads/2013/01/Agenda-210x300.jpg" width="210" height="300" /></a><p class="wp-caption-text">Paul in Agenda magazine</p></div> <img src="http://feeds.feedburner.com/~r/storm-consultancy/Yedg/~4/r4vMPQSIt_I" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.stormconsultancy.co.uk/blog/news/paul-in-agenda-magazine/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.stormconsultancy.co.uk/blog/news/paul-in-agenda-magazine/</feedburner:origLink></item> <item><title>How to show comments on a separate page in WordPress</title><link>http://feedproxy.google.com/~r/storm-consultancy/Yedg/~3/JvpUSjJVVx8/</link> <comments>http://www.stormconsultancy.co.uk/blog/development/how-to-show-comments-on-a-separate-page-in-wordpress/#comments</comments> <pubDate>Wed, 02 Jan 2013 15:21:49 +0000</pubDate> <dc:creator>Felix Renicks</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Tools & Plugins]]></category> <category><![CDATA[comments]]></category> <category><![CDATA[custom endpoints]]></category> <category><![CDATA[permalinks]]></category> <category><![CDATA[popup comments]]></category> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://www.stormconsultancy.co.uk/?p=2573</guid> <description><![CDATA[Struggling to give WordPress comments their own page without messing up your URL structure? I know the feeling. Displaying a post&#8217;s comments separately from the main content can be useful in many circumstances. Although less common nowadays, traditionally many blogs chose to feature comments in a pop-up window or lightbox. It can also be desirable [...]]]></description> <content:encoded><![CDATA[<p>Struggling to give WordPress comments their own page without messing up your URL structure? I know the feeling.</p><p>Displaying a post&#8217;s comments separately from the main content can be useful in many circumstances. Although less common nowadays, traditionally many blogs chose to feature comments in a pop-up window or lightbox. It can also be desirable for editorial or legal reasons, for caching purposes, or perhaps if you are publishing <a href="http://www.webdesignerdepot.com/2011/03/the-pros-and-cons-of-art-directed-blogs/">individually art-directed posts</a>. It can also be handy when using WordPress for a non-blog website.</p><p><span id="more-2573"></span></p><p>WordPress has some legacy support for <a href="http://codex.wordpress.org/Function_Reference/comments_popup_link">pop-up comments</a>, but the feature is <a href="http://core.trac.wordpress.org/ticket/4860">largely abandoned</a> and poorly supported. Also, it generates the comments pages at <code>yoursite.com/?comments_popup=XXXX</code>, which is both bad for SEO and will often appear in analytics as one page.</p><p>To solve this conundrum, I&#8217;ve created a basic plugin for developers to implement separate comments pages for their WordPress site. The plugin generates a comments page for each post at /comments/, using the WordPress <a href="http://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/">rewrite endpoints API</a>. It&#8217;s not quite install-and-go, so check out the notes below.</p><p><strong><a href="https://github.com/stormuk/wp-comments-page">Download the Storm Comments Page plugin on GitHub</a></strong></p><p><em>Notes:</em></p><ul><li>You will need to customise the generated page by copying the included comments-single.php template into your theme; if you&#8217;re using this as a pop-up you will want to remove the <code>get_header()</code> and <code>get_footer()</code> calls.</li><li>WordPress doesn&#8217;t provide a filter hook for <code>comments_link()</code>, so you&#8217;ll need to manually replace links to your comments to point to the new page at /comments/</li><li>A current limitation is that it doesn&#8217;t play well with comment pagination.</li></ul> <img src="http://feeds.feedburner.com/~r/storm-consultancy/Yedg/~4/JvpUSjJVVx8" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.stormconsultancy.co.uk/blog/development/how-to-show-comments-on-a-separate-page-in-wordpress/feed/</wfw:commentRss> <slash:comments>2</slash:comments> <feedburner:origLink>http://www.stormconsultancy.co.uk/blog/development/how-to-show-comments-on-a-separate-page-in-wordpress/</feedburner:origLink></item> <item><title>6 Ways to get More Bang for your Heroku Buck While Making Your Rails Site Super Snappy</title><link>http://feedproxy.google.com/~r/storm-consultancy/Yedg/~3/LykTvfoCKwc/</link> <comments>http://www.stormconsultancy.co.uk/blog/development/6-ways-to-get-more-bang-for-your-heroku-buck-while-making-your-rails-site-super-snappy/#comments</comments> <pubDate>Tue, 11 Dec 2012 08:40:38 +0000</pubDate> <dc:creator>Paul Leader</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Ruby on Rails]]></category> <category><![CDATA[Tips & Tricks]]></category> <category><![CDATA[Tools & Plugins]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[heroku]]></category> <category><![CDATA[performance]]></category> <category><![CDATA[Rails]]></category> <category><![CDATA[Ruby]]></category> <category><![CDATA[Sysadmin]]></category><guid isPermaLink="false">http://www.stormconsultancy.co.uk/?p=2527</guid> <description><![CDATA[We love Heroku. It makes deployment so easy and quick. However, it can start to get pricey when you add additional dynos at $35 each a month. With a small amount of work, you can get a lot more out of your Heroku hosting whilst drastically improving the performance of your site. You might need [...]]]></description> <content:encoded><![CDATA[<p>We love Heroku. It makes deployment so easy and quick. However, it can start to get pricey when you add additional dynos at $35 each a month.</p><p>With a small amount of work, you can get a lot more out of your Heroku hosting whilst drastically improving the performance of your site. You might need to spend a little bit of cash on other services, but a lot less than if you simply moved the dyno slider up a few notches, and the result will be much better scalability.</p><p>So how do we max out the performance of our Heroku apps? First we stop using Heroku for things it&#8217;s bad at, then we let it do more of what it <strong><em>is</em></strong> good at, running your application code.</p><p><span id="more-2527"></span></p><h2>1. Offload Assets to S3 and CloudFront using asset_sync</h2><p>By default a Heroku dyno is responsible for serving all the assets for your site, so every page load will involve multiple requests to the dyno.</p><p>The <a title="The asset sync gem on GitHub" href="https://github.com/rumblelabs/asset_sync">asset_sync</a> gem modifies asset pre-compilation to sync all of your assets to an Amazon S3 bucket from where they are served directly and freeing up your dyno to handle more requests.</p><p>If you want to speed things up even more, you can slap Amazon&#8217;s Cloudfront CDN in front of your S3 bucket with multiple subdomains. Michel Sikkes has an excellent <a href="http://blog.firmhouse.com/complete-guide-to-serving-your-rails-assets-over-s3-with-asset_sync">guide to serving you assets with S3 and cloudfront</a>. Your assets will be served through Cloudfront from multiple subdomains (e.g. assets[0-3].myapp.com), all of which point to the same bucket. Not only will your assets be served through CloudFront&#8217;s speedy global CDN, but most will be downloaded in parallel. Browsers make a limited number of concurrent requests per host name (2 for IE, more for other browsers) so using multiple CNAMEs increases the number of concurrent connections, significantly reducing the page load time for users with good connections.</p><p>The cost of serving assets from S3, even with CloudFront, is very cheap and scales directly with the amount of data. Compared to adding another Heroku dyno this is great value, and has the added benefit of speeding up overall page loads.</p><h2>2. Don&#8217;t Upload and Process Files with your Web Dynos</h2><p>If you use something like <a title="CarrierWave gem on GitHub" href="https://github.com/jnicklas/carrierwave">CarrierWave</a> or <a title="Paperclip gem on GitHub" href="https://github.com/thoughtbot/paperclip">Paperclip</a>, by default the uploading and processing of images is done by your dyno. While this is happening your dyno is completely tied up, unable to handle requests from any other user. If one person uploads a 2Mb image on a slow connection everyone else will be locked out for the duration.</p><p>To prevent this from happening you need to decouple the upload process from your dyno. The <a href="https://github.com/dwilkie/carrierwave_direct">CarrierWave Direct</a> gem does just this. With a bit of client-side magic it uploads files to S3 directly, rather than through the dyno. The images then get resized by background processes using <a title="Delayed Job on GitHub" href="https://github.com/collectiveidea/delayed_job">DelayedJob</a> or <a title="Resue on GitHub" href="https://github.com/defunkt/resque">Resque</a>. This obviously has the downside that you&#8217;ll need a worker running, but there are ways to manage these cost-effectively which I&#8217;ll talk about next.</p><p>Another option, which we&#8217;ve used recently, is the awesome <a title="Cloudinary" href="http://cloudinary.com/invites/lpov9zyyucivvxsnalc5/uovqhrxj3jrali3zmzid" target="_blank">Cloudinary</a> service. They provide direct image uploading, on-demand image processing (including face detection, which even seems to work on cats) and a worldwide CDN all in one package. There is a free tier to get you started, and for $39 (slightly more than one Heroku dyno) their Basic plan will be more than enough for many sites. Obviously you could just spend money on another dyno, but that just scales your performance linearly, without really solving the fundamental performance bottleneck.</p><h2>3. Background Processing the Smart Way with Delayed::Job and HireFire</h2><p>Background processing with <a title="Delayed::Job on GitHub" href="https://github.com/collectiveidea/delayed_job">Delayed::Job</a> is a great way of speeding up your web requests. Potentially slow tasks like image processing or sending signup emails can happen outside of the request-response cycle, making it much snappier and freeing up your dyno to handle more requests. The downside is that you need to run a worker dyno at $35/month.</p><p>Michael van Rooljen&#8217;s <a href="https://github.com/meskyanichi/hirefire">HireFire</a> modifies Delayed::Job and Resque to automatically scale the number of worker dynos based on the jobs in the queue. Because Heroku charge by the dyno/second, spinning up 10 workers for one minute costs the same as one worker for ten minutes, so with HireFire you can potentially get things done quicker while paying less than you would if you ran a dedicated worker dyno.</p><p>HireFire does have one limitation, it only works for jobs scheduled for immediate execution. If that is an issue Michael has a <a href="http://hirefireapp.com">HireFire service</a> that will monitor your application for you, so jobs scheduled in the future will be run.</p><h2>4. Offload Complex Search to a Dedicated Provider</h2><p>If you have an application that needs to perform complex searches over large datasets don&#8217;t do it in your application directly. If searches regularly take a long time (a couple of seconds or more) consider using something like <a title="The Apache Solr Project" href="http://lucene.apache.org/solr/">Solr</a> (available as a Heroku plugin), Amazon CloudSearch, or one of the many Search as a Service providers. You&#8217;ll not only get faster search performance in many cases, but you&#8217;ll save vast amounts of development time trying to optimise your in-app search. Of course, if you have a simple application with straight-forward search then this probably won&#8217;t be worth it the cost, but it&#8217;s something worth considering.</p><h2>5. Turbo-Charge your Application with Memcache backed View Caching</h2><p>If you&#8217;ve not encountered caching in Rails, stop reading this article right now, go read the <a href="http://guides.rubyonrails.org/caching_with_rails.html">Rails Guide to Caching</a> and then DHH&#8217;s <a href="http://37signals.com/svn/posts/3113-how-key-based-cache-expiration-works">short guide to key based cache expiry</a>. Caching in Rails 4 will be even better, with improved support for &#8220;Russian Doll&#8221; caching.</p><p>View caching in Rails can have a profound effect on your application&#8217;s response time. In the past we have found that rendering pages, especially complex ones with lots of partials, can easily account for two-thirds of the total processing time, much more than you might expect.</p><p>Simply using caching will help speed up your application, but the default cache store is not shared between dynos so the benefits are limited. In contrast, a <a href="http://memcached.org">Memcache</a> store is shared between your dynos so they all benefit from any cached item. Heroku has two add-ons that let you very easily add memcache to your project. The <a href="https://addons.heroku.com/memcachier">Memcachier</a> addon gives you 25mb for free, and is pretty reasonably priced from there on up. Just adding a small cache store of 25mb can make a significant difference to the load time of your pages.</p><h2>6. Finally: Slice and Dice your Dynos with Unicorn</h2><p>So after spending a little bit of time, and a relatively small amount of cash, we&#8217;ve offloaded much of the work that was being done by our web dyno and onto services that are better suited to it; drastically speeding up our request-response cycle. Our single dyno can now handle significantly more users per minute, who are happier because they get a much faster response from the site.</p><p>However the default Heroku dyno configuration only handles one request at a time. If you wanted to increase your level of concurrency in the past you would have to increase the number of dynos. That&#8217;s all changed with the release of the Rack server <a href="http://unicorn.bogomips.org/">Unicorn</a> which can handle multiple concurrent connections. For most applications a single dyno should be able to handle between two and four connections at a time. The main constraint will be memory (limited to 512mb per dyno), so keep an eye on the gems you are loading in your production environment. Florian at Rails On Fire has done a great introduction on <a href="http://blog.railsonfire.com/2012/05/06/Unicorn-on-Heroku.html">setting up Unicorn on Heroku</a>. If you&#8217;ve followed the previous steps you should be using less memory on your web dynos, allowing you to use more threads.</p><h2>Putting it all Together</h2><p>At the end of all this we&#8217;ve freed up our Heroku dyno from doing things it&#8217;s not very good at like serving static files and uploads, and juiced up its performance when doing what it&#8217;s great at, serving Rails application requests with no sys-admin in sight.</p><p>Each technique can be easily applied to your existing applications, but if you develop with them in mind from the start you get all the benefits with almost no additional work. On their own each one will help the performance of your application, but combining them together will significantly extend the amount of time before you have to start forking out for lots more dynos, and when you do you&#8217;ll get much more bang for each of your thirty-five Heroku bucks.</p><p>If you&#8217;ve got any other tips for getting the most out of a Rails application, whether or not it&#8217;s on Heroku, we&#8217;d love to hear about it them!</p> <img src="http://feeds.feedburner.com/~r/storm-consultancy/Yedg/~4/LykTvfoCKwc" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.stormconsultancy.co.uk/blog/development/6-ways-to-get-more-bang-for-your-heroku-buck-while-making-your-rails-site-super-snappy/feed/</wfw:commentRss> <slash:comments>21</slash:comments> <feedburner:origLink>http://www.stormconsultancy.co.uk/blog/development/6-ways-to-get-more-bang-for-your-heroku-buck-while-making-your-rails-site-super-snappy/</feedburner:origLink></item> <item><title>We Love Bath exhibition!</title><link>http://feedproxy.google.com/~r/storm-consultancy/Yedg/~3/4gIqFDXG_OY/</link> <comments>http://www.stormconsultancy.co.uk/blog/news/we-love-bath-exhibition/#comments</comments> <pubDate>Thu, 29 Nov 2012 13:42:47 +0000</pubDate> <dc:creator>Dave Kelly</dc:creator> <category><![CDATA[Storm News]]></category><guid isPermaLink="false">http://www.stormconsultancy.co.uk/?p=2554</guid> <description><![CDATA[As most of you will know, our youngest member of the team and front end developer Felix is the man behind one of Bath&#8217;s most influential news sources &#8211; the @WeLoveBath twitter account. You can currently visit an exhibition of images collated through Felix&#8217;s account, along with image collections from Bath, at the We Love [...]]]></description> <content:encoded><![CDATA[<p>As most of you will know, our youngest member of the team and front end developer <a href="http://www.stormconsultancy.co.uk/team/felix" target="_blank">Felix</a> is the man behind one of Bath&#8217;s most influential news sources &#8211; the <a href="http://twitter.com/WeLoveBath" target="_blank">@WeLoveBath</a> twitter account.</p><p>You can currently visit an exhibition of images collated through Felix&#8217;s account, along with image collections from Bath, at the <a href="http://welovebath.co.uk/exhibition/" target="_blank">We Love Bath exhibition</a> in the <a href="http://www.bathnes.gov.uk/services/libraries-and-archives/library-locations-opening-times-and-information/library-locations-an#bcl" target="_blank">Bath Central Library</a>. The event runs from 26 Nov to 9 Dec 2012.</p><p>Go along and check it out what Bath Life Magazine are calling &#8220;An absolute must-see for any self-respecting Bathonian&#8221;.</p> <img src="http://feeds.feedburner.com/~r/storm-consultancy/Yedg/~4/4gIqFDXG_OY" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.stormconsultancy.co.uk/blog/news/we-love-bath-exhibition/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.stormconsultancy.co.uk/blog/news/we-love-bath-exhibition/</feedburner:origLink></item> <item><title>Using tomdoc to document a scope in a Rails model</title><link>http://feedproxy.google.com/~r/storm-consultancy/Yedg/~3/rnY6mgjvdlE/</link> <comments>http://www.stormconsultancy.co.uk/blog/development/code-snippets/using-tomdoc-to-document-a-scope-in-a-rails-model/#comments</comments> <pubDate>Wed, 28 Nov 2012 09:32:58 +0000</pubDate> <dc:creator>Adam Pope</dc:creator> <category><![CDATA[Code Snippets]]></category> <category><![CDATA[documentation]]></category> <category><![CDATA[Rails]]></category> <category><![CDATA[rdoc]]></category> <category><![CDATA[Ruby]]></category> <category><![CDATA[tomdoc]]></category><guid isPermaLink="false">http://www.stormconsultancy.co.uk/?p=2542</guid> <description><![CDATA[I&#8217;m playing around with Tomdoc for documenting my latest Rails project.  The documentation is (ironically) a bit thin on the ground.  It&#8217;s taking a bit of trial and error to get some things working.  The most recent brainteaser was how to get tomdoc (or even rdoc) to document a scope declared on a Rails model. [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;m playing around with <a href="http://tomdoc.org/" target="_blank">Tomdoc</a> for documenting my latest Rails project.  The documentation is (ironically) a bit thin on the ground.  It&#8217;s taking a bit of trial and error to get some things working.  The most recent brainteaser was how to get tomdoc (or even rdoc) to document a scope declared on a Rails model.</p><p><span id="more-2542"></span></p><p>The answer is that you need to have a line with two ## at the start for the parser to pick it up.  For example:</p><pre class="brush:ruby">  ##
  # Public: Scope to return the most recently logged entries, ordered
  # by the date the were created, newest first
  #
  # count - The number of entries to return.  Default 6.
  scope :recently_logged, -&gt;(count=6) { order('created_at DESC').limit(count) }</pre><p>&nbsp;</p><p>That gives you a section like this in your docs:</p><p><img class="aligncenter size-blog-width wp-image-2543" alt="" src="http://cdn.stormconsultancy.co.uk/wp-content/uploads/2012/11/Screen-Shot-2012-11-28-at-09.31.41-580x160.png" height="160" width="580" /></p> <img src="http://feeds.feedburner.com/~r/storm-consultancy/Yedg/~4/rnY6mgjvdlE" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.stormconsultancy.co.uk/blog/development/code-snippets/using-tomdoc-to-document-a-scope-in-a-rails-model/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.stormconsultancy.co.uk/blog/development/code-snippets/using-tomdoc-to-document-a-scope-in-a-rails-model/</feedburner:origLink></item> <item><title>Felix inspires Bath’s teens at TEDxYouth@Bath</title><link>http://feedproxy.google.com/~r/storm-consultancy/Yedg/~3/xq1naNM56vg/</link> <comments>http://www.stormconsultancy.co.uk/blog/news/felix-inspires-baths-teens-at-tedxyouthbath/#comments</comments> <pubDate>Thu, 22 Nov 2012 16:02:00 +0000</pubDate> <dc:creator>Dave Kelly</dc:creator> <category><![CDATA[Storm News]]></category><guid isPermaLink="false">http://www.stormconsultancy.co.uk/?p=2551</guid> <description><![CDATA[Our very own king of twitter Felix Renicks has been speaking to an audience of the city&#8217;s 16 to 19 year olds at the TEDxYouth@Bath conference this week. The event, run at Komedia with an audience of 300 teens, attracted top level speakers from the city and beyond with the aim of encouraging attendees to [...]]]></description> <content:encoded><![CDATA[<p>Our very own king of twitter <a href="http://www.stormconsultancy.co.uk/team/felix/">Felix Renicks</a> has been speaking to an audience of the city&#8217;s 16 to 19 year olds at the <a href="http://www.tedxyouthbath.com/" target="_blank">TEDxYouth@Bath</a> conference this week.</p><p>The event, run at Komedia with an audience of 300 teens, attracted top level speakers from the city and beyond with the aim of encouraging attendees to think outside the box and to embrace the opportunities available to them.</p><p>Felix spoke about his efforts in creating one of the city&#8217;s most influential news sources through embracing citizen media in the form of his <a href="http://twitter.com/WeLoveBath" target="_blank">@WeLoveBath</a> twitter account. The account now has over 12,000 followers and Felix has been widely recognised for his efforts in connecting the community.</p><p>You can watch Felix&#8217;s presentation at TEDxYouth@Bath, starting at 01:33:00ish here: <a href="http://new.livestream.com/tedx/TEDxYouthBath/videos/6603040" target="_blank">http://new.livestream.com/tedx/TEDxYouthBath/videos/6603040</a></p> <img src="http://feeds.feedburner.com/~r/storm-consultancy/Yedg/~4/xq1naNM56vg" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.stormconsultancy.co.uk/blog/news/felix-inspires-baths-teens-at-tedxyouthbath/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.stormconsultancy.co.uk/blog/news/felix-inspires-baths-teens-at-tedxyouthbath/</feedburner:origLink></item> </channel> </rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Object Caching 744/913 objects using disk: basic
Content Delivery Network via Amazon Web Services: CloudFront: cdn.stormconsultancy.co.uk

Served from: www.stormconsultancy.co.uk @ 2013-04-05 10:33:47 -->
