<?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:dc="http://purl.org/dc/elements/1.1/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><description>29 Steps is a software development company using Ruby,Rails and HTML5.</description><title>29 Steps</title><generator>Tumblr (3.0; @29stepz)</generator><link>http://blog.29steps.co.uk/</link><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/29Steps" /><feedburner:info uri="29steps" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://tumblr.superfeedr.com/" /><item><title>Rails 3 convert superclass to subclass</title><description>&lt;p&gt;In a recent rails 3.0 project I was working on I had an interesting dilemma. I have two models, User and Member. Member is a subclass of User.&lt;/p&gt;
&lt;p&gt;Now when a user logs into the system the system checks what roles and permissions each user has and then redirects them accordingly. e.g. if the user record has a role of &amp;#8216;Member&amp;#8217; then we redirect them to the member section.&lt;/p&gt;
&lt;p&gt;Now since Member is a subclass of User, we are using STI ( Single table inheritance ) within rails whereby all the member attributes are stored as columns within the single user table. Member has an additional method called active? which determines if the membership level is active or not. However, in the logic which checks where to redirect signins because only User objects are returned, each call to active? is made on the superclass of User and not Member. To fix this I could redefine active? within the User model but it means duplication of the active? method inside Members class.&lt;/p&gt;
&lt;p&gt;Another alternative would be to convert the User model into a Member object. ActiveRecord instances have a method called &lt;strong&gt;becomes(klass) &lt;/strong&gt;which takes the name of the class to convert to. The definition of becomes from the API docs as follows:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span&gt;Returns an instance of the specified &lt;/span&gt;&lt;code&gt;klass&lt;/code&gt;&lt;span&gt; with the attributes of the current record. This is mostly useful in relation to single-table inheritance structures where you want a subclass to appear as the superclass.&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Full link of the api can be found here: &lt;a href="http://api.rubyonrails.org/classes/ActiveRecord/Persistence.html#method-i-becomes" title="Rails api" target="_blank"&gt;&lt;a href="http://api.rubyonrails.org/classes/ActiveRecord/Persistence.html#method-i-becomes" target="_blank"&gt;http://api.rubyonrails.org/classes/ActiveRecord/Persistence.html#method-i-becomes&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now we are going the other way round from superclass to subclass which is unorthodox but works in my case here. An example of what I ended up with:&lt;/p&gt;
&lt;script src="http://www.snipplets.co.uk/snipplets/76.js" type="text/javascript"&gt;&lt;/script&gt;&lt;img src="http://feeds.feedburner.com/~r/29Steps/~4/pbT3VbJ6gSc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/29Steps/~3/pbT3VbJ6gSc/45831038315</link><guid isPermaLink="false">http://blog.29steps.co.uk/post/45831038315</guid><pubDate>Wed, 20 Mar 2013 12:24:00 +0000</pubDate><category>Rails 3</category><category>STI</category><feedburner:origLink>http://blog.29steps.co.uk/post/45831038315</feedburner:origLink></item><item><title>Example of refinerycms nested model links with image dialog</title><description>&lt;img src="http://25.media.tumblr.com/fd40eed2cffa390accc3ed28d0ad9579/tumblr_mjx1jrDP831rxv2kio1_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://24.media.tumblr.com/092dbd99fcf3487ee8bf498e386447cd/tumblr_mjx1jrDP831rxv2kio2_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;p&gt;Example of refinerycms nested model links with image dialog&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/29Steps/~4/xaFjJjsm0ew" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/29Steps/~3/xaFjJjsm0ew/45761250209</link><guid isPermaLink="false">http://blog.29steps.co.uk/post/45761250209</guid><pubDate>Tue, 19 Mar 2013 16:23:51 +0000</pubDate><category>refinerycms rails3 ruby image dialog</category><feedburner:origLink>http://blog.29steps.co.uk/post/45761250209</feedburner:origLink></item><item><title>Nested model partials in Refinery CMS</title><description>&lt;p&gt;In a recent refinerycms project I noticed a strange bug / error after upgrading the system to one of rails&amp;#8217;s security patches.&lt;/p&gt;
&lt;p&gt;Within a custom engine model, there is a nested form which uses the cocoon gem to show and remove itself. Within the nested form itself, is a link to call the js image picker within refinerycms to select an image for upload. Problem is this: because the nested field is dynamic which means that the image selector link is not generated until the &amp;#8216;Add This&amp;#8217; link is clicked and the nested form is on the screen, the image selector link does not get instantiated within a new nested model form.&lt;/p&gt;
&lt;p&gt;This can be seen with this piece of js code from &lt;strong&gt;refinerycms-core ver 1.0.11&lt;/strong&gt;, in &lt;strong&gt;public/javascripts/refinery/admin.js&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
  $(document).ready(function(){
    // other initialization code&lt;br/&gt;    init_modal_dialogs();
  })
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;init_modal_dialogs()&lt;/strong&gt; is a function which opens up a modal window in an iframe for selecting images or attachments. Since my dialog selectors are not going to be present until the nested fields are added, I bind the click event to the live action once the link is clicked. e.g.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
  $('a.add_nested_image_link').live('click', function(e)){
     init_modal_dialogs()
   })
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;This fixes the dialog open and also shows the currently selected image within the nested form.&lt;/p&gt;
&lt;p&gt;To remove the image or to replace it is a bit tricky.&lt;/p&gt;
&lt;p&gt;Refinerycms by default uses a class of &amp;#8216;.remove_picked_image&amp;#8217; to define the remove image link within the dialog. Here we have another problem. Since the dialog is not created until the nested model forms are added, we need to bind the &amp;#8216;remove_picked_image&amp;#8217; links to the live event too else it won&amp;#8217;t work:&lt;/p&gt;
&lt;script src="http://www.snipplets.co.uk/snipplets/74.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script src="http://www.snipplets.co.uk/snipplets/75.js" type="text/javascript"&gt;&lt;/script&gt;&lt;p&gt;Please note that the above only works if you are using a nested model form within your own engine in refinerycms with the cocoon gem.&lt;/p&gt;
&lt;p&gt;Some screenshots are attached in the post preceding this.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/29Steps/~4/Oalb5xmHSLE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/29Steps/~3/Oalb5xmHSLE/45759830353</link><guid isPermaLink="false">http://blog.29steps.co.uk/post/45759830353</guid><pubDate>Tue, 19 Mar 2013 15:56:00 +0000</pubDate><category>Rails 3</category><category>refinerycms</category><category>nested model form</category><category>image picker</category><feedburner:origLink>http://blog.29steps.co.uk/post/45759830353</feedburner:origLink></item><item><title>Money gem + Mongoid</title><description>&lt;p&gt;I have just switched over to using the &lt;strong&gt;money and money-rails gems&lt;/strong&gt; in a recent rails 3.2 app recently &lt;span&gt;after having issues with the formatting and storing of currency values in a Mongoid db. Plus, the money-rails gems comes with some nifty view helpers to transform the values into suitable representations on the front end.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Below are some notes to remind myself how I managed to do this within a Rails 3.2 appli&lt;span&gt;&amp;lt;codebe foRedefine the field within the mongoid document to be of type Money. e.g. Assuming we have a Product document with a field of price, we can define it as follows:&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;
&lt;pre&gt;&lt;strong&gt;nufield :price, type: Money&lt;/strong&gt;&lt;/pre&gt;
&lt;p&gt;Once defined the currency values will be stored as a hash in the document with the following structure:&lt;/p&gt;
&lt;pre&gt;&lt;strong&gt;price: {"cents" =&amp;gt; "100", "currency_iso" =&amp;gt; "GBP"}&lt;/strong&gt;&lt;span&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The price value is converted into cents automatically by the gem e.g. 1 USD gets converted into 100 cents. The currency_iso sets the country code of the currency according to the iso 4217 standard which maps the country to a specific currency code.&lt;/p&gt;
&lt;p&gt;The price value is converted into cents automatically by the gem e.g. 1 USD gets converted into 100 cents. This is important to remember else you will end up with strange values.&lt;/p&gt;
&lt;p&gt;Since I will be accessing this value quite frequently i also added an index for it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use the money-rails gem to help format the currency values inside views. The gem contains useful helper methods such as &lt;strong&gt;humanized_money_with_symbol&lt;/strong&gt; and &lt;strong&gt;humanized_money&lt;/strong&gt; to convert the currency value into a useful string representation for display.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To help validate against the price value since it is set in a form, I still need to add some validations to make sure that the price value is present and valid.&lt;/p&gt;
&lt;pre&gt;validates :price, :numericality =&amp;gt; {greater_than_or_equal_to: 1.0}, :presence =&amp;gt; true&lt;/pre&gt;
&lt;p&gt;Money gem provides a numerical validator to catch non-integer values such as strings and this can be found inside the money-rails gem lib folder &lt;strong&gt;&amp;#8216;lib/money-rails/active_model/validator.rb&amp;#8217;&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Passing in a string value to a money object field through a form does not save it properly for the simple reason that the field is no longer of type string or decimal but of object Money hence any value will need to be converted first before it can be saved.&lt;/p&gt;
&lt;p&gt;To cate for this I created a before_save callback which formats the form value into a money object before saving it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;before_save :format_price&lt;br/&gt;&lt;br/&gt;def format_price&lt;br/&gt;  self.price = Money.new((BigDecimal.new(self.price.to_s).round(2) * 100).to_i, 'GBP')&lt;br/&gt;end&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The price value needs to be converted into its cents equivalent and its currency code set in the callback.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To test that the attribute returns a Money object on successful save I have the following structure inside my rspec2 model specs:&lt;/p&gt;
&lt;script src="http://www.snipplets.co.uk/snipplets/73.js" type="text/javascript"&gt;&lt;/script&gt;&lt;p&gt;Note that within the tests, the numeric validator within money-rails is testing for the presence of strings and malformed decimal places while the other validations are added by myself.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;I hope the above helps someone to get to grips with using Money and money-rails gems in their own projects. Please comment on better ways of doing the above if you have come across similar setup in your own projects.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/29Steps/~4/Ie0AxzE4Wco" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/29Steps/~3/Ie0AxzE4Wco/45758087071</link><guid isPermaLink="false">http://blog.29steps.co.uk/post/45758087071</guid><pubDate>Tue, 19 Mar 2013 15:19:50 +0000</pubDate><category>rails</category><category>Rails 3.2</category><category>MongoDB</category><category>money money-rails</category><feedburner:origLink>http://blog.29steps.co.uk/post/45758087071</feedburner:origLink></item><item><title>likeafieldmouse:

Sayaka Ganz - Emergence (2011) - Discarded...</title><description>&lt;img src="http://24.media.tumblr.com/25c58aead0cdf9444bfbfdcc72d96cc6/tumblr_mjqgei9i8m1qe31lco2_r1_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://25.media.tumblr.com/47dad0ac0867fdfabf016b826b0ce30a/tumblr_mjqgei9i8m1qe31lco1_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://24.media.tumblr.com/325ff52aca84a5d74eeb09e86ed43b07/tumblr_mjqgei9i8m1qe31lco3_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://24.media.tumblr.com/5fa2546ba475b276cb9c0f907681e7af/tumblr_mjqgei9i8m1qe31lco5_r1_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://25.media.tumblr.com/beb450b5adcea5f341f7206db0fcf3dd/tumblr_mjqgei9i8m1qe31lco4_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;p&gt;&lt;a class="tumblr_blog" href="http://likeafieldmouse.com/post/45469039761/sayaka-ganz-emergence-2011-discarded-plastic" target="_blank"&gt;likeafieldmouse&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://www.sayakaganz.com/" target="_blank"&gt;Sayaka Ganz&lt;/a&gt; - &lt;em&gt;Emergence&lt;/em&gt; (2011) - Discarded plastic&lt;/p&gt;
&lt;/blockquote&gt;&lt;img src="http://feeds.feedburner.com/~r/29Steps/~4/aN3tubVIB94" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/29Steps/~3/aN3tubVIB94/45753216645</link><guid isPermaLink="false">http://blog.29steps.co.uk/post/45753216645</guid><pubDate>Tue, 19 Mar 2013 13:24:07 +0000</pubDate><feedburner:origLink>http://blog.29steps.co.uk/post/45753216645</feedburner:origLink></item><item><title>"I’m not gonna sit around and waste my precious divine energy trying to explain and be ashamed of..."</title><description>“I’m not gonna sit around and waste my precious divine energy trying to explain and be ashamed of things you think are wrong with me.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Esperanza Spalding (via &lt;a class="tumblr_blog" href="http://likeafieldmouse.com/" target="_blank"&gt;likeafieldmouse&lt;/a&gt;)&lt;/em&gt;&lt;img src="http://feeds.feedburner.com/~r/29Steps/~4/mwO7mAH4dX8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/29Steps/~3/mwO7mAH4dX8/45753206127</link><guid isPermaLink="false">http://blog.29steps.co.uk/post/45753206127</guid><pubDate>Tue, 19 Mar 2013 13:23:50 +0000</pubDate><feedburner:origLink>http://blog.29steps.co.uk/post/45753206127</feedburner:origLink></item><item><title>likeafieldmouse:

Lynda Benglis
</title><description>&lt;img src="http://25.media.tumblr.com/8d362967e786c4c3942ab177a1015b17/tumblr_mjuu9mLkhj1qe31lco1_r1_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://24.media.tumblr.com/dacfa4de69bc9b1f2708776b116d6272/tumblr_mjuu9mLkhj1qe31lco3_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://25.media.tumblr.com/6b61b3d8bf9290af3eeb5909ad337922/tumblr_mjuu9mLkhj1qe31lco4_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://25.media.tumblr.com/c11f1fc57728ec993bd1547025000600/tumblr_mjuu9mLkhj1qe31lco5_r1_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://25.media.tumblr.com/aa009c92737b5ee1000bf422088b2c5f/tumblr_mjuu9mLkhj1qe31lco2_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;p&gt;&lt;a class="tumblr_blog" href="http://likeafieldmouse.com/post/45675776108/lynda-benglis" target="_blank"&gt;likeafieldmouse&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://candypingpong.wordpress.com/2011/12/13/the-art-of-lynda-benglis/" target="_blank"&gt;Lynda Benglis&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;img src="http://feeds.feedburner.com/~r/29Steps/~4/_4P0WdLXxk8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/29Steps/~3/_4P0WdLXxk8/45752999862</link><guid isPermaLink="false">http://blog.29steps.co.uk/post/45752999862</guid><pubDate>Tue, 19 Mar 2013 13:18:11 +0000</pubDate><feedburner:origLink>http://blog.29steps.co.uk/post/45752999862</feedburner:origLink></item><item><title>robotcosmonaut:

宇宙怪獣ガメラ
via gurafiku


Back to the eighties...</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_le9qopJDqG1qaz1ado1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a class="tumblr_blog" href="http://robotcosmonaut.tumblr.com/post/45681582177/via-gurafiku" target="_blank"&gt;robotcosmonaut&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://www.imdb.com/title/tt0081675/" target="_blank"&gt;&lt;span class="st"&gt;宇宙怪獣ガメラ&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="st"&gt;via &lt;/span&gt;&lt;a class="tumblr_blog" href="http://gurafiku.tumblr.com/post/2545479548/japanese-movie-poster-super-monster-gamera-1980" target="_blank"&gt;gurafiku&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Back to the eighties again&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/29Steps/~4/K_TPeKy_6yk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/29Steps/~3/K_TPeKy_6yk/45752972180</link><guid isPermaLink="false">http://blog.29steps.co.uk/post/45752972180</guid><pubDate>Tue, 19 Mar 2013 13:17:27 +0000</pubDate><feedburner:origLink>http://blog.29steps.co.uk/post/45752972180</feedburner:origLink></item><item><title>Just completed phase 1 of safagrow.com to make it mobile...</title><description>&lt;img src="http://24.media.tumblr.com/6e2a32ed7442b6ec9974aaa3f435f747/tumblr_mjkdt7EfMR1rxv2kio1_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://25.media.tumblr.com/1c2d6452d9de5977c919bd58cbd2b546/tumblr_mjkdt7EfMR1rxv2kio2_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://24.media.tumblr.com/2bdfb87effc5e20971d2400485864220/tumblr_mjkdt7EfMR1rxv2kio3_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;p&gt;Just completed phase 1 of safagrow.com to make it mobile friendly or responsive. The home and blog sections are working and am working on the other sections of the site. Done using Zurb Foundation. Check it out on your mobile. &lt;a href="http://safagrow.com" target="_blank"&gt;safagrow.com&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/29Steps/~4/BMPTxqeZffo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/29Steps/~3/BMPTxqeZffo/45209155684</link><guid isPermaLink="false">http://blog.29steps.co.uk/post/45209155684</guid><pubDate>Tue, 12 Mar 2013 20:19:55 +0000</pubDate><category>responsive design</category><category>mobile</category><feedburner:origLink>http://blog.29steps.co.uk/post/45209155684</feedburner:origLink></item><item><title>Photo</title><description>&lt;img src="http://25.media.tumblr.com/aa7c5feb03f6b9b2914ca479d1ba963a/tumblr_mjb8q3QO751rxv2kio1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/29Steps/~4/udJmHbU-ozQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/29Steps/~3/udJmHbU-ozQ/44808253376</link><guid isPermaLink="false">http://blog.29steps.co.uk/post/44808253376</guid><pubDate>Thu, 07 Mar 2013 21:51:39 +0000</pubDate><feedburner:origLink>http://blog.29steps.co.uk/post/44808253376</feedburner:origLink></item><item><title>More on SSL - some notes Feb 2013</title><description>&lt;p&gt;My previous post was platform specific and mentions some of the problems I encountered while using the Heroku PAAS using SSL. I aim to be more generic if possible and point out some of the pitfalls I made and to avoid.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Applying for your first SSL certificate&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Depending on which hosting provider you use, some providers can apply for a SSL certificate on your behalf while some require you to do the manual work.&lt;/p&gt;
&lt;p&gt;If you are using dedicated hosting such as Parallels with a plesk panel, they provide the private key and CSR request when you click on &lt;strong&gt;&amp;#8216;Add SSL Certificate&amp;#8217;&lt;/strong&gt; when you go to the specific domain.&lt;strong&gt; PLEASE USE THESE KEYS TO APPLY FOR YOUR CERTIFICATE. &lt;/strong&gt;I ignored it and had &amp;#8216;hours of turmoil&amp;#8217; trying to work out what the incompatibilities issues are! Some images are included below for reference.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/0950e1dcf6a2da36591738a7f207af64/tumblr_inline_miop4xVwNN1qz4rgp.jpg"/&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/4b8087d43f68b1b40c6ffa153f983170/tumblr_inline_miop5dt5ko1qz4rgp.jpg"/&gt;&lt;/p&gt;
&lt;p&gt;If you are using your own self generated key and CSR, it is also important to note that some &lt;strong&gt;CAs&lt;/strong&gt; require your CSR to be formatted in a certain way. For example, on RapidSSL, they require you &lt;strong&gt;NOT TO&lt;/strong&gt; add &lt;strong&gt;&amp;#8216;email&amp;#8217;, &amp;#8216;password&amp;#8217; and &amp;#8216;optional business&amp;#8217;&lt;/strong&gt; within your CSR request. Other CAs will have similar requirements so make sure you read the DOCS before going any further.&lt;/p&gt;
&lt;p&gt;Some CAs also require an additional level of confirmation before proceeding such as domain verification. This would normally involve sending the ssl email request to a special email address that begins with &amp;#8216;admin@mysite.com&amp;#8217; or &amp;#8216;administrator@mysite.com&amp;#8217;. Again make sure these email accounts exist before applying for the SSL certificate.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/29Steps/~4/bceh_urAfLI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/29Steps/~3/bceh_urAfLI/43815594214</link><guid isPermaLink="false">http://blog.29steps.co.uk/post/43815594214</guid><pubDate>Sat, 23 Feb 2013 17:43:02 +0000</pubDate><category>ssl</category><category>security</category><feedburner:origLink>http://blog.29steps.co.uk/post/43815594214</feedburner:origLink></item><item><title>Heroku SSL Endpoint + Rails 3.2</title><description>&lt;p&gt;I had the opportunity to deploy and use SSL on heroku and it has been a while since I had to do this. Heroku&amp;#8217;s SSL has now been moved to a dedicated endpoint which means all https traffic to your heroku app will be re-routed from the endpoint to &amp;lt;yourapp.herokuapp.com&amp;gt;&lt;/p&gt;
&lt;p&gt;After setting up and deploying the SSL certificates to heroku successfully, I realised i had to set a DNS CNAME entry for the SSL endpoint.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This raises an interesting problem: the Heroku application I am working on already has a CNAME record pointing to the heroku domain. If you change the CNAME setting to just the SSL endpoint then the entire app cannot be found.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The way I found to resolve this is as follows:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Within your DNS panel set an ALIAS to &amp;lt;yourapp.herokuapp.com&amp;gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Change the CNAME entries for &amp;lt;yourapp.herokuapp.com&amp;gt; to point to the ssl endpoint e.g. &amp;lt;ssl.herokuapp.com&amp;gt;. This can be found using the command &lt;strong&gt;heroku certs from the application directory&lt;/strong&gt;. If you have setup the certificates properly this will show you a table with the matching ssl endpoint and your app url.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Within your app make sure that config.force_ssl = true if you are using SSL for the entire app or create your own custom ssl filters inside application_controller.rb or otherwise.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;&lt;span&gt;If it all goes well you should see your site with a lock icon and your certificate details should be shown:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt="image" src="http://media.tumblr.com/23def0cbc1cfa740487491e5258207fc/tumblr_inline_mionu6HURC1qz4rgp.jpg"/&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;I bought the SSL certificate from Rapid SSL and it was processed within minutes and another half an hour to figure out how to setup and to implement SSL. There are some pitfalls to avoid when registering your SSL certificate for the first time and this will be highlighted in the next article from this.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I used to think that SSL is an &amp;#8216;addon&amp;#8217; and only required if you are doing ecommerce or storing some form of personal information. With the levels and frequency of hacking attempts made I think the initial investment is worthwhile for peace of mind for your data security and integrity. Even though SSL does not prevent or stop any hacking or hijacking attempts at your app or site at least it is a level of defense or barrier between you and the dangers out there rather than having none at all.&lt;/p&gt;
&lt;p&gt;For a more detailed discussion or article on why SSL is important check out this article on html5rocks:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.html5rocks.com/en/tutorials/security/transport-layer-security/" target="_blank"&gt;&lt;a href="http://www.html5rocks.com/en/tutorials/security/transport-layer-security/" target="_blank"&gt;http://www.html5rocks.com/en/tutorials/security/transport-layer-security/&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Below are links for setting up SSL on heroku:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devcenter.heroku.com/articles/ssl-endpoint" target="_blank"&gt;&lt;a href="https://devcenter.heroku.com/articles/ssl-endpoint" target="_blank"&gt;https://devcenter.heroku.com/articles/ssl-endpoint&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devcenter.heroku.com/articles/ssl-certificate" target="_blank"&gt;&lt;span&gt;&lt;a href="https://devcenter.heroku.com/articles/ssl-certificate" target="_blank"&gt;https://devcenter.heroku.com/articles/ssl-certificate&lt;/a&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devcenter.heroku.com/articles/ssl#customdomain-ssl" target="_blank"&gt;&lt;a href="https://devcenter.heroku.com/articles/ssl#customdomain-ssl" target="_blank"&gt;https://devcenter.heroku.com/articles/ssl#customdomain-ssl&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Please pay attention to &amp;#8216;Preparing your SSL certificate&amp;#8217; section as it requires merging your CA (Certificate Authority) intermediate cert with your issued certificate.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/29Steps/~4/dAHhH5jmujs" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/29Steps/~3/dAHhH5jmujs/43813723472</link><guid isPermaLink="false">http://blog.29steps.co.uk/post/43813723472</guid><pubDate>Sat, 23 Feb 2013 17:17:00 +0000</pubDate><category>rails 3.2</category><category>heroku ssl</category><feedburner:origLink>http://blog.29steps.co.uk/post/43813723472</feedburner:origLink></item><item><title>Postgresql Shared Memory error</title><description>&lt;p&gt;Ran into this interesting issue this morning while playing around with Rails 4.0. Normally postgresql would just run after running pg_ctl but this time it did not appear inside the process list. Upon checking the log file this is the error that was shown:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;FATAL:  could not create shared memory segment: Cannot allocate memory&lt;/p&gt;
&lt;p&gt;DETAIL:  Failed system call was shmget(key=5432001, size=3809280, 03600).&lt;/p&gt;
&lt;p&gt;HINT:  This error usually means that PostgreSQL&amp;#8217;s request for a shared memory segment exceeded available memory or swap space, or exceeded your kernel&amp;#8217;s SHMALL parameter.  You can either reduce the request size or reconfigure the kernel with larger SHMALL.  To reduce the request size (currently 3809280 bytes), reduce PostgreSQL&amp;#8217;s shared memory usage, perhaps by reducing shared_buffers or max_connections.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;What this means is that there is insufficient shared memory to start the postgresql process. in my case it was caused by running virtualbox in the background.&lt;/p&gt;
&lt;p&gt;What I did to solve the above was this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;sudo sysctl -w kern.sysv.shmall=65536&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The command increases the shared memory usage system wide and postgresql was able to run again. To make this appear after reboot you also need to do add this to /etc/sysctl.conf:&lt;/p&gt;
&lt;blockquote&gt;kern.sysv.shmall=65536&lt;/blockquote&gt;
&lt;p&gt;Works for me on OS X Lion&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/29Steps/~4/DE3ONf0jYv0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/29Steps/~3/DE3ONf0jYv0/40011160744</link><guid isPermaLink="false">http://blog.29steps.co.uk/post/40011160744</guid><pubDate>Tue, 08 Jan 2013 13:51:53 +0000</pubDate><category>postgresql</category><category>rails 4.0</category><feedburner:origLink>http://blog.29steps.co.uk/post/40011160744</feedburner:origLink></item><item><title>Yes! pre order for the Napalm Death special edition boxset from...</title><description>&lt;img src="http://24.media.tumblr.com/42c5c59edd3f9d6eefa8b5223f2b4d31/tumblr_mg7vvbYfwX1rxv2kio1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Yes! pre order for the Napalm Death special edition boxset from earache records arriving next monday!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/29Steps/~4/FW2wkUGlEzk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/29Steps/~3/FW2wkUGlEzk/39852782383</link><guid isPermaLink="false">http://blog.29steps.co.uk/post/39852782383</guid><pubDate>Sun, 06 Jan 2013 18:40:23 +0000</pubDate><category>napalm death</category><category>earache</category><category>special</category><category>boxset</category><feedburner:origLink>http://blog.29steps.co.uk/post/39852782383</feedburner:origLink></item><item><title>Catching up on the Minimum carnage series from Venom and Scarlet...</title><description>&lt;img src="http://24.media.tumblr.com/a2c16ed10be88b2b15dc2af8564616c4/tumblr_mg7vtbNZb41rxv2kio1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Catching up on the Minimum carnage series from Venom and Scarlet Spider. &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/29Steps/~4/As6pdScrj0s" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/29Steps/~3/As6pdScrj0s/39852682438</link><guid isPermaLink="false">http://blog.29steps.co.uk/post/39852682438</guid><pubDate>Sun, 06 Jan 2013 18:39:11 +0000</pubDate><category>marvel</category><category>comics</category><feedburner:origLink>http://blog.29steps.co.uk/post/39852682438</feedburner:origLink></item><item><title>The new Transformers Bruticus with metallic finish!</title><description>&lt;img src="http://25.media.tumblr.com/6fd3dd13a5d61426bd4a9f2f2d207897/tumblr_mg7vl2MP761rxv2kio1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;The new Transformers Bruticus with metallic finish!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/29Steps/~4/aPDLkwipwFM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/29Steps/~3/aPDLkwipwFM/39852288407</link><guid isPermaLink="false">http://blog.29steps.co.uk/post/39852288407</guid><pubDate>Sun, 06 Jan 2013 18:34:14 +0000</pubDate><category>transformers</category><category>bruticus</category><feedburner:origLink>http://blog.29steps.co.uk/post/39852288407</feedburner:origLink></item><item><title>Respond.js and IE 8</title><description>&lt;p&gt;&lt;a href="https://github.com/scottjehl/Respond" target="_blank"&gt;Respond.js&lt;/a&gt; is an open source javascript library to handle media queries in a cross browser environment even supporting older versions of IE ( internet explorer ).&lt;/p&gt;
&lt;p&gt;In a recent woocommerce project I worked on, the theme used in production relies on respond.js to create a fluid layout for both browsers on desktops and mobile devices. The interesting &amp;#8216;bug&amp;#8217; I found when testing the website is that it either crashes IE 8 or IE 8 will report with a &lt;strong&gt;&amp;#8216;Invalid Argument&amp;#8217; &lt;/strong&gt;and it only seems to occur within pages that list all the products e.g. Shop; All Category A products etc&lt;/p&gt;
&lt;p&gt;After much trial and error, I discovered that it was not a fault of respond.js but the limitation of IE 8. Since respond.js adds a new inline style to each element on a page; if you have say 100 products to show, respond.js adds 100 styles for each of the products hence overloading IE which causes it to throw the error above. In my case there was a custom function which overrides the default number of products returned by woocommerce. Removing that function fixes the problem for me in IE 8&lt;/p&gt;
&lt;p&gt;If you are using woocommerce and have similar problems try these approaches to debug the issue:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Check your functions.php file in the parent theme or if you are using a child theme, make sure there is nothing in there that might be causing the issue. If necessary, uncomment and test each one.&lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Check to make sure that you have the &lt;a href="https://github.com/scottjehl/Respond" target="_blank"&gt;latest version of respond.js&lt;/a&gt;. Current version is 1.1.0. &lt;a href="https://github.com/scottjehl/Respond" target="_blank"&gt;Download&lt;/a&gt; the latest version from github if needs be.&lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;There is a mention of not using&lt;strong&gt; &amp;#8216;import&amp;#8217; statements&lt;/strong&gt; for css and issues with background images. I have not met such problems yet but a search through the issues pages on the github repo for respond.js might reveal work throughs for these problems. In my case it was too many products being listed at once.&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/29Steps/~4/QwZ5_mZDTac" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/29Steps/~3/QwZ5_mZDTac/39851919321</link><guid isPermaLink="false">http://blog.29steps.co.uk/post/39851919321</guid><pubDate>Sun, 06 Jan 2013 18:29:00 +0000</pubDate><category>woocommerce</category><category>respond.js</category><category>ie8</category><category>responsive design</category><category>internet explorer 8</category><feedburner:origLink>http://blog.29steps.co.uk/post/39851919321</feedburner:origLink></item><item><title>Photo</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_mce9kzRAQf1rxv2kio1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/29Steps/~4/tRMjYdu2vpo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/29Steps/~3/tRMjYdu2vpo/34225211036</link><guid isPermaLink="false">http://blog.29steps.co.uk/post/34225211036</guid><pubDate>Wed, 24 Oct 2012 12:07:47 +0100</pubDate><feedburner:origLink>http://blog.29steps.co.uk/post/34225211036</feedburner:origLink></item><item><title>Photo</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_mcdtaxn5I01qe31lco1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/29Steps/~4/x5bOPJ0Nq_E" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/29Steps/~3/x5bOPJ0Nq_E/34225141692</link><guid isPermaLink="false">http://blog.29steps.co.uk/post/34225141692</guid><pubDate>Wed, 24 Oct 2012 12:05:01 +0100</pubDate><feedburner:origLink>http://blog.29steps.co.uk/post/34225141692</feedburner:origLink></item><item><title>likeafieldmouse:

Sue Austin - Creating the Spectacle (2012)
As...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_mce2klU4xq1qe31lco1_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://25.media.tumblr.com/tumblr_mce2klU4xq1qe31lco2_r1_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://25.media.tumblr.com/tumblr_mce2klU4xq1qe31lco3_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://25.media.tumblr.com/tumblr_mce2klU4xq1qe31lco4_500.jpg"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;p&gt;&lt;a class="tumblr_blog" href="http://likeafieldmouse.tumblr.com/post/34221826412/sue-austin-creating-the-spectacle-2012-as" target="_blank"&gt;likeafieldmouse&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://www.susanaustin.co.uk/" target="_blank"&gt;Sue Austin&lt;/a&gt; - &lt;em&gt;Creating the Spectacle&lt;/em&gt; (2012)&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As part of the 2012 Cultural Olympiad, performance and installation artist Sue Austin created this series in which she—in her self-propelled underwater wheelchair—explored the magnificence of the underwater world, aiming to generate a widespread public debate about the nature and value of contemporary arts practice shaped by the experience of disability.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Artist’s statement: &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;“My studio practice has, for sometime, centred around finding ways to understand and represent my embodied experience as a wheelchair user, opening up profound issues about methods of self-representation and the power of self-narration in challenging the nexus of power and control that created the ‘disabled’ as other.”&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;img src="http://feeds.feedburner.com/~r/29Steps/~4/uhmNx9l2_dY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/29Steps/~3/uhmNx9l2_dY/34225115363</link><guid isPermaLink="false">http://blog.29steps.co.uk/post/34225115363</guid><pubDate>Wed, 24 Oct 2012 12:04:03 +0100</pubDate><feedburner:origLink>http://blog.29steps.co.uk/post/34225115363</feedburner:origLink></item></channel></rss>
