<?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:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Tigraine</title>
	
	<link>http://www.tigraine.at</link>
	<description>Daniel Hoelbling talks about programming</description>
	<lastBuildDate>Wed, 09 Jan 2013 10:12:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Tigraine" /><feedburner:info uri="tigraine" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>46.656977</geo:lat><geo:long>14.326859</geo:long><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FTigraine" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FTigraine" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FTigraine" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/Tigraine" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FTigraine" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FTigraine" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FTigraine" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2FTigraine" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><item>
		<title>Amazon S3 uploads fail in numerous ways for no apparent reason</title>
		<link>http://feedproxy.google.com/~r/Tigraine/~3/R03YCJUhhZ0/</link>
		<comments>http://www.tigraine.at/2013/01/09/amazon-s3-uploads-fail-in-numerous-ways-for-no-apparent-reason/#comments</comments>
		<pubDate>Wed, 09 Jan 2013 10:12:36 +0000</pubDate>
		<dc:creator>Daniel Hölbling</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.tigraine.at/?p=1327</guid>
		<description><![CDATA[Today I spent almost 30 minutes trying to debug a problem where one of our Servers was not correctly synchronizing files to Amazon S3. First thing I tried was manually doing a s3cmd put of the files in question, and was immediately greeted by numerous connection reset by peer error messages. s3cmd is so smart, [...]]]></description>
			<content:encoded><![CDATA[<p>Today I spent almost 30 minutes trying to debug a problem where one of our Servers was not correctly synchronizing files to Amazon S3.</p>
<p>First thing I tried was manually doing a <code>s3cmd put</code> of the files in question, and was immediately greeted by numerous <code>connection reset by peer</code> error messages.<br />
s3cmd is so smart, it even automatically retries for 5 times while throttling the upload bandwith &#8211; still to no avail.<br />
When down to 5 kb/s upload speed I started getting <code>broken pipe</code> error messages.</p>
<p>Well, obviously our server has more than 5 kb/s uplink so I suspected someone broke something on the network level, but everything else was working fine.</p>
<p>The final clue then came when I was running `s3cmd ls` on my bucket where I finally got a meaningful error message: <code>the difference between the request time and the current time is too large</code>.<br />
Huh? Yes! Doing a <code>date</code> on the server revealed that the server was almost 20 minutes behind the current time, thus the SSL connection to S3 could not be established.</p>
<p>Turns out we had not enabled ntp and so the server clock kept drifting for a couple of months.<br />
The solution was straightforward: </p>
<pre>sudo ntpdate ntp.ubuntu.com
sudo apt-get install ntp</pre>
<p>The first does an immediate update (only installing ntp will take some time to sync the clock back up, so doing a manual update fixes your problem immediately), and then it installs ntp to prevent this from happening in the future.</p>
<img src="http://feeds.feedburner.com/~r/Tigraine/~4/R03YCJUhhZ0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.tigraine.at/2013/01/09/amazon-s3-uploads-fail-in-numerous-ways-for-no-apparent-reason/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.tigraine.at/2013/01/09/amazon-s3-uploads-fail-in-numerous-ways-for-no-apparent-reason/</feedburner:origLink></item>
		<item>
		<title>Installing Eclipse on Mac OSX</title>
		<link>http://feedproxy.google.com/~r/Tigraine/~3/0w2GTmQUFyA/</link>
		<comments>http://www.tigraine.at/2012/10/11/installing-eclipse-on-mac-osx/#comments</comments>
		<pubDate>Thu, 11 Oct 2012 07:26:15 +0000</pubDate>
		<dc:creator>Daniel Hölbling</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.tigraine.at/?p=1310</guid>
		<description><![CDATA[Most Mac applications come bundled as a .app package that you simply have to drag&#038;drop into your Applications for them to show up in Launchpad and Alfred. Or, if an application is a bit more complex you usually get a .dmg file that then installs like any normal MSI package you are used to from [...]]]></description>
			<content:encoded><![CDATA[<p>Most Mac applications come bundled as a <code>.app</code> package that you simply have to drag&#038;drop into your Applications for them to show up in Launchpad and Alfred.<br />
Or, if an application is a bit more complex you usually get a .dmg file that then installs like any normal MSI package you are used to from windows.</p>
<p>Not Eclipse for OSX. The Eclipse project maintainers do provide a OSX binary, but it doesn&#8217;t look like most OSX <code>.app</code> packages in that the extracted binaries are a folder that then contains a .app.</p>
<p>If you only copy over the .app file you&#8217;ll not be able to start Eclipse as it&#8217;s just a starter script and the real Eclipse is living in the extracted Zip. I used to just start eclipse wherever I unpacked it, but apparently the right way to install it is to simply copy the whole extracted eclipse folder over to your Applications.<br />
Even though the .app is not in /Applications directly OSX picks it up and it shows up in Launchpad.</p>
<img src="http://feeds.feedburner.com/~r/Tigraine/~4/0w2GTmQUFyA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.tigraine.at/2012/10/11/installing-eclipse-on-mac-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.tigraine.at/2012/10/11/installing-eclipse-on-mac-osx/</feedburner:origLink></item>
		<item>
		<title>When to use raw() and when to use .html_safe</title>
		<link>http://feedproxy.google.com/~r/Tigraine/~3/rfKxnUcj_ZQ/</link>
		<comments>http://www.tigraine.at/2012/08/23/when-to-use-raw-and-when-to-use-html_safe/#comments</comments>
		<pubDate>Thu, 23 Aug 2012 13:33:05 +0000</pubDate>
		<dc:creator>Daniel Hölbling</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.tigraine.at/?p=1300</guid>
		<description><![CDATA[What rails does very nicely is protect you from XSS attacks through aggressively HTML encoding anything you write between &#60;%= %&#62;. But there is one caveat: At times you may really want to render HTML from a string. So you need to tell rails not to escape your HTML in that case. There are two [...]]]></description>
			<content:encoded><![CDATA[<p>What rails does very nicely is protect you from XSS attacks through aggressively HTML encoding anything you write between <code>&lt;%= %&gt;</code>.<br />
But there is one caveat: At times you may really want to render HTML from a string. So you need to tell rails not to escape your HTML in that case.</p>
<p>There are two methods of telling rails that a string is safe and should not be escaped: <a href="http://apidock.com/rails/ActionView/Helpers/OutputSafetyHelper/raw">raw</a> and <a href="http://apidock.com/rails/String/html_safe">.htmlsafe</a></p>
<p>And both do the same. They mark the string as safe (through the use of the html safe buffer) and rails will not encode it any more. The main difference between the two: <strong>nil</strong>.</p>
<p>If you are doing things like: <code>"&lt;img src='#{..}' /&gt;".html_safe</code> .html_safe is totally fine as the string will never be <code>nil</code>, but if you are dealing with strings that may be nil .html_safe will break since there is no .html_safe method on the nil object. (For example if you are loading something from a config value or the database)<br />
In that case using <code>raw(...)</code> will just ignore the string instead of raising an exception.</p>
<p>As always with these things: raw and html_safe make it very easy to introduce XSS attack vectors into your application. So use them wisely and only on strings you are sure to be safe.</p>
<img src="http://feeds.feedburner.com/~r/Tigraine/~4/rfKxnUcj_ZQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.tigraine.at/2012/08/23/when-to-use-raw-and-when-to-use-html_safe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.tigraine.at/2012/08/23/when-to-use-raw-and-when-to-use-html_safe/</feedburner:origLink></item>
		<item>
		<title>How to expire all active Sessions in Rails 3</title>
		<link>http://feedproxy.google.com/~r/Tigraine/~3/o7O64Jty_E4/</link>
		<comments>http://www.tigraine.at/2012/08/03/how-to-expire-all-active-sessions-in-rails-3/#comments</comments>
		<pubDate>Fri, 03 Aug 2012 09:32:17 +0000</pubDate>
		<dc:creator>Daniel Hölbling</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.tigraine.at/?p=1280</guid>
		<description><![CDATA[I know this sounds like a very simple task to do, but since I just spent half an hour reading up on how Sessions in Rails work I decided it&#8217;s time to put this up so I can Google it again next time First off, you need to know how you are storing sessions in [...]]]></description>
			<content:encoded><![CDATA[<p>I know this sounds like a very simple task to do, but since I just spent half an hour reading up on how Sessions in Rails work I decided it&#8217;s time to put this up so I can Google it again next time <img src='http://www.tigraine.at/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>First off, you need to know how you are storing sessions in your application.<br />
Rails supports 3 types of session storage: Stored on Disk, in the Database or through Cookies in the client. You can check which one you are using in <code>/config/initializers/session_store.rb</code>.</p>
<h4>Cookie based session storage</h4>
<p>Rails 3 defaults to storing the session in the client using a session cookie. This means that the user_id along with all the data you put into the <code>session</code> hash is serialized into the cookie and sent to the client.<br />
It&#8217;s also not encrypted, only BASE64 encoded so if you are storing anything sensitive in there you are doing it wrong.</p>
<p>But for simple things like the current <code>user_id</code> the cookie based session store is just fine and also a lot faster than the alternatives.</p>
<p>Expiring the cookie though is a bit more involved since you can&#8217;t reach out to all clients and delete their cookies at once. But, and that&#8217;s the important part for what I was doing: This cookie is signed with a SHA-512 digest using a secret key that is only present on the server. So the cookie cannot be tampered with on the client, and this is also your avenue of attack when trying to expire all cookies:</p>
<p>Simply change the secret that is used to sign the cookies. All previous cookies are invalidated as their digest is no longer valid. </p>
<p>Doing so is simple, first generate a new secret using rake:</p>
<blockquote><p><code>$ rake secret<br />
10dfec4781b682762a731a5e88af78521fc3e0f...</code></p></blockquote>
<p>Then copy/paste that new secret into your <code>config/initializers/secret_token.rb</code>:</p>
<blockquote><p><code>MyApp::Application.config.secret_token = '10dfec4781b682762a731a5e88...'</code></p></blockquote>
<p>Once done deploy the application and all existing sessions are invalid at once.</p>
<h4>Database backed session storage</h4>
<p>If you are using the Database to store the session it&#8217;s rather trivial to expire all existing sessions using rake:</p>
<blockquote><p><code>rake db:sessions:clear</code></p></blockquote>
<h4>File based session storage</h4>
<p>Like with the database simply run the following rake command:</p>
<blockquote><p><code>rake tmp:sessions:clear</code></p></blockquote>
<p>Hope this helps.. </p>
<img src="http://feeds.feedburner.com/~r/Tigraine/~4/o7O64Jty_E4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.tigraine.at/2012/08/03/how-to-expire-all-active-sessions-in-rails-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.tigraine.at/2012/08/03/how-to-expire-all-active-sessions-in-rails-3/</feedburner:origLink></item>
		<item>
		<title>Optional locals in Rails partial templates</title>
		<link>http://feedproxy.google.com/~r/Tigraine/~3/tPNNV86EvCI/</link>
		<comments>http://www.tigraine.at/2012/07/11/optional-locals-in-rails-partial-templates/#comments</comments>
		<pubDate>Wed, 11 Jul 2012 21:33:07 +0000</pubDate>
		<dc:creator>Daniel Hölbling</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.tigraine.at/?p=1270</guid>
		<description><![CDATA[In Rails it is very advisable to not use any instance variables inside your partials if you want to re-use that partial in a different context. It is much better to simply leverage locals that you pass into your render like this: That way you can simply use posts inside the template without having to [...]]]></description>
			<content:encoded><![CDATA[<p>In Rails it is very advisable to not use any instance variables inside your partials if you want to re-use that partial in a different context.</p>
<p>It is much better to simply leverage locals that you pass into your render like this:</p>
<p><script src="https://gist.github.com/3090095.js?file=sample.rb"></script></p>
<p>That way you can simply use <code>posts</code> inside the template without having to rely on @posts coming from the controller (and it&#8217;s also not dependant on controller code any more but rather only on data inside the view that&#8217;s calling it.. very handy).</p>
<p>But, as always there are times when you have additional locals that are optional to only some contexts.<br />
In my case I had <a href="https://github.com/amatsuda/kaminari">Kaminari</a> paginate the list I was passing to the partial, but in some other views the list was not be paginated. Turns out you can&#8217;t do the usual rails style <code>if foo</code> here because the variable is simply not defined and Ruby will throw an error (unlike with @variables in Rails).</p>
<p>That&#8217;s where the defined? method comes in very handy (as suggested by Thorsten Ball):</p>
<p><script src="https://gist.github.com/3090095.js?file=paginate.html.erb"></script></p>
<p>If you simply want to assign a default value to a local you can use the ||= operator:</p>
<p><script src="https://gist.github.com/3090095.js?file=operator.rb"></script></p>
<p>This enables me to use the partial in several ways without having to re-introduce the locals at every corner:</p>
<p><script src="https://gist.github.com/3090095.js?file=after.html.erb"></script></p>
<img src="http://feeds.feedburner.com/~r/Tigraine/~4/tPNNV86EvCI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.tigraine.at/2012/07/11/optional-locals-in-rails-partial-templates/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.tigraine.at/2012/07/11/optional-locals-in-rails-partial-templates/</feedburner:origLink></item>
		<item>
		<title>Explicit path helpers with STI in Rails</title>
		<link>http://feedproxy.google.com/~r/Tigraine/~3/nlBrak8ufig/</link>
		<comments>http://www.tigraine.at/2012/06/25/explicit-path-helpers-with-sti-in-rails/#comments</comments>
		<pubDate>Mon, 25 Jun 2012 16:00:00 +0000</pubDate>
		<dc:creator>Daniel Hölbling</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.tigraine.at/?p=1257</guid>
		<description><![CDATA[I am currently working on an application that makes use of Single-Table-Inheritance (STI) for some of it&#8217;s models. STI in Rails is quite simple, you simply subclass a model and add the type column to your table like this: And the accompanying migration: Now that that&#8217;s out of the way, Rails url helpers will automagically [...]]]></description>
			<content:encoded><![CDATA[<p>I am currently working on an application that makes use of Single-Table-Inheritance (STI) for some of it&#8217;s models.</p>
<p>STI in Rails is quite simple, you simply subclass a model and add the <code>type</code> column to your table like this:</p>
<p><script src="https://gist.github.com/2988112.js?file=models.rb"></script></p>
<p>And the accompanying migration:<br />
<script src="https://gist.github.com/2988112.js?file=migration.rb"></script></p>
<p>Now that that&#8217;s out of the way, Rails url helpers will automagically use the right route depending on the class you feed to it&#8217;s helpers. Here&#8217;s an example:</p>
<p><script src="https://gist.github.com/2988112.js?file=gistfile1.rb"></script></p>
<p>You get the idea, rails helpers are smart about this. Only problem: How about the cases where you need an explicit helper like <code>edit_person_path</code>?</p>
<p>This is where it get&#8217;s tricky:</p>
<p><script src="https://gist.github.com/2988112.js?file=tricky.rb"></script></p>
<p>Using the explicit helper rails will not do any STI magic and simply return the path you asked for.<br />
What I really needed was for a helper that points to /persons/:id/edit in case it&#8217;s a Person record and to /students/:id/edit for students.<br />
After some digging (Rails STI isn&#8217;t really the hottest topic on Google it seems) I found the <code><a href="https://github.com/rails/rails/blob/537ede912895d421b24acfcbc86daf08f8f22157/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb#L134">polymorphic_path</a></code> method that does exactly this:</p>
<p><script src="https://gist.github.com/2988112.js?file=polymorphic.rb"></script></p>
<img src="http://feeds.feedburner.com/~r/Tigraine/~4/nlBrak8ufig" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.tigraine.at/2012/06/25/explicit-path-helpers-with-sti-in-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.tigraine.at/2012/06/25/explicit-path-helpers-with-sti-in-rails/</feedburner:origLink></item>
		<item>
		<title>Removing delete and destroy in Rails models</title>
		<link>http://feedproxy.google.com/~r/Tigraine/~3/d2w3kWG0zfk/</link>
		<comments>http://www.tigraine.at/2012/02/03/removing-delete-and-destroy-in-rails-models/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 00:02:43 +0000</pubDate>
		<dc:creator>Daniel Hölbling</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.tigraine.at/?p=1231</guid>
		<description><![CDATA[Today I had an interesting feature request to implement: Get rid of all deletions and replace them with a deleted flag in the DB. It&#8217;s the usual story: Nobody really does deletes but rather everything is put into the DB in case it&#8217;s needed at some later point. Unfortunately I didn&#8217;t know about this particular [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had an interesting feature request to implement: Get rid of all deletions and replace them with a <code>deleted</code> flag in the DB.</p>
<p>It&#8217;s the usual story: Nobody really does deletes but rather everything is put into the DB in case it&#8217;s needed at some later point. Unfortunately I didn&#8217;t know about this particular feature until after I had finished most of the coding for the Rails application so going through the code and removing all destroy code from controllers was pretty much out of the question.</p>
<p>Instead I remembered reading about Modules in Ruby and how they can bolt on functionality to Classes.</p>
<p>Turns out it&#8217;s totally trivial to remove deletion from Rails Models with 10 odd lines of code in a completely transparent an unobtrusive way:</p>
<pre class="ruby">module NotDeleteable
  def destroy
    unless self.respond_to? :deleted
      raise MissingMigrationException
    end

    self.update_attribute :deleted, true
  end

  def delete
    self.destroy
  end

  def self.included(base)
    base.class_eval do
      default_scope where( :deleted =&gt; false )
    end
  end
end

class MissingMigrationException &lt; Exception
  def message
    "Model is lacking the deleted boolean field for NotDeleteable to work"
  end
end</pre>
<p>This will override the default destroy/delete method provided by <code>ActiveRecord::Base</code> and also install a default_scope into the Model class so Rails will by default append <code>WHERE deleted = false</code> to all SQL queries made through the <a href="http://guides.rubyonrails.org/active_record_querying.html">ActiveRecord Query Interface</a></p>
<p>You use this by simply including this module inside your Model class:</p>
<pre class="ruby">class User &lt; ActiveRecord::Base
  include NotDeleteable
end</pre>
<p>Did I mention that I really like Ruby?</p>
<p>Word of warning:<br />
I have no clue if I am breaking <code>:dependant =&gt; :destroy</code> on ActiveRecord relations in any way, but I suspect it should still be alright.</p>
<p><strong>Update</strong>: The original code had an issue where you could not mark a record that is invalid as deleted. This was due to the fact that I was using <code>save</code> instead of <code>update_attribute.</code></p>
<img src="http://feeds.feedburner.com/~r/Tigraine/~4/d2w3kWG0zfk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.tigraine.at/2012/02/03/removing-delete-and-destroy-in-rails-models/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.tigraine.at/2012/02/03/removing-delete-and-destroy-in-rails-models/</feedburner:origLink></item>
		<item>
		<title>A word of advice on Bundler and Gems from git</title>
		<link>http://feedproxy.google.com/~r/Tigraine/~3/INBbKUg6U6s/</link>
		<comments>http://www.tigraine.at/2012/01/27/a-word-of-advice-on-bundler-and-gems-from-git/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 18:13:56 +0000</pubDate>
		<dc:creator>Daniel Hölbling</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.tigraine.at/?p=1224</guid>
		<description><![CDATA[At times (especially after Rails version upgrades) some Gems don&#8217;t work out of the box so I usually spend some time on GitHub looking through the network graph for a fork that fixes the issue. This works great and you usually end up with a well working plugin to continue working. Bundler supports this by [...]]]></description>
			<content:encoded><![CDATA[<p>At times (especially after Rails version upgrades) some Gems don&#8217;t work out of the box so I usually spend some time on GitHub looking through the <a href="https://github.com/blog/39-say-hello-to-the-network-graph-visualizer">network graph</a> for a fork that fixes the issue. </p>
<p>This works great and you usually end up with a well working plugin to continue working. Bundler supports this by loading the gem from the git source:</p>
<pre name="code" class="ruby">
gem 'rails', :git => 'https://github.com/rails/rails.git'
</pre>
<p>Only problem with this approach: Forks are usually a moving target in regards to their longevity. People tend to delete them once the pull request gets merged, or simply forget about them.</p>
<p>Neither is desirable and today it bit me for the first time, I had referenced a fork that got deleted but contained a important fix for my project on a gem that was not yet 3.1 ready. Fortunately the project has moved along and the master already included the fix (and didn&#8217;t introduce new issues). But it sure taught that I should always keep my own fork of code I decide to depend upon.</p>
<img src="http://feeds.feedburner.com/~r/Tigraine/~4/INBbKUg6U6s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.tigraine.at/2012/01/27/a-word-of-advice-on-bundler-and-gems-from-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.tigraine.at/2012/01/27/a-word-of-advice-on-bundler-and-gems-from-git/</feedburner:origLink></item>
		<item>
		<title>Make GNU screen xterm-256color work on OSX</title>
		<link>http://feedproxy.google.com/~r/Tigraine/~3/WDmVA7JiMKk/</link>
		<comments>http://www.tigraine.at/2012/01/25/make-gnu-screen-xterm-256color-work-on-osx/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 20:26:03 +0000</pubDate>
		<dc:creator>Daniel Hölbling</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.tigraine.at/?p=1218</guid>
		<description><![CDATA[I just ran into this and spend like 2 hours with Linux genius Jam trying to figure out why in the heck I could run Vim in 256 colors mode on my server while once I started screen it didn&#8217;t work any more. The issue was two fold. a) My local Terminal.app was reporting itself [...]]]></description>
			<content:encoded><![CDATA[<p>I just ran into this and spend like 2 hours with Linux genius Jam trying to figure out why in the heck I could run Vim in 256 colors mode on my server while once I started screen it didn&#8217;t work any more.</p>
<p>The issue was two fold. a) My local Terminal.app was reporting itself as xterm-color instead of xterm-256color. You have to update this setting in your Terminal app here:</p>
<p><img class="aligncenter size-full wp-image-1219" title="Einstellungen" src="http://www.tigraine.at/wp-content/uploads/2012/01/Einstellungen.png" alt="" width="571" height="83" /></p>
<p>&nbsp;</p>
<p>Once done you only need to edit your <code>.screenrc</code> to include the following 3 lines:</p>
<p>&nbsp;</p>
<pre name="code"># terminfo and termcap for nice 256 color terminal
# allow bold colors - necessary for some reason
attrcolor b ".I"
# tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
# erase background with current bg color
defbce "on"
# set TERM
term screen-256color-bce</pre>
<p>Problem is: Even if you set your .screenrc correctly, it won&#8217;t matter if your terminal is not reporting the correct version string in the first place.. </p>
<img src="http://feeds.feedburner.com/~r/Tigraine/~4/WDmVA7JiMKk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.tigraine.at/2012/01/25/make-gnu-screen-xterm-256color-work-on-osx/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.tigraine.at/2012/01/25/make-gnu-screen-xterm-256color-work-on-osx/</feedburner:origLink></item>
		<item>
		<title>New team member on dotless: Luke Page</title>
		<link>http://feedproxy.google.com/~r/Tigraine/~3/Dz-mtkCSJDQ/</link>
		<comments>http://www.tigraine.at/2011/12/12/new-team-member-on-dotless-luke-page/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 19:27:48 +0000</pubDate>
		<dc:creator>Daniel Hölbling</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[dotless]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.tigraine.at/?p=1197</guid>
		<description><![CDATA[You may have noticed that my blog is filling itself slowly with stuff about Ruby and Unix in general. This has to do with the fact that for now 3 months I am working on Rails full time with very little to no .NET work in between. While this is awesome for me and I [...]]]></description>
			<content:encoded><![CDATA[<p>You may have noticed that my blog is filling itself slowly with stuff about Ruby and Unix in general. This has to do with the fact that for now 3 months I am working on Rails full time with very little to no .NET work in between.</p>
<p>While this is awesome for me and I am really enjoying it &#8211; it also means that I don&#8217;t have a .NET dev environment available at work and quickly merging in a pull request and testing it has become quite a hassle. So dotless has had quite some open tickets that where already fixed but where not yet merged into the mainline due to me lagging behind on responding to pull requests.</p>
<p>Fortunately, most/all pull requests have come from our very active <a href="https://github.com/agatronic">Luke Page</a> who has been busily fixing bugs and contributing features &#8211; so adding him to the dotless core team is a logical choice to cut down on the lag I or James where inducing into the process.</p>
<p>Since James felt the same we are happy to announce that Luke Page is now part of the dotless team with commit access and everything. So, welcome onboard Luke! Thanks for being part of dotless <img src='http://www.tigraine.at/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/Tigraine/~4/Dz-mtkCSJDQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.tigraine.at/2011/12/12/new-team-member-on-dotless-luke-page/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.tigraine.at/2011/12/12/new-team-member-on-dotless-luke-page/</feedburner:origLink></item>
	</channel>
</rss>
