<?xml version='1.0' encoding='utf-8' ?>
<feed xmlns='http://www.w3.org/2005/Atom'>
  <title type='text'>Misha Reyzlin</title>
  <generator uri='http://nestacms.com'>Nesta</generator>
  <id>tag:mishareyzlin.com,2009:/</id>
  <link href='http://mishareyzlin.com/articles.xml' rel='self' />
  <link href='http://mishareyzlin.com' rel='alternate' />
  <subtitle type='text'></subtitle>
  <updated>2011-10-30T00:00:00+00:00</updated>
  <author>
    <name>Misha Reyzlin</name>
    <uri>http://mishareyzlin.com</uri>
    <email>hello@mishareyzlin.com</email>
  </author>
  <entry>
    <title>Front-End Developer Salary in Israel, Survey.</title>
    <link href='http://mishareyzlin.com/notes/front-end-developer-israel-survey' rel='alternate' type='text/html' />
    <id>tag:mishareyzlin.com,2011-10-30:/notes/front-end-developer-israel-survey</id>
    <content type='html'>
      &lt;p&gt;Around four months ago I have chatted with a friend of mine about the current state of web development industry in Israel. Of course, as it is an important subject, we have also discussed the average salary offers we were both getting. (We are both front-end developers, that is HTML, CSS, JavaScript and all the surroundings, such as templating engines, web pages loading optimization, cross-browser quirks etc.) Well, two heads are good, but 50 heads are better.&lt;/p&gt;
      
      &lt;p&gt;So I have conducted a little survey with a short set of questions (I know it&amp;#8217;s not too comprehensive, but it was put together rather quick).&lt;/p&gt;
      
      &lt;p&gt;These are the questions that were asked:&lt;/p&gt;
      
      &lt;ol&gt;
      &lt;li&gt;Your current salary in New Israeli Shekel&lt;/li&gt;
      
      &lt;li&gt;Your hourly rate in USD for hour-based projects&lt;/li&gt;
      
      &lt;li&gt;Sex&lt;/li&gt;
      
      &lt;li&gt;Years of experience in the field (HTML, CSS and JavaScript)&lt;/li&gt;
      
      &lt;li&gt;Full years of age&lt;/li&gt;
      
      &lt;li&gt;Level of expertise in JavaScript&lt;/li&gt;
      &lt;/ol&gt;
      
      &lt;p&gt;I have put the level of expertise in JavaScript as a separate question, as from experience this is a rather important point that has significant impact on the final salary (this has proved to be true).&lt;/p&gt;
      
      &lt;p&gt;30 professionals have filled the form, the survey was anonymous, all answers were optional.&lt;/p&gt;
      
      &lt;p&gt;So, here&amp;#8217;s some of the information:&lt;/p&gt;
      &lt;div class='canvas' /&gt;&lt;div class='legend'&gt;
        &lt;p&gt;The white circles represent the developers who have participated in the survey.&lt;/p&gt;
        &lt;ul class='controls'&gt;
          &lt;li&gt;&lt;span class='first'&gt;Current Salary, in NIS&lt;/span&gt;&lt;/li&gt;
          &lt;li&gt;&lt;span class='second'&gt;Hourly rate, in USD&lt;/span&gt;&lt;/li&gt;
          &lt;li&gt;&lt;span class='third'&gt;Years of exprience&lt;/span&gt;&lt;/li&gt;
          &lt;li&gt;&lt;span class='fourth'&gt;Level of expertise in JavaScript&lt;/span&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;p&gt;Average age is 28.5, most of the applicants are male (only 2 female developers participated). Average salary is around 17500 NIS.&lt;/p&gt;
      
      &lt;p&gt;19% of the applicants are freelancers who don&amp;#8217;t have set monthly salary. 81% are employees.&lt;/p&gt;
      
      &lt;p&gt;All of the applicants have worked more than 2 years in the field: 42% have more than 5 years of experience. 19% have 3-4 years of exp. 14% have 4-5 years of exp. 6% have 2-3 years of exp.&lt;/p&gt;
      
      &lt;p&gt;As you may have guessed, more years of experience and the better expertise in JS results in the highest salary: the average salary among these who has more than 5 years of experience appears to be 21,800. Among these devs 70% have indicated their knowledge of JavaScript as &amp;#8220;professional&amp;#8221; (can build web application that will work fast and will be easy to maintain).&lt;/p&gt;
      
      &lt;p&gt;This is a bit dated already, well, the times they are a changin’. But in conclusion, if you know JS and you&amp;#8217;ve got about 5 years of experience you shouldn&amp;#8217;t ask for anything less than ₪22,000. One US Dollar costed 3.43 Israeli shekels at the time of writing, so 22,000 was about $6400 back then (don&amp;#8217;t forget that&amp;#8217;s before the taxes!).&lt;/p&gt;
      
      &lt;p&gt;The interactive graphic is built with excellent data-driven animation library &lt;a href='http://mbostock.github.com/d3/'&gt;d3.js&lt;/a&gt; and the source for the above can be found &lt;a href='http://mishareyzlin.com/mr/js/fed-salary-il.js'&gt;here&lt;/a&gt;.&lt;/p&gt;
    </content>
    <published>2011-10-30T00:00:00+00:00</published>
    <updated>2011-10-30T00:00:00+00:00</updated>
  </entry>
  <entry>
    <title>Fix HTML5 elements loaded with jQuery AJAX</title>
    <link href='http://mishareyzlin.com/notes/fix-html5-elements-loaded-jQuery-AJAX' rel='alternate' type='text/html' />
    <id>tag:mishareyzlin.com,2011-06-09:/notes/fix-html5-elements-loaded-jQuery-AJAX</id>
    <content type='html'>
      &lt;p&gt;If you are using HTML5 like all the cool kids do, you are probably using &lt;a href='http://html5shim.googlecode.com/svn/trunk/html5.js'&gt;the HTML5 shiv&lt;/a&gt; built by amazing &lt;a href='http://paulirish.com/2011/the-history-of-the-html5-shiv/'&gt;webdev community&lt;/a&gt; in order for new semantic elements, such as &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt; to be stylable in IE &amp;lt; 9.&lt;/p&gt;
      
      &lt;p&gt;This is great, but what if you generate your HTML5 content with JavaScript (getting your content using ajax for example)? Whenever you will be using innerHTML in order to apply that HTML to the page (jQuery uses innerHTML in its &lt;code&gt;.html()&lt;/code&gt; method, which is used in many-many other methods internally), your HTML5 elements will not be attached and styled properly. Meet &lt;a href='http://jdbartlett.github.com/innershiv/'&gt;Innershiv&lt;/a&gt;.&lt;/p&gt;
      
      &lt;p&gt;In &lt;a href='http://www,omami.ru'&gt;one of the recent projects&lt;/a&gt; I&amp;#8217;ve used jQuery and there was going a lot of asynchronous loading in different places on the same page, so I wanted to find a general way of filtering all incoming content. Well, it turns out that jQuery has a great convenience method with property that allows you to do just that. Here&amp;#8217;s the code I&amp;#8217;ve used in order to apply innershiv in IE &amp;lt; 9 (you have to call &lt;code&gt;$.ajaxSetup()&lt;/code&gt; before all of you AJAX code is run):&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;// if IE &amp;lt; 9, cure innerHTML for HTML5 elements in AJAX response&amp;#x000A;// for the reference regarding jscript versions see http://en.wikipedia.org/wiki/JavaScript#Versions&amp;#x000A;// at this point you have jQuery and innerShiv code loaded&amp;#x000A;/*@cc_on&amp;#x000A;  @if ( @_jscript_version &amp;lt; 9 ) &amp;#x000A;  $.ajaxSetup({&amp;#x000A;    dataFilter : function(data) {&amp;#x000A;      return innerShiv(data);&amp;#x000A;    }&amp;#x000A;  });&amp;#x000A;})&amp;#x000A;  @end&amp;#x000A;@*/&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;&lt;strong&gt;UPD.&lt;/strong&gt; As Matt Curtis points out in his &lt;a href='http://mishareyzlin.com/notes/fix-html5-elements-loaded-jQuery-AJAX#comment-347432129'&gt;comment&lt;/a&gt; in case you are fetching data of other type than HTML (such as JSON or XML) you will break this data by processing it with &lt;code&gt;innerShiv&lt;/code&gt; function. So you&amp;#8217;d better only process HTML, here the bits you&amp;#8217;d need to change for that:&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;dataFilter : function(data, type) {&amp;#x000A;  // if there is no type assume it&amp;#39;s html&amp;#x000A;  return ( type === &amp;#39;html&amp;#39; || !type ) ? innerShiv ( data ) : data;&amp;#x000A;}&lt;/code&gt;&lt;/pre&gt;
      
      &lt;h2 id='sources'&gt;Sources&lt;/h2&gt;
      
      &lt;ol&gt;
      &lt;li&gt;http://paulirish.com/2011/the-history-of-the-html5-shiv/&lt;/li&gt;
      
      &lt;li&gt;http://jdbartlett.github.com/innershiv/&lt;/li&gt;
      
      &lt;li&gt;http://api.jquery.com/jQuery.ajaxSetup/&lt;/li&gt;
      
      &lt;li&gt;http://en.wikipedia.org/wiki/JavaScript#Versions&lt;/li&gt;
      &lt;/ol&gt;
    </content>
    <published>2011-06-09T00:00:00+00:00</published>
    <updated>2011-06-09T00:00:00+00:00</updated>
  </entry>
  <entry>
    <title>Sort WordPress categories by the recency of their updates</title>
    <link href='http://mishareyzlin.com/notes/sorting-categories-by-post-dates' rel='alternate' type='text/html' />
    <id>tag:mishareyzlin.com,2011-04-20:/notes/sorting-categories-by-post-dates</id>
    <content type='html'>
      &lt;p&gt;One of our recent clients has a &lt;a href='http://www.omami.ru'&gt;nice blog&lt;/a&gt;, where homepage shows most recent post from each of the categories. This is done pretty simple in WordPress:&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;$categories = get_categories();&amp;#x000A;&amp;#x000A;foreach($categories as $category ) {&amp;#x000A;&amp;#x000A;  $post_args = array(&amp;#x000A;    &amp;#39;orderby&amp;#39; =&amp;gt; &amp;#39;post_date&amp;#39;,&amp;#x000A;    &amp;#39;order&amp;#39; =&amp;gt; &amp;#39;DESC&amp;#39;,&amp;#x000A;    &amp;#39;showposts&amp;#39; =&amp;gt; 1,&amp;#x000A;    &amp;#39;category__in&amp;#39; =&amp;gt; array($category-&amp;gt;term_id),&amp;#x000A;    &amp;#39;caller_get_posts&amp;#39;=&amp;gt;1&amp;#x000A;  );&amp;#x000A;&amp;#x000A;  query_posts( $post_args );&amp;#x000A;&amp;#x000A;  while ( have_posts() ) : the_post();&amp;#x000A;    # I have actual post&amp;#39;s code in a separate template&amp;#x000A;    get_template_part( &amp;#39;post&amp;#39; );&amp;#x000A;  endwhile;&amp;#x000A;}&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;But there also was an interesting requirement: categories have to be sorted by the time of update of latest posts. So that the lately updated category will always be shown first and so on. As I haven&amp;#8217;t found a way to create a custom sorting option to use with &lt;code&gt;get_categories&lt;/code&gt; (which accepts &lt;code&gt;orderby =&amp;gt; &lt;/code&gt; option, but is limited to the pre-defined parameters: id, name (default), slug, count, group) I hacked something to make it work as required.&lt;/p&gt;
      
      &lt;p&gt;So, the idea is the following: loop through categories, find the latest post in each on of them, store the date when this post was updated, sort categories by these dates and then output posts in the right order.&lt;/p&gt;
      
      &lt;p&gt;Here&amp;#8217;s the code I&amp;#8217;ve used to do that:&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;# Get all the categories&amp;#x000A;$categories = get_categories(array(&amp;#x000A;  &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;post&amp;#39;,&amp;#x000A;  &amp;#39;child_of&amp;#39; =&amp;gt; 0,&amp;#x000A;  &amp;#39;orderby&amp;#39; =&amp;gt; &amp;#39;name&amp;#39;,&amp;#x000A;  &amp;#39;order&amp;#39; =&amp;gt; &amp;#39;ASC&amp;#39;,&amp;#x000A;  &amp;#39;hide_empty&amp;#39; =&amp;gt; 1,&amp;#x000A;  &amp;#39;hierarchical&amp;#39; =&amp;gt; 1,&amp;#x000A;));&amp;#x000A;&amp;#x000A;# I store sorted categories array as a global, as I need to use it&amp;#x000A;# across different templates: to make a nav in header.php and to actually &amp;#x000A;# loop through the posts in index.php&amp;#x000A;$GLOBALS[&amp;#39;catsArray&amp;#39;] = array();&amp;#x000A;&amp;#x000A;# Loop through categories&amp;#x000A;foreach($categories as $category ) {&amp;#x000A;&amp;#x000A;  $post_args = array(&amp;#x000A;    &amp;#39;orderby&amp;#39; =&amp;gt; &amp;#39;post_date&amp;#39;,&amp;#x000A;    &amp;#39;order&amp;#39; =&amp;gt; &amp;#39;DESC&amp;#39;,&amp;#x000A;    &amp;#39;showposts&amp;#39; =&amp;gt; 1,&amp;#x000A;    &amp;#39;category__in&amp;#39; =&amp;gt; array($category-&amp;gt;term_id),&amp;#x000A;    &amp;#39;caller_get_posts&amp;#39;=&amp;gt;1&amp;#x000A;  );&amp;#x000A;&amp;#x000A;  # Retrieve latest post &amp;#x000A;  query_posts( $post_args );&amp;#x000A;&amp;#x000A;  # Cache latest posts data&amp;#x000A;  # date in Unix format to sort by, post&amp;#39;s category (current iteration)&amp;#x000A;  # and the post itself&amp;#x000A;  # this is done in order not to run loop twice&amp;#x000A;  while ( have_posts() ) : the_post();&amp;#x000A;    $GLOBALS[&amp;#39;catsArray&amp;#39;][$category-&amp;gt;slug] = array(&amp;#x000A;      &amp;#39;date&amp;#39; =&amp;gt; get_the_time(&amp;#39;U&amp;#39;),&amp;#x000A;      &amp;#39;category&amp;#39; =&amp;gt; $category,&amp;#x000A;      &amp;#39;post&amp;#39; =&amp;gt; $post&amp;#x000A;    );&amp;#x000A;&amp;#x000A;  endwhile;&amp;#x000A;&amp;#x000A;  # Resetting query&amp;#x000A;  wp_reset_query();&amp;#x000A;&amp;#x000A;}&amp;#x000A;&amp;#x000A;# Compares two arrays by their &amp;quot;date&amp;quot; field&amp;#x000A;function compareDates($a, $b) {&amp;#x000A;  if ( $a[&amp;#39;date&amp;#39;] == $b[&amp;#39;date&amp;#39;] ) {&amp;#x000A;    return 0;&amp;#x000A;  }&amp;#x000A;&amp;#x000A;  return ($a[&amp;#39;date&amp;#39;] &amp;lt; $b[&amp;#39;date&amp;#39;]) ? 1 : -1;&amp;#x000A;}&amp;#x000A;&amp;#x000A;# Sort using defined function&amp;#x000A;usort($GLOBALS[&amp;#39;catsArray&amp;#39;], &amp;quot;compareDates&amp;quot;);&lt;/code&gt;&lt;/pre&gt;
      
      &lt;h2 id='sources'&gt;Sources&lt;/h2&gt;
      
      &lt;ul&gt;
      &lt;li&gt;http://codex.wordpress.org/Function_Reference/get_categories&lt;/li&gt;
      
      &lt;li&gt;http://codex.wordpress.org/Function_Reference/query_posts&lt;/li&gt;
      
      &lt;li&gt;http://php.net/manual/en/function.usort.php&lt;/li&gt;
      &lt;/ul&gt;
    </content>
    <published>2011-04-20T00:00:00+00:00</published>
    <updated>2011-04-20T00:00:00+00:00</updated>
  </entry>
  <entry>
    <title>First steps in Nesta (and Ruby)</title>
    <link href='http://mishareyzlin.com/notes/using-nesta' rel='alternate' type='text/html' />
    <id>tag:mishareyzlin.com,2011-04-15:/notes/using-nesta</id>
    <content type='html'>
      &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: this article was updated to work with &lt;a href='https://github.com/tanoku/redcarpet'&gt;Redcarpet 2&lt;/a&gt;, that is incompatible with first version.&lt;/p&gt;
      
      &lt;p&gt;In order to use custom content processing libarary (I wanted to try out new markdown lib from github, Redcarpet) I needed to extend &lt;a href='http://nestacms.com'&gt;Nesta&lt;/a&gt;&amp;#8217;s FileModel&amp;#8217;s &lt;code&gt;to_html&lt;/code&gt; method, like so:&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;module Nesta &amp;#x000A;  class FileModel &amp;#x000A;    def to_html ( scope = nil )&amp;#x000A;      html = convert_to_html @format, scope, markup&amp;#x000A;    end&amp;#x000A;&amp;#x000A;    def convert_to_html ( format, scope, text )&amp;#x000A;      @markdown = Redcarpet::Markdown.new(&amp;#x000A;                    Redcarpet::Render::HTML,&amp;#x000A;                    :no_intra_emphasis =&amp;gt; true,&amp;#x000A;                    :lax_html_blocks =&amp;gt; true,&amp;#x000A;                    :autolink =&amp;gt; true, &amp;#x000A;                    :space_after_headers =&amp;gt; true&amp;#x000A;                  )&amp;#x000A;&amp;#x000A;      case format&amp;#x000A;        when :mdown&amp;#x000A;          @markdown.render( text )&amp;#x000A;          # Maruku.new( text ).to_html&amp;#x000A;        when :haml&amp;#x000A;          Haml::Engine.new( text ).to_html(scope || Object.new)&amp;#x000A;        when :textile&amp;#x000A;          RedCloth.new( text ).to_html&amp;#x000A;        end&amp;#x000A;    end&amp;#x000A;  end&amp;#x000A;end&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;That allows me to parse content files with Redcarpet instead of default markdown parser, Maruku. But what if I also want to use &lt;code&gt;:redcarpet&lt;/code&gt; as a filter in HAML? In order to do that, I needed to add new HAML filter:&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;module Haml::Filters::Redcarpet&amp;#x000A;  include Haml::Filters::Base&amp;#x000A;&amp;#x000A;  @markdown = Redcarpet::Markdown.new(&amp;#x000A;                Redcarpet::Render::HTML,&amp;#x000A;                :no_intra_emphasis =&amp;gt; true,&amp;#x000A;                :lax_html_blocks =&amp;gt; true,&amp;#x000A;                :autolink =&amp;gt; true, &amp;#x000A;                :space_after_headers =&amp;gt; true&amp;#x000A;              )&amp;#x000A;&amp;#x000A;  def render ( text )&amp;#x000A;    @markdown.render text&amp;#x000A;  end&amp;#x000A;end&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;We can now use &lt;code&gt;:redcarpet&lt;/code&gt; filter in HAML like so:&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;%p&amp;#x000A;  :redcarpet&amp;#x000A;    # Here goes markdown content&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;Another useful note: @page.metadata() method is exposed, i.e. you can specify any key in the top of your pages and you&amp;#8217;ll be able to access that data in your templates like so:&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;- if @page.metadata(&amp;#39;foo&amp;#39;)&amp;#x000A;  %h1 @page.metadata(&amp;#39;foo&amp;#39;)&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;It&amp;#8217;s important to note, that if you are going to retrieve values from &lt;code&gt;@page&lt;/code&gt; in layout, guard yourself with &lt;code&gt;if&lt;/code&gt;s, because there are pages like 404, that are using layout but don&amp;#8217;t have associated &lt;code&gt;@page&lt;/code&gt; model with them, – in that case you wont have &lt;code&gt;@page&lt;/code&gt; defined, and calling &lt;code&gt;@page.method&lt;/code&gt; will break.&lt;/p&gt;
      
      &lt;h2 id='sources'&gt;Sources&lt;/h2&gt;
      
      &lt;ol&gt;
      &lt;li&gt;https://github.com/gma/nesta/blob/master/lib/nesta/models.rb&lt;/li&gt;
      
      &lt;li&gt;https://github.com/gma/nesta/issues#issue/21&lt;/li&gt;
      &lt;/ol&gt;
    </content>
    <published>2011-04-15T00:00:00+00:00</published>
    <updated>2011-04-15T00:00:00+00:00</updated>
  </entry>
  <entry>
    <title>Re-compiling PHP to be used with FPM and Nginx</title>
    <link href='http://mishareyzlin.com/notes/re-compiling-php-nginx-fpm' rel='alternate' type='text/html' />
    <id>tag:mishareyzlin.com,2011-04-07:/notes/re-compiling-php-nginx-fpm</id>
    <content type='html'>
      &lt;p&gt;If you are just like me, not really a server-side guy and you&amp;#8217;ve suddenly got a need to recompile PHP that you have on your server (in my case, when I first configured my virtual server I followed some tutorial and didn&amp;#8217;t pay too much attention to what modules I&amp;#8217;ve compiled with, except for php-fpm, that was needed to make things work fast. And so I found myself in a situation where I was getting the following error:&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;imagecreatefromstring() [function.imagecreatefromstring] No JPEG support in this PHP build&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;So, as &lt;a href='http://stackoverflow.com/questions/5554705/imagecreatefromstring-function-imagecreatefromstring-no-jpeg-support-in-this'&gt;I found out&lt;/a&gt; the best approach to make things work properly was to recompile PHP with explicit JPEG support.&lt;/p&gt;
      
      &lt;p&gt;But, since I wanted also to not break anything else, I needed a list of other options that PHP was built with. So my short notice is exactly about that – I&amp;#8217;ve spent some time looking for a solution and it was actually super easy.&lt;/p&gt;
      
      &lt;p&gt;Run &lt;code&gt;php -i&lt;/code&gt; in your terminal (which is an equivalent of &lt;code&gt;&amp;lt;?php phpinfo(); ?&amp;gt;&lt;/code&gt;) but it prints to the command line output. Then among the first lines of output you&amp;#8217;ll see &lt;code&gt;Configure Command =&amp;gt; &lt;/code&gt; with exact options PHP was built previous time. It looks like this:&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;Configure Command =&amp;gt;  &amp;#39;./configure&amp;#39;  &amp;#39;--enable-fastcgi&amp;#39; &amp;#39;--enable-fpm&amp;#39; &amp;#39;--with-mcrypt&amp;#39; &amp;#39;--with-zlib&amp;#39; &amp;#39;--enable-mbstring&amp;#39; &amp;#39;--with-openssl&amp;#39; &amp;#39;--with-mysql&amp;#39; &amp;#39;--with-mysql-sock&amp;#39; &amp;#39;--with-curl&amp;#39; &amp;#39;--with-jpeg-dir=/usr/lib&amp;#39; &amp;#39;--with-gd&amp;#39; &amp;#39;--enable-gd-native-ttf&amp;#39; &amp;#39;--without-sqlite&amp;#39; &amp;#39;--disable-pdo&amp;#39; &amp;#39;--disable-reflection&amp;#39;&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;Also, if you are recompiling from PHP 5.3.0, where support for FPM needed to be patched in to PHP 5.3.6 (and probably anything higher than 5.3.0) which comes with FPM built-in – be aware that config file syntax has changed from XML to &amp;#8220;ini&amp;#8221;.&lt;/p&gt;
      
      &lt;p&gt;So update your &lt;code&gt;php-fpm.config&lt;/code&gt; (if you aren&amp;#8217;t sure where it is, use &lt;code&gt;locate php-fpm.config&lt;/code&gt;, in my case it resided in &lt;code&gt;/usr/local/etc&lt;/code&gt;). You can take your old config in XML syntax and copy options to the provided example file (for me it was also found in &lt;code&gt;/usr/local/etc&lt;/code&gt;).&lt;/p&gt;
      
      &lt;p&gt;You&amp;#8217;ll also need to update your php-fpm daemon script in &lt;code&gt;/etc/init.d&lt;/code&gt;, to do that first remove an old version:&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;sudo /usr/sbin/update-rc.d -f php-fpm remove&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;then copy &lt;code&gt;sapi/fpm/init.d.php-fpm&lt;/code&gt; from the folder with PHP source to &lt;code&gt;/etc/init.d/&lt;/code&gt; like this:&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;sudo cp -f /usr/local/src/php5.3.6/sapi/fpm/init.d.php-fpm /etc/init.d/.&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;set appropriate permissions:&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;chmod 755 /etc/init.d/php-fpm&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;and install the script to manage the service:&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;sudo /usr/sbin/update-rc.d -f php-fpm defaults&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;I also needed to adjust that daemon script (&lt;code&gt;/etc/init.d/php-fpm&lt;/code&gt;) in order to use it, for me, previous location of &lt;code&gt;php-fpm.pid&lt;/code&gt; didn&amp;#8217;t match the provided default value (again, you can find it with &lt;code&gt;locate php.fpm.pid&lt;/code&gt;).&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;php_fpm_BIN=${exec_prefix}/sbin/php-fpm&amp;#x000A;php_fpm_CONF=${prefix}/etc/php-fpm.conf&amp;#x000A;php_fpm_PID=${prefix}/logs/php-fpm.pid&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;You should see errors output in the log (you can find the path to log in php-fpm.conf) for the debugging.&lt;/p&gt;
      
      &lt;h2 id='sources'&gt;Sources&lt;/h2&gt;
      
      &lt;ol&gt;
      &lt;li&gt;http://stackoverflow.com/questions/5554705/imagecreatefromstring-function-imagecreatefromstring-no-jpeg-support-in-this&lt;/li&gt;
      
      &lt;li&gt;http://interfacelab.com/nginx-php-fpm-apc-awesome/&lt;/li&gt;
      
      &lt;li&gt;http://forum.nginx.org/read.php?3,82703,82705#msg-82705&lt;/li&gt;
      &lt;/ol&gt;
    </content>
    <published>2011-04-07T00:00:00+00:00</published>
    <updated>2011-04-07T00:00:00+00:00</updated>
  </entry>
  <entry>
    <title>Testing local running websites on Android Emulator, in OS X environment</title>
    <link href='http://mishareyzlin.com/notes/testing-local-websites-android-emulator' rel='alternate' type='text/html' />
    <id>tag:mishareyzlin.com,2010-10-20:/notes/testing-local-websites-android-emulator</id>
    <content type='html'>
      &lt;p&gt;You can either download Android SDK &lt;a href='http://developer.android.com/sdk/'&gt;here&lt;/a&gt; and follow the provided instructions or if you are using &lt;a href='http://mxcl.github.com/homebrew/'&gt;homebrew&lt;/a&gt; type this:&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;$: brew install android&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;Then, in order to start android-sdk type:&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;$: android&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;If that throws an error, like the following:&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;emulator: ERROR: could not find required kernel image (kernel-qemu).&amp;#x000A;emulator: Maybe defining ANDROID_SDK_ROOT to point to a valid SDK installation path might help ?&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;you can add the following (the example is for default brew installation) in your &lt;code&gt;~/.profile&lt;/code&gt;:&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;# this is required for android SDK to start from terminal&amp;#x000A;export ANDROID_SDK_ROOT=&amp;quot;/usr/local/Cellar/android-sdk/r6/&amp;quot;&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;If you haven&amp;#8217;t installed the emulator via brew, find out where SDK is placed and assign ANDROID_SDK_ROOT that path.&lt;/p&gt;
      
      &lt;p&gt;In the application menu include repository and update packages.&lt;/p&gt;
      
      &lt;p&gt;Create an instance of emulator and remember its name (say, &amp;#8220;test&amp;#8221;).&lt;/p&gt;
      
      &lt;p&gt;When starting your emulator you will have to use the -partition-size command to avoid out-of-memory messages.&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;$ emulator -avd [your-emulator-name] -partition-size 128&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;After emulator has started, in other terminal instance (tab or window), type:&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;$ adb remount&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;This will prevent &amp;#8220;read-only file system&amp;#8221; problem.&lt;/p&gt;
      
      &lt;p&gt;Then, to enter virtual device&amp;#8217;s shell:&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;$ adb -e shell&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;and within the shell do (replace %YOUR_LOCAL_HOST% with your desired host):&lt;/p&gt;
      
      &lt;pre&gt;&lt;code&gt;# echo &amp;#39;10.0.2.2    %YOUR_LOCAL_HOST%&amp;#39; &amp;gt;&amp;gt; /etc/hosts &lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;&amp;#8220;10.0.2.2&amp;#8221; is your hosting machine’s IP, – so %YOUR_LOCAL_HOST% will be pointing at your master machine, where web server is running.&lt;/p&gt;
      
      &lt;p&gt;Now you can go to the browser on your android emulator and access your locally running development server with desired development domain.&lt;/p&gt;
      
      &lt;h2 id='sources'&gt;Sources&lt;/h2&gt;
      
      &lt;ol&gt;
      &lt;li&gt;&lt;a href='http://stackoverflow.com/questions/1320241/how-can-i-look-at-locally-hosted-projects-with-the-android-sdk-emulator'&gt;http://stackoverflow.com/questions/1320241/how-can-i-look-at-locally-hosted-projects-with-the-android-sdk-emulator&lt;/a&gt;&lt;/li&gt;
      
      &lt;li&gt;&lt;a href='http://sacoskun.blogspot.com/2009/06/configure-hosts-file-in-android.html'&gt;http://sacoskun.blogspot.com/2009/06/configure-hosts-file-in-android.html&lt;/a&gt;&lt;/li&gt;
      
      &lt;li&gt;&lt;a href='http://github.com/mxcl/homebrew/issues/issue/397'&gt;http://github.com/mxcl/homebrew/issues/issue/397&lt;/a&gt;&lt;/li&gt;
      &lt;/ol&gt;
    </content>
    <published>2010-10-20T00:00:00+00:00</published>
    <updated>2010-10-20T00:00:00+00:00</updated>
  </entry>
</feed>

