<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Fabiano PS</title>
	<atom:link href="http://fabianosoriani.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://fabianosoriani.wordpress.com</link>
	<description>agile developer</description>
	<lastBuildDate>Sun, 12 May 2013 20:21:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='fabianosoriani.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Fabiano PS</title>
		<link>http://fabianosoriani.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://fabianosoriani.wordpress.com/osd.xml" title="Fabiano PS" />
	<atom:link rel='hub' href='http://fabianosoriani.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Loggly middleware for Express.js (server visibility)</title>
		<link>http://fabianosoriani.wordpress.com/2013/04/13/loggly-middleware-for-express-js-server-visibility/</link>
		<comments>http://fabianosoriani.wordpress.com/2013/04/13/loggly-middleware-for-express-js-server-visibility/#comments</comments>
		<pubDate>Sun, 14 Apr 2013 00:34:45 +0000</pubDate>
		<dc:creator>fabianosoriani</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Desenvolvimento]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[visibility]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[loggly]]></category>
		<category><![CDATA[middleware]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://fabianosoriani.wordpress.com/?p=551</guid>
		<description><![CDATA[Hi! Oh how long without posting, I&#8217;ve been missing it dearly, but in transition between jobs I was super busy, and now I can take the time to add some cool stuff =) Use Case I&#8217;ve been building an API, it is very cool, but the visibility for it is naturally low compared to websites. [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fabianosoriani.wordpress.com&#038;blog=3656200&#038;post=551&#038;subd=fabianosoriani&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hi!</p>
<p>Oh how long without posting, I&#8217;ve been missing it dearly, but in <a href="http://www.axiomzen.co/" target="_blank">transition between jobs</a> I was super busy, and now I can take the time to add some cool stuff =)</p>
<h3>Use Case</h3>
<p>I&#8217;ve been building an API, it is very cool, but the visibility for it is naturally low compared to websites. Loggly offer a great service for monitoring servers via a simple <a href="https://github.com/nodejitsu/node-loggly" target="_blank">API available in node.js</a>. While this API is cool, it is super broad and require some experimentation to implement an adequate visibility level.</p>
<p>Wouldn&#8217;t be amazing to be able to see every request that come in your server and how it respond? Utopic? Absolutely possible!</p>
<p style="text-align:center;"><a href="http://fabianosoriani.files.wordpress.com/2013/04/loggly-api.png"><img class="aligncenter  wp-image-552" alt="Loggly API" src="http://fabianosoriani.files.wordpress.com/2013/04/loggly-api.png?w=296&#038;h=299" width="296" height="299" /></a></p>
<h3 style="text-align:left;">Implementation</h3>
<p>This implementation has been heavily inspired by Connect <a href="https://github.com/senchalabs/connect/blob/master/lib/middleware/logger.js" target="_blank">logger middleware</a> &#8211; which is great.</p>
<p>I deeply recommend you to tune it for your visibility needs, though. Make good use: <a href="https://gist.github.com/flockonus/5380753" target="_blank"><strong>https://gist.github.com/flockonus/5380753</strong></a></p>
<pre class="brush: jscript; title: ; notranslate">
// suggested use:
app.configure(function() {
  app.set(&quot;port&quot;, process.env.PORT || 3005);
  app.use(logglyMiddleware);
  // ..
  app.use(express.bodyParser());
  app.use(app.router);
  // ..
});
</pre>
<h3>Notes worth taking</h3>
<ul>
<li>This snippet will show you information in your console when o development</li>
<li>The info sent might be too much in terms of size or frequency, make good use of customization for your needs</li>
<li>If you are dealing with a website, I advice you to not send every path hit, it is just too much</li>
</ul>
<p>Cheers!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fabianosoriani.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fabianosoriani.wordpress.com/551/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fabianosoriani.wordpress.com&#038;blog=3656200&#038;post=551&#038;subd=fabianosoriani&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fabianosoriani.wordpress.com/2013/04/13/loggly-middleware-for-express-js-server-visibility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/922c9fdc02ec0531cd152ca7cadb33bf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fabianosoriani</media:title>
		</media:content>

		<media:content url="http://fabianosoriani.files.wordpress.com/2013/04/loggly-api.png?w=296" medium="image">
			<media:title type="html">Loggly API</media:title>
		</media:content>
	</item>
		<item>
		<title>2012 Recap</title>
		<link>http://fabianosoriani.wordpress.com/2012/12/31/2012-recap/</link>
		<comments>http://fabianosoriani.wordpress.com/2012/12/31/2012-recap/#comments</comments>
		<pubDate>Tue, 01 Jan 2013 00:30:47 +0000</pubDate>
		<dc:creator>fabianosoriani</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[2012]]></category>
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://fabianosoriani.wordpress.com/2012/12/31/2012-recap/</guid>
		<description><![CDATA[2012Early this year.. I had a car, house all for myself on the weekends, a girlfriend, presence of family and friends, had maid once a week, a dog, cheap beer, worked with the tech I like the most and still was not nearly satisfied. In Canada I live in a small room sharing apartment, am [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fabianosoriani.wordpress.com&#038;blog=3656200&#038;post=544&#038;subd=fabianosoriani&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>2012<br />Early this year.. I had a car, house all for myself on the weekends, a girlfriend, presence of family and friends, had maid once a week, a dog, cheap beer, worked with the tech I like the most and still was not nearly satisfied.</p>
<p>In Canada I live in a small room sharing apartment, am experimenting in new job, have to study, cook and clean for myself, smaller number of friends, no actual family nearby.</p>
<p>To summarize: All I have done was with support of friends and family, I am useless by myself. I can also say for sure that I am growing despite all uncertainties. Back then I had too much in my mouth, after a big cleanup I can see better and crave for more!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fabianosoriani.wordpress.com/544/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fabianosoriani.wordpress.com/544/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fabianosoriani.wordpress.com&#038;blog=3656200&#038;post=544&#038;subd=fabianosoriani&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fabianosoriani.wordpress.com/2012/12/31/2012-recap/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/922c9fdc02ec0531cd152ca7cadb33bf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fabianosoriani</media:title>
		</media:content>
	</item>
		<item>
		<title>CarrierWave &#8211; limit file size (plus gif fix)</title>
		<link>http://fabianosoriani.wordpress.com/2012/11/10/carrierwave-limit-file-size-plus-gif-fix/</link>
		<comments>http://fabianosoriani.wordpress.com/2012/11/10/carrierwave-limit-file-size-plus-gif-fix/#comments</comments>
		<pubDate>Sat, 10 Nov 2012 20:06:58 +0000</pubDate>
		<dc:creator>fabianosoriani</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Desenvolvimento]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[carrierwave]]></category>
		<category><![CDATA[file upload]]></category>
		<category><![CDATA[limit size]]></category>
		<category><![CDATA[uploader]]></category>

		<guid isPermaLink="false">http://fabianosoriani.wordpress.com/?p=532</guid>
		<description><![CDATA[CarrierWave has an awesome abstraction API. It is simple, clear and extensible. But has some critical vulnerability specially when combined with image processing, such as, ImageMagick when resizing an image will consume exponencial memory size and any upload can easily make your process crash, when not processed safely. Also, it is not pretty good to [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fabianosoriani.wordpress.com&#038;blog=3656200&#038;post=532&#038;subd=fabianosoriani&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="https://github.com/jnicklas/carrierwave" target="_blank">CarrierWave</a> has an awesome abstraction API. It is simple, clear and extensible. But has some critical vulnerability specially when combined with <strong>image processing</strong>, such as, ImageMagick when resizing an image will consume exponencial <strong>memory size</strong> and any upload can easily make your process crash, when not processed safely. Also, it is not pretty good to combine <strong>.gif</strong> out of the box, because it makes a collection out of the file.</p>
<p><strong>Friendly advice beforehand;</strong> Using <a href="http://filepicker.io/" target="_blank">http://filepicker.io/</a> may be a way better idea if you are hosting in Heroku, just make sure if fits your constraints before get hard work done.</p>
<h3>Solution Spec</h3>
<h4>Hard limit file size of the request, so the process don&#8217;t block for too long, and don&#8217;t blow memory!</h4>
<p>If you behind a server such as <strong>Apache or Nginx</strong>, you can impose a limit to the request size, and you should!</p>
<p>Unless you are in Heroku, and afaik, there is no way to do that, at least just yet. So yes, this can be a major security breach for Rails apps on Heroku.</p>
<h4>Given a successful upload, pre-validate size.</h4>
<p>The &#8216;official&#8217; solution attempt to <strong>validate the size after</strong> the file have been processed. It doesn&#8217;t help, since when processing an image rather large (6Mb image consumed 2GB memory in my case) your process will be killed! Letting your website down for some time, and letting your users down as well.</p>
<h4>For gifs, take only the first image (less memory consumption too)</h4>
<p>When processing .gifs it seems to make a vertical frameset will all the images in the sequence, so it looks like a movie roll, which is not what most people want. Lets just extract the first frame.</p>
<p>Interestingly enough, I found that the processor is invoked for all frames in the .gif. (<a href="https://github.com/cldwalker/debugger" target="_blank">thanks debugger</a>!)</p>
<h3>Solution code</h3>
<p>This code takes care the mentioned specs (except for the request size limit), and I think the great advantage is that it avoids opening a file as Image if it fails the size constraint. As well as being very efficient with gifs (only acting on the first frame).<br />
It works on Heroku, with integration for S3, and should work on Amazon Cloud and other VPS.</p>
<p>The shortcome is about handling the exception which is a bit messy involving controller-side logic in a non-automated AR fashion.</p>
<p><strong>Controller</strong></p>
<pre class="brush: ruby; title: ; notranslate">
  def create
    begin
    @post = Post.new(params[:post])
    rescue Exception =&gt; e
      if e.message == 'too large'
        redirect_to news_path(err: 'file')
      else
        raise e
      end
    end
   #...
</pre>
<p><strong>uploader</strong></p>
<pre class="brush: ruby; title: ; notranslate">
# encoding: utf-8


class NewsUploader &lt; CarrierWave::Uploader::Base

  include CarrierWave::RMagick

  include Sprockets::Helpers::RailsHelper
  include Sprockets::Helpers::IsolatedHelper


  def store_dir
    &quot;uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}&quot;
  end

  def pre_limit file
    #require 'debugger'; debugger
    if file &amp;&amp; file.size &gt; 5.megabytes
      raise Exception.new(&quot;too large&quot;)
    end
    true
  end

  def only_first_frame
    manipulate! do |img|

      if img.mime_type.match /gif/
        if img.scene == 0
          img = img.cur_image #Magick::ImageList.new( img.base_filename )[0]
        else
          img = nil # avoid concat all frames
        end
      end
      img
    end
  end

  version :large, if: :pre_limit do
    process <img src='http://s1.wp.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> nly_first_frame
    process :convert =&gt; 'jpg'
    process :resize_to_limit =&gt; [1280, 1024]
  end

  # Create different versions of your uploaded files:
  version :small, if: :pre_limit do
    process <img src='http://s1.wp.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> nly_first_frame
    process :convert =&gt; 'jpg'
    process :resize_to_limit =&gt; [360, 360]
  end


  # For images you might use something like this:
  def extension_white_list
    %w(jpg jpeg gif png)
  end

end
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fabianosoriani.wordpress.com/532/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fabianosoriani.wordpress.com/532/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fabianosoriani.wordpress.com&#038;blog=3656200&#038;post=532&#038;subd=fabianosoriani&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fabianosoriani.wordpress.com/2012/11/10/carrierwave-limit-file-size-plus-gif-fix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/922c9fdc02ec0531cd152ca7cadb33bf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fabianosoriani</media:title>
		</media:content>
	</item>
		<item>
		<title>Plenty of Fish &#8211; Lessons Learned</title>
		<link>http://fabianosoriani.wordpress.com/2012/10/24/plenty-of-fish-lessons-learned/</link>
		<comments>http://fabianosoriani.wordpress.com/2012/10/24/plenty-of-fish-lessons-learned/#comments</comments>
		<pubDate>Wed, 24 Oct 2012 07:15:56 +0000</pubDate>
		<dc:creator>fabianosoriani</dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[startup]]></category>

		<guid isPermaLink="false">http://fabianosoriani.wordpress.com/?p=530</guid>
		<description><![CDATA[Just amazing talk! With founder Markus Frind a guy who made a dating website because he wanted to improve his CV with some .net experience. His website, Plenty of Fish went viral when the term wasn&#8217;t even appropriate for it yet! With over 200 signups a day, and millions of users in his database with all [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fabianosoriani.wordpress.com&#038;blog=3656200&#038;post=530&#038;subd=fabianosoriani&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.meetup.com/Vancouver-Tech-Co-Founders/events/84294742/" target="_blank">Just amazing talk</a>! With founder Markus Frind a guy who made a dating website because he wanted to improve his CV with some .net experience. His website, Plenty of Fish went viral when the term wasn&#8217;t even appropriate for it yet! With over 200 signups a day, and millions of users in his database with all sort of breakdown information he is the solo owner in <a href="http://www.pof.com/" target="_blank">POF.com</a></p>
<p>His talk was mesmerizing and often funny as how casually he mentioned amazing achievements. At early stage, with such a low competition and network effect his product was so succesfull it wasn&#8217;t even funny.</p>
<p>Some highlights and inferences from his talk:</p>
<ul>
<li>He never made a market research. He was the right man, at the right time, with the right attitude &#8211; trying to create a cool dynamic website.</li>
<li>Scaling was a huge barrier back then. Servers ran in his house, much like Facebook stories. Doesn&#8217;t existe anymore nowadays.</li>
<li>It is a prominent time for &#8220;growth hackers&#8221;. They are hiring phds from all industries with super developed skills in statistics and complex problem solving &#8211; cancer researchers, astro physicists (I can&#8217;t get my mind around that. Why not young people?)</li>
<li>Much more focus on retention than acquisition, probably due network effect and the nature of their service.</li>
<li>Always focusing on experimentation, throughout deploying and measuring. The man have a deep scientific soul. He admits not to use his own system but have put tons of effort into analyzing the metrics and the impact of the features.</li>
<li>Plan usually 1 month ahead, due how unpredictable changes take place feels like a waste to think too far ahead.</li>
<li>His advice: Just push it out of the door, don&#8217;t be afraid to crash at small percentage of your users, besides, if the service is good enough not much can make them just flee (apply with discretion, obviously)</li>
<li>8 out of 10 feature implementations fail miserably. 1 achieves low results, 1 kind of make it well.</li>
<li>Even when entering other countries he admitted never to research culture, just experiment with development.</li>
<li>Operations efficiency is allegedly their competitive advantage, as he mention to use a infinite smaller amount of servers than competitors.</li>
<li>In one year period they&#8217;ve seen their traffic shift from +90% web to 70% mobile app. A trend that have taken Japan a couple of years ago.</li>
<li>Their strategy still focus broadening and developing the market, while mostly ignoring competition.</li>
<li>Still experimenting exponential growth. He says he doesn&#8217;t care for selling, in the end the money will go to himself as solo proprietor.</li>
<li>Somebody asked him if he would work with anything else, he said: &#8220;After his job working with anything else would be like watch grass growing&#8221;</li>
</ul>
<p>Very glad I attended, intriguing and  inspiring session.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fabianosoriani.wordpress.com/530/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fabianosoriani.wordpress.com/530/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fabianosoriani.wordpress.com&#038;blog=3656200&#038;post=530&#038;subd=fabianosoriani&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fabianosoriani.wordpress.com/2012/10/24/plenty-of-fish-lessons-learned/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/922c9fdc02ec0531cd152ca7cadb33bf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fabianosoriani</media:title>
		</media:content>
	</item>
		<item>
		<title>HR, the PR and competency of a company (naive approach)</title>
		<link>http://fabianosoriani.wordpress.com/2012/10/02/hr-the-pr-and-competency-of-a-company-naive-approach/</link>
		<comments>http://fabianosoriani.wordpress.com/2012/10/02/hr-the-pr-and-competency-of-a-company-naive-approach/#comments</comments>
		<pubDate>Tue, 02 Oct 2012 07:13:15 +0000</pubDate>
		<dc:creator>fabianosoriani</dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[hr]]></category>
		<category><![CDATA[excellence]]></category>
		<category><![CDATA[it]]></category>
		<category><![CDATA[recruiting]]></category>

		<guid isPermaLink="false">http://fabianosoriani.wordpress.com/?p=526</guid>
		<description><![CDATA[This article is wrote before I take my course in HR, it represents my vision of it as I have interacted with it (such as being recruited) HR is more often than not the deepest take people have in a company they wish to work in. All these participants will carry a profound impression of [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fabianosoriani.wordpress.com&#038;blog=3656200&#038;post=526&#038;subd=fabianosoriani&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><em>This article is wrote before I take my course in HR, it represents my vision of it as I have interacted with it (such as being recruited)</em></p>
<p>HR is more often than not the deepest take people have in a company they wish to work in.</p>
<p><strong>All these participants will carry a profound impression of the company. </strong>It is of extreme importance that HR realize this.</p>
<p>Those who are not called in are likely to carry a negative impression of the company due frustration. But it would be the recruiter minimal obligation to minimize the damage to PR and even maybe turn it into something positive!</p>
<p>Since the daily dynamics recruiters may forget the humans interactions taking place, and more often than not participants are discarded as non-fitting products. Without realizing, by selecting people based on simple text matching of skills and requirements are diminishing the importance of their own jobs.</p>
<p>Head software engineers that shape communities and influence the paths of technology development make lots of fun of clueless recruiters that don&#8217;t know what they are doing. <strong>The companies that they are recruiting for are mocked</strong>.</p>
<p>Not to say, that unless recruiters are in deep sync with both the <strong>technologies and products</strong> they are hiring people to develop / serve they cannot do a good job! Any correct screen would be sheer luck.</p>
<p>Bottom-line, HR shouldn&#8217;t be shallow recruiting somebody with skills x/y/z, must go through a deeper understanding and be as crafty as possible at the process. Much to learn from journalists in this sense.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fabianosoriani.wordpress.com/526/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fabianosoriani.wordpress.com/526/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fabianosoriani.wordpress.com&#038;blog=3656200&#038;post=526&#038;subd=fabianosoriani&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fabianosoriani.wordpress.com/2012/10/02/hr-the-pr-and-competency-of-a-company-naive-approach/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/922c9fdc02ec0531cd152ca7cadb33bf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fabianosoriani</media:title>
		</media:content>
	</item>
		<item>
		<title>Be able to communicate or failed to learn</title>
		<link>http://fabianosoriani.wordpress.com/2012/10/02/communicate-or-failed-to-learn/</link>
		<comments>http://fabianosoriani.wordpress.com/2012/10/02/communicate-or-failed-to-learn/#comments</comments>
		<pubDate>Tue, 02 Oct 2012 06:27:44 +0000</pubDate>
		<dc:creator>fabianosoriani</dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[pessoal]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[meta]]></category>

		<guid isPermaLink="false">http://fabianosoriani.wordpress.com/?p=524</guid>
		<description><![CDATA[Likewise Pics or it didn&#8217;t happen I will shift a bit the content of my posts as I am taking Project Management Diploma. Frequently interesting insights take place but I don&#8217;t write, so they endup dissolved (they are not entirely gone anyways). Subjects address interesting business topics such as TQM, Six Sigma, Accounting, Competitive Advantage, RH, Capacity [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fabianosoriani.wordpress.com&#038;blog=3656200&#038;post=524&#038;subd=fabianosoriani&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Likewise <a href="http://knowyourmeme.com/memes/pics-or-it-didnt-happen" target="_blank">Pics or it didn&#8217;t happen</a> I will shift a bit the content of my posts as I am taking Project Management Diploma.</p>
<p>Frequently interesting insights take place but I don&#8217;t write, so they endup dissolved (they are not entirely gone anyways).</p>
<p>Subjects address interesting business topics such as TQM, Six Sigma, Accounting, Competitive Advantage, RH, Capacity Decisions and such will be addressed in future posts.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fabianosoriani.wordpress.com/524/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fabianosoriani.wordpress.com/524/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fabianosoriani.wordpress.com&#038;blog=3656200&#038;post=524&#038;subd=fabianosoriani&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fabianosoriani.wordpress.com/2012/10/02/communicate-or-failed-to-learn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/922c9fdc02ec0531cd152ca7cadb33bf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fabianosoriani</media:title>
		</media:content>
	</item>
		<item>
		<title>Remove jQTouch + maps lag</title>
		<link>http://fabianosoriani.wordpress.com/2012/09/09/remove-jqtouch-maps-lag/</link>
		<comments>http://fabianosoriani.wordpress.com/2012/09/09/remove-jqtouch-maps-lag/#comments</comments>
		<pubDate>Sun, 09 Sep 2012 17:43:25 +0000</pubDate>
		<dc:creator>fabianosoriani</dc:creator>
				<category><![CDATA[jqtouch]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[phonegap]]></category>
		<category><![CDATA[technique]]></category>

		<guid isPermaLink="false">http://fabianosoriani.wordpress.com/?p=517</guid>
		<description><![CDATA[Hello! jQTouch still is a pretty good tool, with performance out-of-the box for old mobiles (being faster then jQMobile), but with some sharp edges. The problem I deal with in this post may come in a couple of factors, such as: When combined with Google Maps, there is an insane lag when panning (scrolling) the [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fabianosoriani.wordpress.com&#038;blog=3656200&#038;post=517&#038;subd=fabianosoriani&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hello!</p>
<p><a href="http://www.jqtouch.com/" target="_blank">jQTouch</a> still is a pretty good tool, with performance out-of-the box for old mobiles (being faster then jQMobile), but with some sharp edges.</p>
<p>The <strong>problem</strong> I deal with in this post may come in a couple of factors, such as:</p>
<ul>
<li>When combined with Google Maps, there is an insane lag when panning (scrolling) the map.</li>
<li>General scroll is slow.</li>
<li>Some components are slow, particularly when under CSS transition.</li>
</ul>
<p>At first I thought that either it had a bad interaction with Phonegap, or poor handling of events.</p>
<p>What I find happening that was pretty bad, and almost made me drop it&#8217;s use entirely is that it applied some CSS perspective to the body on the bundled apple.css</p>
<div id="attachment_518" class="wp-caption aligncenter" style="width: 310px"><a href="http://fabianosoriani.files.wordpress.com/2012/09/bad-transform.png"><img class="size-medium wp-image-518" title="bad transform" src="http://fabianosoriani.files.wordpress.com/2012/09/bad-transform.png?w=300&#038;h=78" alt="bad transform" width="300" height="78" /></a><p class="wp-caption-text">What a bad perspective..</p></div>
<p>This made the map feel laggy on the Desktop and incredibly bad on iOS!</p>
<p>So, as <strong>solution</strong>, you have at least 2 options:</p>
<p>1) Remove the property from the .css</p>
<p>2) After jQTouch has been initialized, run a function that remove  the 3D support flag, like so:</p>
<blockquote><p>$(&#8216;#jqt&#8217;).removeClass(&#8216;supports3d&#8217;)</p></blockquote>
<p><strong>Done!</strong> =)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fabianosoriani.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fabianosoriani.wordpress.com/517/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fabianosoriani.wordpress.com&#038;blog=3656200&#038;post=517&#038;subd=fabianosoriani&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fabianosoriani.wordpress.com/2012/09/09/remove-jqtouch-maps-lag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/922c9fdc02ec0531cd152ca7cadb33bf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fabianosoriani</media:title>
		</media:content>

		<media:content url="http://fabianosoriani.files.wordpress.com/2012/09/bad-transform.png?w=300" medium="image">
			<media:title type="html">bad transform</media:title>
		</media:content>
	</item>
		<item>
		<title>Posting a photo (as a business) to a Facebook Page via JavaScript SDK</title>
		<link>http://fabianosoriani.wordpress.com/2012/05/15/posting-a-photo-as-a-business-to-a-facebook-page-via-javascript-sdk/</link>
		<comments>http://fabianosoriani.wordpress.com/2012/05/15/posting-a-photo-as-a-business-to-a-facebook-page-via-javascript-sdk/#comments</comments>
		<pubDate>Tue, 15 May 2012 19:02:02 +0000</pubDate>
		<dc:creator>fabianosoriani</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Desenvolvimento]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[technique]]></category>
		<category><![CDATA[facebook javascript sdk]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[post]]></category>

		<guid isPermaLink="false">http://fabianosoriani.wordpress.com/?p=501</guid>
		<description><![CDATA[The Facebook Javascript SDK (API) is not so well documented, what makes not so logical to post to a page, using it. For that I am about to show, make sure your connect scope having at least: &#8220;manage_pages,publish_actions,publish_stream&#8221;. I am assuming you already succeeded providing login to the user; if this is not the case, [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fabianosoriani.wordpress.com&#038;blog=3656200&#038;post=501&#038;subd=fabianosoriani&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>The <a href="http://developers.facebook.com/docs/reference/javascript/" target="_blank">Facebook Javascript SDK</a> (API) is not so well documented, what makes not so logical to <a href="http://developers.facebook.com/docs/reference/api/page/" target="_blank">post to a page</a>, using it. For that I am about to show, make sure your connect <strong>scope</strong> having at least: <strong>&#8220;manage_pages,publish_actions,publish_stream&#8221;</strong>.</p>
<p>I am assuming you already succeeded providing login to the user; if this is not the case, <a href="http://developers.facebook.com/docs/reference/javascript/FB.login/" target="_blank">refer to the docs</a>.</p>
<p>We rely heavily on the <a href="http://developers.facebook.com/docs/reference/javascript/FB.api/" target="_blank">FB.api</a> method, the docs make a poorly job documenting, but is a starting point anyway. Also, notice the response is async.</p>
<p>Fetch all user pages (actually the first 5k), but only store the first as var <em>page</em> (this is just a sample)</p>
<pre class="brush: jscript; title: ; notranslate">
var page = null;
FB.api('/me/accounts', function(response) { console.log(response); page = response.data[0]; })
</pre>
<p>Now, we want to publish a <a href="http://developers.facebook.com/docs/reference/api/page/#feed">post to the page timeline</a>, the thing is, we are not posting as &#8216;me&#8217; anymore, <strong><em>we must post as the page</em></strong>, and it requires both the <em>id</em> and <em>access_token</em>!<br />
I will make a sample function for it, the response is the post id if it all went well, or an error.</p>
<pre class="brush: jscript; title: ; notranslate">
function postToPage(page, msg){
  FB.api('/'+page.id+'/feed', 'post', { message: msg, access_token: page.access_token },
    function(res) { console.log(res) }
  )
}
postToPage(page, 'hello fb-page world')
</pre>
<p>For last, posting a picture requre the <em>url</em> param, like so:</p>
<pre class="brush: jscript; title: ; notranslate">
function photoToPage(page, src, msg){
  FB.api('/'+page.id+'/photos', 'post', { url: src, message:msg, access_token: page.access_token },
    function(res) { console.log(res) }
  )
}
photoToPage(page, 'http://24.media.tumblr.com/tumblr_m1ttif5puW1qcrr0lo1_500.png', 'nyan art')
</pre>
<p>* Don&#8217;t try to run all functions in sequence, since the result comes asynchronously you wont have the var page set.</p>
<p>** kudos for <a href="http://stackoverflow.com/a/8195849/250019" target="_blank">Владимир Дворник answer on Stack Overflow</a> for the <em>url</em> param not documented in the <a href="http://developers.facebook.com/docs/reference/api/page/#photos" target="_blank">Page Graph API</a>.</p>
<p>*** <em>Security note</em>. The JavaScript SDK can be very unsafe in the case a hacker is able to inject JS code in your page (and even happens in Twitter all the time even though they have millions in funding) they may take advantage of all of the user&#8217;s permissions.</p>
<p>Done!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fabianosoriani.wordpress.com/501/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fabianosoriani.wordpress.com/501/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fabianosoriani.wordpress.com&#038;blog=3656200&#038;post=501&#038;subd=fabianosoriani&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fabianosoriani.wordpress.com/2012/05/15/posting-a-photo-as-a-business-to-a-facebook-page-via-javascript-sdk/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/922c9fdc02ec0531cd152ca7cadb33bf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fabianosoriani</media:title>
		</media:content>
	</item>
		<item>
		<title>ImageMagick on Joyent</title>
		<link>http://fabianosoriani.wordpress.com/2012/05/08/imagemagick-on-joyent/</link>
		<comments>http://fabianosoriani.wordpress.com/2012/05/08/imagemagick-on-joyent/#comments</comments>
		<pubDate>Tue, 08 May 2012 05:14:39 +0000</pubDate>
		<dc:creator>fabianosoriani</dc:creator>
				<category><![CDATA[Desenvolvimento]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[joyent]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://fabianosoriani.wordpress.com/?p=497</guid>
		<description><![CDATA[It is really simple: pkgin search ImageMagick # you will get some result like this: ImageMagick-6.6.6.5 Package for display and interactive manipulation of images p5-PerlMagick-6.6.6.5 Object-oriented Perl interface to ImageMagick php53-imagick-5.3.5.2.2.2 Provides a wrapper to the ImageMagick library ruby18-RMagick-2.13.1nb3 Ruby binding to ImageMagick ruby18-mini-magick-2.1 Ruby wrapper for ImageMagick command line ruby19-RMagick-2.13.1nb3 Ruby binding to ImageMagick [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fabianosoriani.wordpress.com&#038;blog=3656200&#038;post=497&#038;subd=fabianosoriani&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>It is really simple:</p>
<p><code><br />
pkgin search ImageMagick # you will  get some result like this:<br />
ImageMagick-6.6.6.5  Package for display and interactive manipulation of images<br />
p5-PerlMagick-6.6.6.5  Object-oriented Perl interface to ImageMagick<br />
php53-imagick-5.3.5.2.2.2  Provides a wrapper to the ImageMagick library<br />
ruby18-RMagick-2.13.1nb3  Ruby binding to ImageMagick<br />
ruby18-mini-magick-2.1  Ruby wrapper for ImageMagick command line<br />
ruby19-RMagick-2.13.1nb3  Ruby binding to ImageMagick<br />
ruby19-mini-magick-2.1  Ruby wrapper for ImageMagick command line<br />
</code></p>
<p>Now, install the latest version, today it is 6.6.6.5, so run:<br />
<code><br />
pkgin install ImageMagick-6.6.6.5<br />
</code></p>
<p>Done!</p>
<p>For the Node.js package &#8220;<a href="https://github.com/rsms/node-imagemagick" target="_blank">imagemagick</a>&#8221; at &#8220;0.1.2&#8243; works for my use cases, which are just resizes <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
If you are using other languages you may need the other packages as well.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fabianosoriani.wordpress.com/497/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fabianosoriani.wordpress.com/497/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fabianosoriani.wordpress.com&#038;blog=3656200&#038;post=497&#038;subd=fabianosoriani&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fabianosoriani.wordpress.com/2012/05/08/imagemagick-on-joyent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/922c9fdc02ec0531cd152ca7cadb33bf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fabianosoriani</media:title>
		</media:content>
	</item>
		<item>
		<title>Mongoose validate unique field (insensitive)</title>
		<link>http://fabianosoriani.wordpress.com/2012/03/22/mongoose-validate-unique-field-insensitive/</link>
		<comments>http://fabianosoriani.wordpress.com/2012/03/22/mongoose-validate-unique-field-insensitive/#comments</comments>
		<pubDate>Thu, 22 Mar 2012 03:34:11 +0000</pubDate>
		<dc:creator>fabianosoriani</dc:creator>
				<category><![CDATA[Desenvolvimento]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[technique]]></category>
		<category><![CDATA[mongodb]]></category>
		<category><![CDATA[mongoose]]></category>
		<category><![CDATA[nodejs]]></category>
		<category><![CDATA[unique]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://fabianosoriani.wordpress.com/?p=493</guid>
		<description><![CDATA[Making a validation function for Mongoose (Node.js &#8211; MongoDB ODM) that checks upon validation field. Then call it to a field (aka path): Recommend you organize all validations in a file for itself, or even a folder if grows too big. If you have a unique index set for the path you may just save [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fabianosoriani.wordpress.com&#038;blog=3656200&#038;post=493&#038;subd=fabianosoriani&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Making a validation function for <a href="http://mongoosejs.com/docs/validation.html" target="_blank">Mongoose</a> (Node.js &#8211; MongoDB ODM) that checks upon validation field.</p>
<pre class="brush: jscript; title: ; notranslate">
function uniqueFieldInsensitive ( modelName, field ){
	return function(val, cb){
		if( val &amp;amp;&amp;amp; val.length ){ // if string not empty/null
			
			var query = mongoose.models[modelName]
				.where( field, new RegExp('^'+val+'$', 'i') ) // lookup the collection for somthing that looks like this field 
			
			if( !this.isNew ){ // if update, make sure we are not colliding with itself
				query = query.where('_id').ne(this._id)
			}
			
			query.count(function(err,n){
				// false when validation fails
				cb( n &amp;lt; 1 )
			})
		} else { // raise error of unique if empty // may be confusing, but is rightful
			cb( false )
		}
	}
}
</pre>
<p>Then call it to a field (aka path):</p>
<pre class="brush: jscript; title: ; notranslate">
UserSchema.path('nick').validate( uniqueFieldInsensitive('User', 'nick' ), 'unique' )
</pre>
<p>Recommend you organize all validations in a file for itself, or even a folder if grows too big.</p>
<p>If you have a unique index set for the path you may just save it and check for the error raised; the thing is the format of the error.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fabianosoriani.wordpress.com/493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fabianosoriani.wordpress.com/493/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fabianosoriani.wordpress.com&#038;blog=3656200&#038;post=493&#038;subd=fabianosoriani&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fabianosoriani.wordpress.com/2012/03/22/mongoose-validate-unique-field-insensitive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/922c9fdc02ec0531cd152ca7cadb33bf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fabianosoriani</media:title>
		</media:content>
	</item>
	</channel>
</rss>
