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

<channel>
	<title>YAB &#187; coding</title>
	<atom:link href="http://blog.alexgirard.com/tag/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.alexgirard.com</link>
	<description>Yet Another Blog</description>
	<pubDate>Sat, 15 Nov 2008 01:14:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>[Ruby] God monitor</title>
		<link>http://blog.alexgirard.com/ruby-god-monitor/</link>
		<comments>http://blog.alexgirard.com/ruby-god-monitor/#comments</comments>
		<pubDate>Mon, 10 Sep 2007 17:00:43 +0000</pubDate>
		<dc:creator>alx</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[coding]]></category>

		<category><![CDATA[gem]]></category>

		<category><![CDATA[god]]></category>

		<category><![CDATA[madrid]]></category>

		<category><![CDATA[monitor]]></category>

		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.alexgirard.com/2007/09/10/ruby-god-monitor/</guid>
		<description><![CDATA[Update: this script, from September 2007, is a bit out-dated, you can get more info on official God gem website.
Looking for a ruby programmer? Contact me
After many ways to monitor Feevy updaters, we&#8217;re finally using God gem today to manage everything with Ruby on many platforms.
Documentation is really clear, and it&#8217;s easy to adapt it [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update</strong>: this script, from September 2007, is a bit out-dated, you can get more info on <a href="http://god.rubyforge.org/">official God gem website</a>.</p>
<p><strong>Looking for a ruby programmer?</strong> <a href="mailto:alx.girard@gmail.com">Contact me</a></p>
<p>After many ways to monitor Feevy updaters, we&#8217;re finally using <a href="http://god.rubyforge.org/">God gem</a> today to manage everything with Ruby on many platforms.</p>
<p>Documentation is really clear, and it&#8217;s easy to adapt it to your own code. The nicest point was to be able to control our non-daemonized updaters, and monitor them all in the same tool.</p>
<p>Here is our script:</p>
<pre class="prettyprint">
require 'rubygems'
require 'god'

ROOT = File.dirname(__FILE__)

God.init do |god|
  god.pid_file_directory = "#{ROOT}/pids"
end

[*0...20].each do |updater|
  God.watch do |w|
    # watch with no pid_file attribute set
    w.name = "updater_#{updater}"
    w.interval = 30.seconds # default
    w.start = "ruby #{ROOT}/updater.rb"
    w.grace = 10.seconds

    w.behavior(:clean_pid_file)

    w.start_if do |start|
      start.condition(:process_running) do |c|
        c.interval = 5.seconds
        c.running = false
      end
    end

    w.restart_if do |restart|
      restart.condition(:memory_usage) do |c|
        c.above = 150.megabytes
        c.times = [3, 5] # 3 out of 5 intervals
      end

      restart.condition(:cpu_usage) do |c|
        c.above = 50.percent
        c.times = 5
      end
    end
  end
end
</pre>
<p>[updated]: thanks to apeiros on irc://#ruby@irc.freenode.net for quick array initialization tips!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexgirard.com/ruby-god-monitor/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rails 1.2: keep working with version 1.1.6</title>
		<link>http://blog.alexgirard.com/rails-12-installing-and-keep-working-with-version-116/</link>
		<comments>http://blog.alexgirard.com/rails-12-installing-and-keep-working-with-version-116/#comments</comments>
		<pubDate>Sat, 20 Jan 2007 15:29:38 +0000</pubDate>
		<dc:creator>alx</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[coding]]></category>

		<category><![CDATA[conflict]]></category>

		<category><![CDATA[developper]]></category>

		<category><![CDATA[environment]]></category>

		<category><![CDATA[installation]]></category>

		<category><![CDATA[installing]]></category>

		<category><![CDATA[migrating]]></category>

		<category><![CDATA[migration]]></category>

		<category><![CDATA[new]]></category>

		<category><![CDATA[rails]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[rubyonrails]]></category>

		<category><![CDATA[software]]></category>

		<category><![CDATA[version]]></category>

		<category><![CDATA[web]]></category>

		<category><![CDATA[web developpers]]></category>

		<guid isPermaLink="false">http://blog.alexgirard.com/?p=27</guid>
		<description><![CDATA[Two days ago, www.rubyonrails.com released the new version of rails, with lots of new cool stuff to play with.
And if your old projects are complaining after installing the new version, you just have to un-comment a simple line in your &#8220;config/environment.rb&#8221;:

  # Specifies gem version of Rails to use when vendor/rails is not present
 [...]]]></description>
			<content:encoded><![CDATA[<p>Two days ago, <a href='http://www.rubyonrails.com'>www.rubyonrails.com</a> released the new version of rails, with <a href="http://weblog.rubyonrails.org/2007/1/19/rails-1-2-rest-admiration-http-lovefest-and-utf-8-celebrations">lots of new cool stuff</a> to play with.</p>
<p>And if your old projects are complaining after installing the new version, you just have to un-comment a simple line in your <em>&#8220;config/environment.rb&#8221;</em>:</p>
<pre class="prettyprint">
  # Specifies gem version of Rails to use when vendor/rails is not present
  RAILS_GEM_VERSION = '1.1.6'
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexgirard.com/rails-12-installing-and-keep-working-with-version-116/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using RJS templates</title>
		<link>http://blog.alexgirard.com/using-rjs-templates/</link>
		<comments>http://blog.alexgirard.com/using-rjs-templates/#comments</comments>
		<pubDate>Thu, 04 Jan 2007 17:20:14 +0000</pubDate>
		<dc:creator>alx</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[coding]]></category>

		<category><![CDATA[css]]></category>

		<category><![CDATA[dom]]></category>

		<category><![CDATA[rails]]></category>

		<category><![CDATA[rjs]]></category>

		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://blog.alexgirard.com/?p=25</guid>
		<description><![CDATA[Ruby on Rails is a great platform to work with, there is so much niceties for geeks like me. Today has been a great day to work with RJS templates.
You must use RJS templates, just because when you don&#8217;t know where to put the view behavior after an action, and because filling a link_to_remote helper [...]]]></description>
			<content:encoded><![CDATA[<p>Ruby on Rails is a great platform to work with, there is so much niceties for geeks like me. Today has been a great day to work with RJS templates.<br/><br />
You must use RJS templates, just because when you don&#8217;t know where to put the view behavior after an action, and because filling a link_to_remote helper with too much parameters is really ugly.<br/></p>
<h3>Changing DOM className</h3>
<p>Because my application needs to display some dynamic user selection of an avatar, a great way has been to change the CSS className of the selected avatar.<br/><br />
Here is how to do it with RJS:</p>
<pre class="prettyprint">
page.select(".avatar").all() do |element, index|
  page.call 'Element.removeClassName', element, 'selected_avatar'
end

page.call 'Element.addClassName', @avatar, 'selected_avatar'
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexgirard.com/using-rjs-templates/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
