<?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>This is my tumblog, please read my real blog.

I make and invest in cool web products.Right now, I mess on Platform at Betable.

My latest webapp is SaveMyInbox.



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-8191454-3");
pageTracker._trackPageview();
} catch(err) {}</description><title>Stefano Bernardi</title><generator>Tumblr (3.0; @stefanobernardi)</generator><link>http://stefanobernardi.com/</link><item><title>Holy Philanthropy! Andreessen Horowitz GPs Pledge to Give Half of Their Income to Charity | PandoDaily</title><description>&lt;a href="http://pandodaily.com/2012/04/25/holy-philanthropy-andreessen-horowitz-gps-pledge-to-give-half-of-their-income-to-charity/"&gt;Holy Philanthropy! Andreessen Horowitz GPs Pledge to Give Half of Their Income to Charity | PandoDaily&lt;/a&gt;: &lt;p&gt;Wow.&lt;/p&gt;</description><link>http://stefanobernardi.com/post/21801395067</link><guid>http://stefanobernardi.com/post/21801395067</guid><pubDate>Wed, 25 Apr 2012 23:03:15 +0200</pubDate></item><item><title>French City Implements Virtual Currency to Avoid Financial Ruin</title><description>&lt;a href="http://mashable.com/2012/03/13/nantes-virtual-currency/"&gt;French City Implements Virtual Currency to Avoid Financial Ruin&lt;/a&gt;: &lt;p&gt;&lt;a href="http://mashable.com/2012/03/13/nantes-virtual-currency/" target="_blank"&gt;French City Implements Virtual Currency to Avoid Financial Ruin&lt;/a&gt; - rock on Nantes.&lt;/p&gt;</description><link>http://stefanobernardi.com/post/21684931371</link><guid>http://stefanobernardi.com/post/21684931371</guid><pubDate>Tue, 24 Apr 2012 02:56:40 +0200</pubDate></item><item><title>You can play tetris in the favicon. The world is finally complete.
http://favris.info/</title><description>&lt;p&gt;You can play tetris in the favicon. The world is finally complete.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://favris.info" title="Favris" target="_blank"&gt;&lt;a href="http://favris.info/" target="_blank"&gt;http://favris.info/&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://stefanobernardi.com/post/21446796209</link><guid>http://stefanobernardi.com/post/21446796209</guid><pubDate>Fri, 20 Apr 2012 21:32:28 +0200</pubDate></item><item><title>Virtual Goods Monetization Meetup - May 9th</title><description>&lt;a href="http://www.meetup.com/SFGameMonetization/events/61134132/"&gt;Virtual Goods Monetization Meetup - May 9th&lt;/a&gt;: &lt;p&gt;We just announced our next Betable meetup for May 9th.&lt;br/&gt;&lt;br/&gt;We’re going to have 3 extremely interesting talks on virtual goods and virtual currencies monetization.&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;YuChiang Cheng, Founder of &lt;a href="https://www.wgt.com" title="World Golf Tour" target="_blank"&gt;WGT&lt;/a&gt; - &lt;em&gt;“Leveraging Branded Virtual Goods”&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Josh Burns, Associate Director, Products at &lt;a href="http://6waves.com/" title="^ Waves" target="_blank"&gt;6Waves&lt;/a&gt; - &lt;em&gt;“Tactics for Maximizing Your Virtual Goods Revenue”&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Max Skibinsky, Founder of &lt;a href="http://www.playdom.com/" title="Paydom" target="_blank"&gt;Hive7&lt;/a&gt; (&lt;a href="http://venturebeat.com/2010/06/25/playdom-acquires-hive7-com-as-part-of-social-game-aquisition-spree/" title="Playdom - Hive7" target="_blank"&gt;Sold to Playdom&lt;/a&gt;) - &lt;em&gt;“The Color of Money”&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;You should definitely join us if you’re interested in game monetization, virtual currencies, food and beer!&lt;br/&gt;For RSVP and more info: &lt;a href="http://www.meetup.com/SFGameMonetization/events/61134132/" title="Maximize Your Virtual Goods Revenue" target="_blank"&gt;&lt;a href="http://www.meetup.com/SFGameMonetization/events/61134132/" target="_blank"&gt;http://www.meetup.com/SFGameMonetization/events/61134132/&lt;/a&gt;&lt;/a&gt; &lt;/p&gt;</description><link>http://stefanobernardi.com/post/21340508960</link><guid>http://stefanobernardi.com/post/21340508960</guid><pubDate>Wed, 18 Apr 2012 23:03:00 +0200</pubDate></item><item><title>NERO (Taken with instagram)</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_m2gj39fsbz1qa6v2go1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;NERO (Taken with &lt;a href="http://instagr.am" target="_blank"&gt;instagram&lt;/a&gt;)&lt;/p&gt;</description><link>http://stefanobernardi.com/post/21072341617</link><guid>http://stefanobernardi.com/post/21072341617</guid><pubDate>Sat, 14 Apr 2012 08:52:20 +0200</pubDate></item><item><title>BBQ Lunch in the office #betablerocks #joinus #code4food (Taken...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_m22pxh0OMB1qa6v2go1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;BBQ Lunch in the office #betablerocks #joinus #code4food (Taken with &lt;a href="http://instagr.am" target="_blank"&gt;instagram&lt;/a&gt;)&lt;/p&gt;</description><link>http://stefanobernardi.com/post/20605760771</link><guid>http://stefanobernardi.com/post/20605760771</guid><pubDate>Fri, 06 Apr 2012 21:53:40 +0200</pubDate><category>code4food</category><category>joinus</category><category>betablerocks</category></item><item><title>New @betable tshirts! (Taken with instagram)</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_m1cpd6476B1qa6v2go1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;New @betable tshirts! (Taken with &lt;a href="http://instagr.am" target="_blank"&gt;instagram&lt;/a&gt;)&lt;/p&gt;</description><link>http://stefanobernardi.com/post/19790399998</link><guid>http://stefanobernardi.com/post/19790399998</guid><pubDate>Fri, 23 Mar 2012 19:43:54 +0100</pubDate></item><item><title>The Geode</title><description>&lt;a href="http://www.kickstarter.com/projects/1404403369/geode-from-icache?ref=live"&gt;The Geode&lt;/a&gt;: &lt;p&gt;I hate it when people are smarter than me.&lt;br/&gt;Take all my money now.&lt;/p&gt;</description><link>http://stefanobernardi.com/post/19254215284</link><guid>http://stefanobernardi.com/post/19254215284</guid><pubDate>Tue, 13 Mar 2012 23:03:20 +0100</pubDate></item><item><title>Hilarious :)</title><description>&lt;iframe width="400" height="225" src="http://www.youtube.com/embed/R8vJgYQU_lY?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Hilarious :)&lt;/p&gt;</description><link>http://stefanobernardi.com/post/18813498285</link><guid>http://stefanobernardi.com/post/18813498285</guid><pubDate>Tue, 06 Mar 2012 00:21:12 +0100</pubDate></item><item><title>Download any SoundCloud song</title><description>&lt;a href="https://gist.github.com/1980967"&gt;Download any SoundCloud song&lt;/a&gt;: &lt;p&gt;pretty sweet bookmarklet that lets you download any song on Soundcloud. They will probably block this pretty soon.&lt;/p&gt;</description><link>http://stefanobernardi.com/post/18812580355</link><guid>http://stefanobernardi.com/post/18812580355</guid><pubDate>Tue, 06 Mar 2012 00:06:55 +0100</pubDate></item><item><title>How to send mail asynchronously with Sorcery and Delayed Job in Rails 3</title><description>&lt;p&gt;I&amp;#8217;m developing a Rails 3.2 app and being fed up with &lt;a href="https://github.com/plataformatec/devise" title="Devise" target="_blank"&gt;devise&lt;/a&gt;, I decided I&amp;#8217;d be switching to the awesome &lt;a href="https://github.com/NoamB/sorcery" title="Sorcery" target="_blank"&gt;sorcery&lt;/a&gt; gem for user authentication. Sorcery has a ton of features while staying minimal (you still have to write all your models, controllers and views) and that is just what I need. Those devise controllers where driving me mad.&lt;/p&gt;

&lt;p&gt;Anyways, after implementing it and testing the app, I noticed that every transaction was taking forever (5000-1000ms). That is because of the email delivery which is enclosed in a transaction (I have emails for activation, confirmation, reseting password and inviting other users).&lt;/p&gt;

&lt;p&gt;The solution is obviously to handle asynchronously the email sending with a queue and workers. I decided to go with &lt;a href="https://github.com/collectiveidea/delayed_job" title="Delayed Job" target="_blank"&gt;Delayed Job&lt;/a&gt; to keep everything on Active Record (&lt;a href="http://redis.io/" title="Redis" target="_blank"&gt;Redis&lt;/a&gt; and the &lt;a href="https://github.com/defunkt/resque" title="Resque" target="_blank"&gt;Resque&lt;/a&gt; gem rock quite a lot too).&lt;/p&gt;
&lt;p&gt;To use Delayed Job you usually have to call:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Object.delay.method(args)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can also call&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;handle_asynchronously :method_name&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;at the end of your controllers.&lt;/p&gt;
&lt;p&gt;This is all very cool, but with Rails 3 mailers DJ breaks and usually can&amp;#8217;t pick up parameters when using the handle_asynchronously method. Bummer.&lt;/p&gt;
&lt;p&gt;With Sorcery, the code to send the emails is actually in the gem so the only solution is to override the gem&amp;#8217;s methods to send the emails.&lt;/p&gt;
&lt;p&gt;There are two ways to do that:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Override the generic_send_mail method&lt;/li&gt;
&lt;li&gt;Override the single email sending methods&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;I went for option number 2 for the activation emails. In my user model:&lt;/p&gt;
&lt;blockquote&gt;

&lt;p&gt;  def send_activation_needed_email!&lt;/p&gt;
&lt;p&gt;    UserMailer.delay.activation_needed_email(self.id)&lt;/p&gt;
&lt;p&gt;  end&lt;/p&gt;

&lt;p&gt;  def send_activation_success_email!&lt;/p&gt;
&lt;p&gt;    UserMailer.delay.activation_success_email(self.id)&lt;/p&gt;
&lt;p&gt;  end&lt;/p&gt;

&lt;/blockquote&gt;

&lt;p&gt;This works fine but is not a viable approach for the password reset email, since its method initializes a bunch of stuff you shouldn&amp;#8217;t mess with.&lt;/p&gt;
&lt;p&gt;Then I realized that I overlooked the most clever way, and the simplest one.:&lt;/p&gt;
&lt;p&gt;Edit your &lt;strong&gt;config/initializers/sorcery.rb&lt;/strong&gt; file with the following:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;config.user_config do |user|&lt;/p&gt;
&lt;p&gt;  user.user_activation_mailer = YourMailerName.delay&lt;/p&gt;
&lt;p&gt;  user.reset_password_mailer = YourMailerName.delay&lt;/p&gt;
&lt;p&gt;end&lt;/p&gt;

&lt;/blockquote&gt;

&lt;p&gt;In this way we make sure that every email is sent to the delay method via DJ, and we don&amp;#8217;t have to worry about overriding Sorcery methods.&lt;br/&gt;The simplest solution is always right under our eyes, yet still difficult to see.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;</description><link>http://stefanobernardi.com/post/18403560471</link><guid>http://stefanobernardi.com/post/18403560471</guid><pubDate>Tue, 28 Feb 2012 00:39:54 +0100</pubDate><category>rails</category><category>sorcery</category><category>delayed_job</category><category>ruby</category></item><item><title>Node.js on Rails</title><description>&lt;a href="http://towerjs.org/"&gt;Node.js on Rails&lt;/a&gt;</description><link>http://stefanobernardi.com/post/18396083180</link><guid>http://stefanobernardi.com/post/18396083180</guid><pubDate>Mon, 27 Feb 2012 22:39:41 +0100</pubDate></item><item><title>A great idea executed awesomely - Newsle</title><description>&lt;p&gt;When I see certain products I think that making a startup is not that hard at all. Newsle makes it look really easy. Smart idea + great execution. How hard can it be, right?&lt;/p&gt;
&lt;p&gt;Wrong. Then I start watching all the hard decisions that have been made in order for the product to be where it is now and I go: &amp;#8220;wow&amp;#8221;.&lt;/p&gt;
&lt;p&gt;The idea is a very smart one: keep track of news that mention your friends. With the clutter and noise on Facebook and Twitter, this makes sure that you see the real news about each of your contacts so you can know what they&amp;#8217;re up to, congratulate them or just place it in the back of your head for future reference.&lt;/p&gt;
&lt;p&gt;The execution is awesome. In one month a lot has changed and now the product looks pretty sweet.&lt;/p&gt;
&lt;p&gt;They have a challenging time ahead, but kudos to them for being on the right track and solving a problem.&lt;/p&gt;
&lt;p&gt;&lt;img align="middle" alt="Newsle ScreenCapture" height="460" src="http://f.cl.ly/items/0L0z282I2p3u3a342I0k/Screen%20Shot%202012-02-22%20at%202.01.01%20PM.png" width="482"/&gt;&lt;/p&gt;</description><link>http://stefanobernardi.com/post/18090723805</link><guid>http://stefanobernardi.com/post/18090723805</guid><pubDate>Wed, 22 Feb 2012 23:11:06 +0100</pubDate><category>startups</category></item><item><title>This.</title><description>&lt;iframe width="400" height="300" src="http://www.youtube.com/embed/ld50mfW-BCM?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;This.&lt;/p&gt;</description><link>http://stefanobernardi.com/post/18086884573</link><guid>http://stefanobernardi.com/post/18086884573</guid><pubDate>Wed, 22 Feb 2012 22:07:44 +0100</pubDate><category>music</category></item><item><title>ACE - Sinatra for Node</title><description>&lt;a href="https://github.com/maccman/ace"&gt;ACE - Sinatra for Node&lt;/a&gt;: &lt;p&gt;AWESOME.&lt;/p&gt;</description><link>http://stefanobernardi.com/post/17645454758</link><guid>http://stefanobernardi.com/post/17645454758</guid><pubDate>Wed, 15 Feb 2012 06:14:48 +0100</pubDate></item><item><title>The Joy of Sinatra</title><description>&lt;p&gt;Sunday morning I woke up with a weird API idea, and decided to spend the morning building it.&lt;/p&gt;
&lt;p&gt;I unconsciously headed to &lt;a href="http://www.sinatrarb.com/" title="Sinatra" target="_blank"&gt;&lt;a href="http://www.sinatrarb.com" target="_blank"&gt;http://www.sinatrarb.com&lt;/a&gt;&lt;/a&gt; and 20 minutes later I had a complete API returning awesome JSON and performing a few operations in the backend.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s just amazing what you can achieve with Sinatra and the power of Rubygems:&lt;/p&gt;
&lt;script src="https://gist.github.com/1756903.js?file=app.rb"&gt;&lt;/script&gt;&lt;p&gt;The joy is in the simplicity, control, flexibility and power that Sinatra gives you, particularly coming from Rails where all the really cool stuff happens in the backend without you ever knowing nor understanding it.  Next step: plug in MongoDB, which stores all your data in JSON anyways. Next next step: get to understand Node.js and Express.js&lt;/p&gt;</description><link>http://stefanobernardi.com/post/17191393281</link><guid>http://stefanobernardi.com/post/17191393281</guid><pubDate>Tue, 07 Feb 2012 04:15:00 +0100</pubDate></item><item><title>Thanks to our #awesomeceo (Taken with instagram)</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_lygvgqeLi21qa6v2go1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Thanks to our #awesomeceo (Taken with &lt;a href="http://instagr.am" target="_blank"&gt;instagram&lt;/a&gt;)&lt;/p&gt;</description><link>http://stefanobernardi.com/post/16583370983</link><guid>http://stefanobernardi.com/post/16583370983</guid><pubDate>Fri, 27 Jan 2012 18:05:14 +0100</pubDate><category>awesomeceo</category></item><item><title>ISS 4000 Members. Yeah.</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_lyfg8pzOCT1qa6v2go1_400.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;ISS 4000 Members. Yeah.&lt;/p&gt;</description><link>http://stefanobernardi.com/post/16542267109</link><guid>http://stefanobernardi.com/post/16542267109</guid><pubDate>Thu, 26 Jan 2012 23:38:48 +0100</pubDate></item><item><title>‘Nduja and Champagne (Taken with instagram)</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_lxzdiyzoVO1qa6v2go1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;‘Nduja and Champagne (Taken with &lt;a href="http://instagr.am" target="_blank"&gt;instagram&lt;/a&gt;)&lt;/p&gt;</description><link>http://stefanobernardi.com/post/16052363735</link><guid>http://stefanobernardi.com/post/16052363735</guid><pubDate>Wed, 18 Jan 2012 07:18:33 +0100</pubDate></item><item><title>Video</title><description>&lt;iframe width="400" height="225" src="http://www.youtube.com/embed/n9NiDqTftao?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://stefanobernardi.com/post/13927736681</link><guid>http://stefanobernardi.com/post/13927736681</guid><pubDate>Thu, 08 Dec 2011 19:22:00 +0100</pubDate></item></channel></rss>

