<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Social BookMaking!
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
var pageTracker = _gat._getTracker("UA-7083924-3");
pageTracker._trackPageview();
} catch(err) {}</description><title>Fair Web Entertainment</title><generator>Tumblr (3.0; @tomkiller44)</generator><link>http://blog.fairwebentertainment.com/</link><item><title>We Are Hiring!!!</title><description>&lt;p&gt;Hey folks, to keep pace with our fast development, we are looking for a &lt;b&gt;Software Architect Or Technical Manager&lt;/b&gt;. His/her objective is to design and ensure the compliance of our developments mainly based on Ruby on Rails technologies.&lt;/p&gt;

&lt;p&gt;Above all, our preferred candidate will be flexible and highly motivated to work for a young and innovative startup, in one of the fastest growing industries aka social gaming.&lt;/p&gt;

&lt;p&gt;You can download the complete job description &lt;a href="http://static.fairwebentertainment.com/Job%20offer%20-%20Technical%20Manager.pdf"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;See U&lt;/p&gt;</description><link>http://blog.fairwebentertainment.com/post/283353000</link><guid>http://blog.fairwebentertainment.com/post/283353000</guid><pubDate>Mon, 14 Dec 2009 17:46:04 +0100</pubDate><category>job</category></item><item><title>Rails 2+: Sanitize SQL string</title><description>&lt;p&gt;Indeed it is sometimes useful to sanitize a query to avoid (most of) SQL injections.
Typically, this is the case with your favorite text search field on a website.

Obvisouly, you can&amp;#8217;t do better than using the Rails standard way of querying, who automatically applies this mechanism. For instance:

&lt;pre style="font-size: 0.7em;"&gt;
&lt;code class="ruby"&gt;MyModel.find(:all,:conditions =&amp;gt; ['name LIKE ?','%'+params[:search]+'%'])&lt;/code&gt;&lt;/pre&gt;

But what if you want to create a fragment of a where clause?
This happens in few cases where you create complex queries in different parts of your code.
Well, if you&amp;#8217;re in a ActiveRecord model, you can directly call &lt;pre style="font-size: 0.7em;"&gt;
&lt;code class="ruby"&gt;sanitize_sql_for_conditions(['name LIKE ?','%'+params[:search]+'%'])&lt;/code&gt;&lt;/pre&gt; to output a sql sanitized string.
Easy.

But if you&amp;#8217;re in a controller or a custom library, you will surely fall on this
&lt;pre style="font-size: 0.7em;"&gt;
&lt;code class="ruby"&gt;NoMethodError: protected method `sanitize_sql_for_conditions' called for ActiveRecord::Base:Class&lt;/code&gt;&lt;/pre&gt;

Arrrgg!

Well, the answer is quite simple though. Just call the method right inside ActiveRecord:
&lt;pre style="font-size: 0.7em;"&gt;
&lt;code class="ruby"&gt;ActiveRecord::Base.send(:sanitize_sql_for_conditions,['name LIKE ?','%'+params[:search]+'%'])&lt;/code&gt;&lt;/pre&gt;

Hope it helps!&lt;/p&gt;</description><link>http://blog.fairwebentertainment.com/post/276240071</link><guid>http://blog.fairwebentertainment.com/post/276240071</guid><pubDate>Wed, 09 Dec 2009 17:15:22 +0100</pubDate><category>rails</category></item><item><title>"Française des jeux" privatized?</title><description>&lt;div style="float: left; margin: 10px;"&gt;&lt;img src="http://www.francaisedesjeux.com/img/logo_fdj.gif"/&gt;&lt;/div&gt;
&lt;p&gt;
The french ministry of economy thinks again of privatizing &amp;#8220;La Française des jeux&amp;#8221; (FDJ), according to &lt;a href="http://www.liberation.fr/economie/0101589219-bercy-lorgne-la-cagnotte-de-la-francaise-des-jeux"&gt;Liberation&lt;/a&gt;.&lt;br/&gt;&lt;/p&gt;
&lt;p&gt;
This is interesting considering that France is currently, under the pressure of EU, opening its gambling market (actually sport betting and poker) over the Internet &lt;b&gt;BUT&lt;/b&gt; ensuring the monopolistic position of the existing companies, namely FDJ and PMU.
&lt;br/&gt;
Indeed, they have already launched their own Internet betting products and they are over-advertising before the market opening&amp;#8230; cutting the grass under the feet of their future opponents.
&lt;/p&gt;
&lt;p&gt;
France ensures an exceptional position for the company and sells the goose that lays the golden egg&amp;#8230; who will this deal profit to?
&lt;/p&gt;
&lt;p&gt;
&lt;i&gt;
FDJ and PMU are big players of the french market with 9.2 billion € and 9.3 billion € gross gaming revenue in 2008; but only 220&amp;#160;M€ (2.3%) and 440&amp;#160;M€ (4.7%) over Internet.
&lt;/i&gt;
&lt;/p&gt;</description><link>http://blog.fairwebentertainment.com/post/183497282</link><guid>http://blog.fairwebentertainment.com/post/183497282</guid><pubDate>Wed, 09 Sep 2009 09:17:00 +0200</pubDate><category>france</category><category>betting industry</category></item><item><title>Facebook Connect and Rails: handling logout from Facebook site in Facebooker</title><description>&lt;p&gt;
Integrating an existing website with Facebook Connect using Facebooker is fairly easy. Several tutorial have been made; the best I found being:
&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.elevatedrails.com/articles/2009/01/02/announcing-facebooker-support-for-facebook-connect/"&gt;Mike Mangino&amp;#8217;s one&lt;/a&gt; (Mike is one of the Facebooker authors)&lt;br/&gt;Mike also released the book &lt;i&gt;Pragmatic Developing Facebook Platform Applications with Rails&lt;i&gt; at the marvelous &lt;a href="http://www.pragprog.com/"&gt;Pragmatic Booksheld&lt;/a&gt;. &lt;/i&gt;&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.madebymany.co.uk/tutorial-for-restful_authentication-on-rails-with-facebook-connect-in-15-minutes-00523"&gt;Integration with Restful_authentication&lt;/a&gt; by Made by Many&lt;/li&gt;
&lt;li&gt;french speaking people may prefer the &lt;a href="http://pepperonrails.com/2009/02/mettre-en-place-une-identification-via-facebook-connect/"&gt;one&lt;/a&gt; from PepperonRails&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;
However, there is no description on how to handle a frequent use case where the user has been authentified in your application using Facebook Connect and disconnects in the Facebook website.
&lt;/p&gt;
&lt;p&gt;
In this case, you will surely meet the famous:
&lt;/p&gt;&lt;blockquote&gt;Facebooker::Session::SessionExpired (Session	key invalid or no longer valid)&lt;/blockquote&gt;
One solution to handle this is &lt;b&gt;rescue_from&lt;/b&gt; introduced in Rails 2.0. This is also the method recommended in the &lt;a href="http://facebooker.rubyforge.org/"&gt;Facebooker documentation&lt;/a&gt;.

&lt;p&gt;
When the exception occurs, you have to &lt;b&gt;remove the facebook session informations &lt;u&gt;AND&lt;/u&gt; facebooker cookies&lt;/b&gt;.&lt;br/&gt;Indeed, the &lt;i&gt;set_facebook_session&lt;/i&gt; will recreate the &lt;i&gt;facebook_session&lt;/i&gt; with these cookies. If you do not remove them, you will loop again and again in your &lt;i&gt;rescue_from&lt;/i&gt; handling.
&lt;/p&gt;
&lt;p&gt;
Here is an example of what you can do:
&lt;/p&gt;&lt;pre style="font-size: 0.7em;"&gt;
&lt;code class="ruby"&gt;
class ApplicationController &amp;lt; ActionController::Base
...
  rescue_from Facebooker::Session::SessionExpired do |exception|
    clear_facebook_session_information
    clear_fb_cookies!
    reset_session # i.e. logout the user
    flash[:notice] = "You have been disconnected from Facebook."
    redirect_to root_url
  end
...
end
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;
Dead simple, huh?
&lt;/p&gt;</description><link>http://blog.fairwebentertainment.com/post/177853527</link><guid>http://blog.fairwebentertainment.com/post/177853527</guid><pubDate>Wed, 02 Sep 2009 12:17:00 +0200</pubDate><category>rails</category><category>facebooker</category><category>facebook connect</category></item><item><title>Send your bet idea to zukumu13@betcoffee.backpackit.com (put the description in the subject)</title><description>&lt;p&gt;We created a page on Backpack to record all crazy ideas of bets&amp;#8230; and there are many :)&lt;br/&gt;You can easily add your bet idea by email:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Put the bet description in the subject of the email.&lt;/li&gt;
&lt;li&gt;Send it to &lt;a href="mailto:zukumu13@betcoffee.backpackit.com"&gt;zukumu13@betcoffee.backpackit.com&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;That&amp;#8217;s all!&lt;/p&gt;
&lt;p&gt;All people sending bet ideas will be invited to the &lt;b&gt;private BETA&lt;/b&gt;, starting fall september (09 of course).&lt;/p&gt;</description><link>http://blog.fairwebentertainment.com/post/172844133</link><guid>http://blog.fairwebentertainment.com/post/172844133</guid><pubDate>Thu, 27 Aug 2009 10:47:00 +0200</pubDate><category>bet</category><category>private beta</category></item><item><title>Cleaning in progress</title><description>&lt;p&gt;Former office users currently taking their stuff.
We are cleaning:)&lt;/p&gt;</description><link>http://blog.fairwebentertainment.com/post/172105985</link><guid>http://blog.fairwebentertainment.com/post/172105985</guid><pubDate>Wed, 26 Aug 2009 15:14:00 +0200</pubDate><category>premises</category></item><item><title>After / before… Do you see any différence?</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_kozjc8wj6A1qzm0euo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;After / before… Do you see any différence?&lt;/p&gt;</description><link>http://blog.fairwebentertainment.com/post/172105154</link><guid>http://blog.fairwebentertainment.com/post/172105154</guid><pubDate>Wed, 26 Aug 2009 15:12:00 +0200</pubDate><category>premises</category></item><item><title>Olivier found his place.</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_koz4dfIAMK1qzm0euo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Olivier found his place.&lt;/p&gt;</description><link>http://blog.fairwebentertainment.com/post/171978206</link><guid>http://blog.fairwebentertainment.com/post/171978206</guid><pubDate>Wed, 26 Aug 2009 09:48:00 +0200</pubDate><category>premises</category></item><item><title>Our first office.
Stuff is not ours… and we’ll have...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_koz1ofBgBV1qzm0euo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Our first office.
Stuff is not ours… and we’ll have to clean a bit!&lt;/p&gt;</description><link>http://blog.fairwebentertainment.com/post/171949712</link><guid>http://blog.fairwebentertainment.com/post/171949712</guid><pubDate>Wed, 26 Aug 2009 08:50:00 +0200</pubDate><category>premises</category></item><item><title>First day in own offices, very excited!
Pictures will follow.</title><description>&lt;p&gt;First day in own offices, very excited!
Pictures will follow.&lt;/p&gt;</description><link>http://blog.fairwebentertainment.com/post/171910826</link><guid>http://blog.fairwebentertainment.com/post/171910826</guid><pubDate>Wed, 26 Aug 2009 07:42:00 +0200</pubDate><category>premises</category></item></channel></rss>

