<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>The Traveling Coder</title>
    <link href="http://maximebf.com/atom.xml" rel="self" />
    <link href="http://maximebf.com/" />
    <updated>2015-08-10T16:36:54+02:00</updated>
    <id>http://maximebf.com</id>
    <author>
        <name>Maxime Bouroumeau-Fuseau</name>
    </author>
    
        <entry>
            <title>Halloween Contest: Win a Copy of Instant Flask Web Development</title>
            <link href="http://maximebf.com/blog/2013/10/halloween-contest"/>
            <updated>2013-10-31T00:00:00+01:00</updated>
            <id>http://maximebf.com/blog/2013/10/halloween-contest</id>
            <content type="html">&lt;p&gt;It’s Halloween which means it’s time for some scary stories! I have teamed up
with Packt Publishing to organize a giveaway of their new book,
&lt;a href=&quot;http://www.packtpub.com/flask-web-development/book&quot;&gt;Instant Flask Web Development&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/media/flask-packt-book.jpg&quot; alt=&quot;Instant Flask Web Development&quot; /&gt;&lt;/p&gt;

&lt;p&gt;About the book:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Manage your project dependencies using virtualenv&lt;/li&gt;
  &lt;li&gt;Understand how Flask provides URL routing and web request handling&lt;/li&gt;
  &lt;li&gt;Recognize how Flask serves static files on disk&lt;/li&gt;
  &lt;li&gt;Learn about modeling, storing, and querying data with SQLAlchemy&lt;/li&gt;
  &lt;li&gt;Present HTML forms and validate input with WTForms&lt;/li&gt;
  &lt;li&gt;Build a page layout with Twitter Bootstrap using a base Jinja template&lt;/li&gt;
  &lt;li&gt;Create, recall, update, delete, and list database records&lt;/li&gt;
  &lt;li&gt;Build custom template filters in Jinja to format data&lt;/li&gt;
  &lt;li&gt;Authenticate users and maintain sessions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The goal is to make the night as spooky as possible by sharing your scariest
development stories! Post your story in the comment section below and win
one of the three available digital copies of the book.&lt;/strong&gt; Think of it as a mini
&lt;a href=&quot;http://thedailywtf.com&quot;&gt;Daily WTF&lt;/a&gt; context.&lt;/p&gt;

&lt;p&gt;The contest will be open for 7 days, until the 7th of November.
Winners will be contacted though the comments so be sure to use a method which
allows me to reach you. Winners will receive an e-copy version of the book.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: the winners were notified in the comments. Congratulations to them!&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Goal Versus System Oriented People</title>
            <link href="http://maximebf.com/blog/2013/10/goal-vs-system-oriented"/>
            <updated>2013-10-20T00:00:00+02:00</updated>
            <id>http://maximebf.com/blog/2013/10/goal-vs-system-oriented</id>
            <content type="html">&lt;p&gt;Last week I read an interesting article from Scott Adams, the creator of the
&lt;a href=&quot;http://dilbert.com&quot;&gt;Dilbert comic&lt;/a&gt;, about &lt;a href=&quot;http://online.wsj.com/article/SB10001424052702304626104579121813075903866.html&quot;&gt;&lt;em&gt;How To Be Successful&lt;/em&gt;&lt;/a&gt;. 
He exposes two different kind of people, goal oriented and system oriented,
and makes the case as to why the latter is the best option.&lt;/p&gt;

&lt;p&gt;Putting aside whether being system oriented is better or not, the article struck
a chord with me. The difference between goal oriented and system oriented can be
easily resume using a weight loss example:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Your goal is to loose 10kg in 6 months: you achieve it, celebrate by going to
the restaurant, gain back 1kg after a day. You start playing &lt;a href=&quot;http://en.wikipedia.org/wiki/Yo-yo_effect&quot;&gt;Yo-yo&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;Your system is to eat healthy and in reasonable quantity: it takes much longer
to loose the weight but you will loose it in time. You will stay slim and have
a much healthier diet in the long term.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The second point makes definitely more sense to me than the first. It is however more
difficult to start a system has it involves a mindset. When it fits your personality
it is easy to get into but needs a lot of motivation and introspection in the other case.
A system is also much less rewarding in the short term (can even be the opposite at first).&lt;/p&gt;

&lt;p&gt;I faced that problem more than once trying to get into sports. Ironically, my goal
was to set up a system but it failed as I couldn’t change my mindset.&lt;br /&gt;
On the opposite end, I’m naturally using systems for some aspects of my life where
I would consider myself successful.&lt;/p&gt;

&lt;p&gt;I also noticed how some people will create a system to reach a long term goal (eg: earn
X amount of money and retire) but then suffer the same problem as Mr. Adams describes for
goal oriented people (eg: depression because the best years of life are gone). Thus a system
in response to a goal is almost as bad as no system at all.&lt;/p&gt;

&lt;p&gt;I think people will rely on goals in areas where they’re not comfortable/good whereas
naturally use a system in areas where they perform well (thus not noticing the system).
I don’t think most successful people consciously created their system but the system
created itself naturally as a result of their mindset.&lt;/p&gt;

&lt;p&gt;To end, I would argue that it is not the fact that they are system oriented that make
people more successful but that their mindset fits well with the task at end,
the system being a by-product of this good fit.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Now, you could use a system to change your mindset…&lt;/em&gt;&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Becoming a Digital Nomad</title>
            <link href="http://maximebf.com/blog/2013/09/becoming-a-digital-nomad"/>
            <updated>2013-09-08T00:00:00+02:00</updated>
            <id>http://maximebf.com/blog/2013/09/becoming-a-digital-nomad</id>
            <content type="html">&lt;p&gt;Although the “&lt;a href=&quot;/freelancing&quot;&gt;Hire me for your next project&lt;/a&gt;” page has been up for a
few weeks, I didn’t talk much about it. As you may know, I’ve been traveling since
January. What started as a round-the-world trip as now turned into something else
as I have been taking on freelancing jobs for the last three months.&lt;/p&gt;

&lt;p&gt;I already wrote a post, “&lt;a href=&quot;http://travelingcoder.com/2013/09/why-iam-in-montreal-right-now/&quot;&gt;Why I’m in Montreal Right Now&lt;/a&gt;”,
in my &lt;a href=&quot;http://travelingcoder.com&quot;&gt;travel journal&lt;/a&gt; covering this change and what it
means for my travels.&lt;/p&gt;

&lt;p&gt;I’m really enjoying the &lt;a href=&quot;http://en.wikipedia.org/wiki/Digital_nomad&quot;&gt;digital nomad&lt;/a&gt;
lifestyle now but it needed some adjustments at the beginning. I now reserve
a few half days per week for work and will usually do a bit of computer
every morning or evening for minor tasks and keeping up with the news.&lt;/p&gt;

&lt;p&gt;I work from many different kinds of places. If there is a coworking space
nearby, I try to go there but I usually work from coffee shops or at the 
hostel/hotel.&lt;/p&gt;

&lt;p&gt;In parallel to freelancing, I’m also working on new projects which I hope
will become profitable in the long term. The beta of the first one, &lt;a href=&quot;http://makerspad.com&quot;&gt;Makerspad&lt;/a&gt;,
should start in the upcoming weeks.&lt;/p&gt;

&lt;p&gt;All this is a new direction for my life and I don’t know what will happen
in the future. What I know is that I’m having the time of my life and that
I will work hard to keep living the dream for as long as possible!&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Introducing PHP DebugBar</title>
            <link href="http://maximebf.com/blog/2013/08/introducing-php-debug-bar"/>
            <updated>2013-08-14T00:00:00+02:00</updated>
            <id>http://maximebf.com/blog/2013/08/introducing-php-debug-bar</id>
            <content type="html">&lt;p&gt;Having some information about what’s happening in your application is always
something nice to have. For some time, I used &lt;a href=&quot;http://www.firephp.org/&quot;&gt;FirePHP&lt;/a&gt; which while working
very well is pretty limited on the way to display information.&lt;/p&gt;

&lt;p&gt;Some of the bigger frameworks like &lt;a href=&quot;http://symfony.com/&quot;&gt;Symfony&lt;/a&gt; include a debug bar or a
profiling utility. Unfortunately, it is always completly dependent on the
framework (understandable) which means that standalone projects or smaller
frameworks does not benefit from it.&lt;/p&gt;

&lt;p&gt;With &lt;a href=&quot;http://phpdebugbar.com&quot;&gt;PHP DebugBar&lt;/a&gt; my goal was to create a completely 
generic debug bar which can be easily integrated in any project. It is divided 
into two parts: a server side component to collect data and a client side component
to display the collected data.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.github.com/maximebf/php-debugbar/master/docs/screenshot.png&quot; alt=&quot;Screenshot&quot; /&gt;&lt;/p&gt;

&lt;p&gt;A lot of data collectors are included, ranging from request data to PDO
as well as collectors for popular projects like Doctrine and Swift Mailer.&lt;/p&gt;

&lt;p&gt;The design of the data collectors is heavily inspired from the ones in
Symfony which are unfortunately too much dependent on Symfony’s libraries.&lt;/p&gt;

&lt;p&gt;The client side component is 100% coded in Javascript and is completely 
independent from PHP. It could easily be re-used in implementations for
other languages. The only real dependency is jQuery but including FontAwesome 
adds nice icons.&lt;/p&gt;

&lt;p&gt;Checkout &lt;a href=&quot;http://phpdebugbar.com&quot;&gt;phpdebugbar.com&lt;/a&gt; for a live example and
a comprehensive documentation.&lt;/p&gt;

&lt;p&gt;I also created a DebugBar plugin for &lt;a href=&quot;http://atomikframework.com&quot;&gt;Atomik&lt;/a&gt; 
and the skeleton application now comes with the debug bar already activated.&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Multi-site setup using Jekyll</title>
            <link href="http://maximebf.com/blog/2013/07/multi-site-jekyll"/>
            <updated>2013-07-30T00:00:00+02:00</updated>
            <id>http://maximebf.com/blog/2013/07/multi-site-jekyll</id>
            <content type="html">&lt;p&gt;Continuing on my &lt;a href=&quot;http://maximebf.com/blog/2013/07/jekyll-dropbox-crontab&quot;&gt;previous post&lt;/a&gt; about my
&lt;a href=&quot;http://jekyllrb.com&quot;&gt;Jekyll&lt;/a&gt; setup. As I noted, I use Jekyll to publish two sites which have
many things in common. After some messing around, I’m finally happy with the organization and
usage of this setup.&lt;/p&gt;

&lt;p&gt;The two site share the following things:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;assets&lt;/li&gt;
  &lt;li&gt;includes&lt;/li&gt;
  &lt;li&gt;plugins&lt;/li&gt;
  &lt;li&gt;layouts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tasks in my fabfile are adapted to multi-site usage and I also have tasks to generate the
configuration files.&lt;/p&gt;

&lt;p&gt;The organization of the files is as follow:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sites/
  _assets/
  _includes/
  _plugins/
  _layouts/
  maximebf.com/
  travelingcoder.com/
  crontab
  fabfile.py
  nginx.conf
  supervisor.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;em&gt;_assets&lt;/em&gt;, &lt;em&gt;_includes&lt;/em&gt;, &lt;em&gt;_plugins&lt;/em&gt; and &lt;em&gt;_layouts&lt;/em&gt; are shared by all sites. &lt;/p&gt;

&lt;p&gt;I have created three plugins to add support for more than one &lt;em&gt;_layouts&lt;/em&gt; and &lt;em&gt;_includes&lt;/em&gt; 
folder as well as copying the shared assets over to each sites.&lt;/p&gt;

&lt;p&gt;I made a &lt;a href=&quot;https://gist.github.com/maximebf/5992910&quot;&gt;Gist&lt;/a&gt; containing all files from 
this post. Here are the three plugins:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://gist.github.com/maximebf/5992910#file-multilayout-rb&quot;&gt;multilayout.rb&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://gist.github.com/maximebf/5992910#file-include_tag-rb&quot;&gt;include_tag.rb&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://gist.github.com/maximebf/5992910#file-copy_assets-rb&quot;&gt;copy_assets.rb&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;(Note that they’re not very flexible and were made for my own use case)&lt;/p&gt;

&lt;p&gt;I also created a &lt;a href=&quot;https://gist.github.com/maximebf/5992910#file-config_files-rb&quot;&gt;config_files.rb&lt;/a&gt;
plugin which will scan your site folder for any &lt;em&gt;.config.yml&lt;/em&gt; file and add them to the
configuration. (I use this on &lt;a href=&quot;http://travelingcoder.com&quot;&gt;travelingcoder.com&lt;/a&gt; to keep
map data out of the main &lt;em&gt;_config.yml&lt;/em&gt; file).&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;_config.yml&lt;/em&gt; file for each of my sites look something like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;plugins: ../_plugins
includes: 
  - ../_includes
  - _includes
layouts:
  - ../_layouts
  - _layouts
future: false
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Some of the shared &lt;em&gt;_includes&lt;/em&gt; are Disqus and Google Analytics code, the footer, the
sharing widget and common assets for &amp;lt;head&amp;gt;.&lt;/p&gt;

&lt;p&gt;The content of the &lt;em&gt;_assets&lt;/em&gt; folder is merged with the &lt;em&gt;assets&lt;/em&gt; folder in each
site directories.&lt;/p&gt;

&lt;p&gt;Compared to my previous post, tasks in my &lt;a href=&quot;https://gist.github.com/maximebf/5992910#file-fabfile-py&quot;&gt;fabfile&lt;/a&gt;
take a &lt;em&gt;domain&lt;/em&gt; argument.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ fab serve:maximebf.com
$ fab publish:all
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The crontab has to be modified to use &lt;em&gt;publish:all&lt;/em&gt; instead of &lt;em&gt;publish&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://gist.github.com/maximebf/5992910#file-nginx-conf&quot;&gt;&lt;em&gt;nginx.conf&lt;/em&gt;&lt;/a&gt; and 
&lt;a href=&quot;https://gist.github.com/maximebf/5992910#file-supervisor-conf&quot;&gt;&lt;em&gt;supervisor.conf&lt;/em&gt;&lt;/a&gt; 
files are actually templates and I use a task to generate the final configuration 
for every domain:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ sudo fab gen_conf # all domains
$ sudo fab gen_conf:maximebf.com # one domain
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I recently added a third site to this setup and although it shares not much with the
two others, it has worked out very well.&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Big Update to Beautiful Docs</title>
            <link href="http://maximebf.com/blog/2013/07/big-update-to-beautifuldocs"/>
            <updated>2013-07-16T00:00:00+02:00</updated>
            <id>http://maximebf.com/blog/2013/07/big-update-to-beautifuldocs</id>
            <content type="html">&lt;p&gt;&lt;a href=&quot;http://beautifuldocs.com&quot;&gt;Beautiful Docs&lt;/a&gt; has reached version 1.0! 
I must be honest that the project was stagnant for some time. The recent
Hacker News &lt;a href=&quot;https://news.ycombinator.com/item?id=6041006&quot;&gt;submission&lt;/a&gt; about 
&lt;a href=&quot;http://daux.io/&quot;&gt;daux.io&lt;/a&gt; pushed me to fix all the open issues and add the 
features I had been thinking about for some time.&lt;/p&gt;

&lt;p&gt;The new features:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;search (full client-side, no server needed)&lt;/li&gt;
  &lt;li&gt;rebuilt generation engine with support for themes&lt;/li&gt;
  &lt;li&gt;generate static pages alongside your documentation&lt;/li&gt;
  &lt;li&gt;links&lt;/li&gt;
  &lt;li&gt;integration with google analytics and disqus&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;http://beautifuldocs.com&quot;&gt;Beautiful Docs&lt;/a&gt;  is a static documentation 
generator based on markdown files. It is developed in Javascript with Node.js.&lt;/p&gt;

&lt;p&gt;Install it with NPM:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ npm install -g beautiful-docs
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Create a &lt;em&gt;manifest.json&lt;/em&gt; file:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{
    &quot;title&quot;: &quot;My documentation&quot;,
    &quot;files&quot;: [&quot;README.md&quot;]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Generate the HTML website:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ bfdocs /path/to/manifest.json /path/to/output
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Learn more at &lt;a href=&quot;http://beautifuldocs.com&quot;&gt;beautifuldocs.com&lt;/a&gt; &lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Publishing with Jekyll, Dropbox and Crontab</title>
            <link href="http://maximebf.com/blog/2013/07/jekyll-dropbox-crontab"/>
            <updated>2013-07-15T00:00:00+02:00</updated>
            <id>http://maximebf.com/blog/2013/07/jekyll-dropbox-crontab</id>
            <content type="html">&lt;p&gt;My two blogs are powered with &lt;a href=&quot;http://jekyllrb.com&quot;&gt;Jekyll&lt;/a&gt;, a static site generator.
I love it and this is hands down the way to publish my content I prefer the most.
I’ve been &lt;a href=&quot;http://maximebf.com/blog/2012/01/a-new-start-with-jekyll&quot;&gt;using it&lt;/a&gt; since 
I moved my blog out of Posterous and it has always served me well. I’m using it with
a multi-site setup (which I will cover in a future post) and have published more than
a hundred articles without any issues.&lt;/p&gt;

&lt;p&gt;At first, I generated the site on my local machine and published it on my server
using rsync. It was working well but quickly reach its limitations. As you may know,
I’m &lt;a href=&quot;http://travelingcoder.com&quot;&gt;traveling&lt;/a&gt; which means that I don’t always have access
to a reliable Internet connection or have Internet at all. Secondly, I really wanted
to be able to write posts which would be auto-published in the future.&lt;/p&gt;

&lt;p&gt;As a result I’m now using &lt;a href=&quot;http://dropbox.com&quot;&gt;Dropbox&lt;/a&gt; to sync my site to my server 
where it is automatically published using a cron job. This process is very easy to setup
and made things much more easier.&lt;/p&gt;

&lt;p&gt;The site is generated at a fixed time, two times a day. It is also constantly
re-generated using a jekyll server in watch mode on a “draft” subdomain. This
way I can always have a look at what the site will look like and check changes
live. Only the draft domain includes future and draft posts.&lt;/p&gt;

&lt;p&gt;First, you’ll need to add &lt;code&gt;future: false&lt;/code&gt; to your &lt;em&gt;_config.yml&lt;/em&gt; file. It is
the only way to prevent &lt;code&gt;jekyll build&lt;/code&gt; from publishing future posts.&lt;/p&gt;

&lt;p&gt;On the server, I installed the Dropbox daemon and used the &lt;a href=&quot;http://www.dropboxwiki.com/tips-and-tricks/using-the-official-dropbox-command-line-interface-cli&quot;&gt;Dropbox command line interface&lt;/a&gt;
to exclude all folders except the one containing my site:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ dropbox.py exclude add MyExcludedFolder
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here’s some parts of my &lt;a href=&quot;http://fabfile.org&quot;&gt;Fabric&lt;/a&gt;’s fabfile which contains
some useful tasks to run the site on your local machine and generate it on the server.&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/5992791.js?file=fabfile.py&quot;&gt; &lt;/script&gt;

&lt;p&gt;On your local machine use &lt;code&gt;$ fab serve&lt;/code&gt; to make the blog available on &lt;a href=&quot;http://localhost:4000&quot;&gt;localhost:4000&lt;/a&gt;.
All future and draft posts will be visible.
As the blog is in Dropbox, it will be automatically synced to your server.&lt;/p&gt;

&lt;p&gt;On the server, add a job in your crontab to publish it at fixed times:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;30 10,23 * * * (cd /path/to/Dropbox/MyWebsite &amp;amp;&amp;amp; /usr/local/bin/fab publish)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I use &lt;a href=&quot;http://supervisord.org&quot;&gt;supervisor&lt;/a&gt; to have a jekyll process which
serve the site on the draft domain. I use the following supervisor configuration:&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/5992791.js?file=supervisor.conf&quot;&gt; &lt;/script&gt;

&lt;p&gt;Finally, I configure &lt;a href=&quot;http://nginx.org&quot;&gt;nginx&lt;/a&gt; to serve the two domains:&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/5992791.js?file=nginx.conf&quot;&gt; &lt;/script&gt;

&lt;p&gt;Notice the &lt;code&gt;try_files $uri.html $uri/ =404;&lt;/code&gt; line. It permits building URLs to
html files without the html extension.&lt;/p&gt;

&lt;p&gt;As a side note, &lt;a href=&quot;https://www.varnish-cache.org/&quot;&gt;varnish&lt;/a&gt; seats in front of all 
my domains and allows me to serve files quicker. It had no problem going through 
30000 visitors in a few hours while one of my article was on Hacker News’ frontpage.&lt;/p&gt;

&lt;p&gt;This setup allows me to write posts from anywhere (online using &lt;a href=&quot;https://write-box.appspot.com/&quot;&gt;Writebox&lt;/a&gt; 
or from my mobile). It allowed me to continue writing posts while my laptop was 
at the repair shop, all this without having to download anything or install jekyll.&lt;/p&gt;

&lt;p&gt;I’m now considering using &lt;a href=&quot;http://sparkleshare.org/&quot;&gt;Sparkleshare&lt;/a&gt; to achieve the same
thing and at the same time having everything in a git repo. I’m sure this would be
very easy to implement.&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Changes in the RSS feed</title>
            <link href="http://maximebf.com/blog/2013/07/rss-feed-change"/>
            <updated>2013-07-03T00:00:00+02:00</updated>
            <id>http://maximebf.com/blog/2013/07/rss-feed-change</id>
            <content type="html">&lt;p&gt;Small changes in the RSS feed. My two blogs (tech and travel) won’t be aggregated anymore
into a single feed.&lt;/p&gt;

&lt;p&gt;The feed on &lt;a href=&quot;http://maximebf.com&quot;&gt;maximebf.com&lt;/a&gt; will now only feature my tech articles. 
The URL doesn’t change (&lt;a href=&quot;http://feeds.feedburner.com/maximebf&quot;&gt;feeds.feedburner.com/maximebf&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The feed for my &lt;a href=&quot;http://travelingcoder.com&quot;&gt;travel blog&lt;/a&gt; is available at 
&lt;a href=&quot;http://feeds.feedburner.com/maximebf_travel&quot;&gt;feeds.feedburner.com/maximebf_travel&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As I expect to write more tech articles in the near future, I wanted to really separate the
two blogs, the travel one monopolizing the feed at the moment.&lt;/p&gt;

&lt;p&gt;More changes to come, stay tuned!&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Book review: The Lean Startup</title>
            <link href="http://maximebf.com/blog/2013/03/book-review-the-lean-startup"/>
            <updated>2013-03-21T00:00:00+01:00</updated>
            <id>http://maximebf.com/blog/2013/03/book-review-the-lean-startup</id>
            <content type="html">&lt;p&gt;I have known about the Lean Startup movement for some time now. Everything I 
read about the subject rang true with me. I’m particularly exposed to it 
reading HN daily where it’s prevalent and my boss at Allmyapps was a firm believer. 
It was time for me to actually read the book about it.&lt;/p&gt;

&lt;p&gt;The Lean Startup movement was started by Eric Ries who’s also the author of the
eponymous book. As with most idea books I read, I found it a bit too long.
These books tend to repeat concepts multiple time, explaining things in many paragraphs
when a couple would be enough. Perhaps this what’s needed to properly communicate ideas…&lt;/p&gt;

&lt;p&gt;Anyway, the book goes on to describe the idea, it’s origin, how to implement
it and talks about a few case studies. It’s a very interesting read and it 
convinced me even more.&lt;/p&gt;

&lt;p&gt;The Lean Startup takes it’s inspiration from the Lean Industry where everything
is built on-demand. The stated goal is to stop wasteful work by focusing on what
the customer really wants. Thus, less guesses and strategy but more experiments. Work should
revolve around a Build-Test-Learn feedback loop which should be as quick as possible,
speed being a major aspect of a startup. Startups shouldn’t be scared of pivoting,
ie. changing course, when their growth is stuck.&lt;/p&gt;

&lt;p&gt;I liked how Eric insists on not misinterpreting his idea as something opposed to management. 
The Lean Startup is a new management method for a world where the classical pyramidal scheme does not
work anymore. I can’t tell if the Lean Startup is the way forward but I firmly agree
with the precept.&lt;/p&gt;

&lt;p&gt;The Five Whys is an interesting concept that I had never heard of before. The goal
is to find the root cause of a problem asking your team “why” at each problem like
a kid would do. Eric acknowledge the difficulty of putting in place such meetings
but is convinced of the effectiveness of this method and explains how it worked well
in cases he was involved.&lt;/p&gt;

&lt;p&gt;I’m still wondering if the Lean Startup could really be applied to large companies.
Eric is convinced that it can and demonstrates it with a few case studies. However,
in most examples, it’s a small group inside the company. My doubts arise from the fact
that I’m not convinced most employees wants to be involved as much as it is required
by such a structure. In the same way, I think most management people will fight these
ideas as much as they can. &lt;/p&gt;

&lt;p&gt;The Lean Startup asks a lot from individuals. It implies rethinking the whole chain of 
responsibility as well as asking people to be more humble and respectful of others 
even in the face of difficulties. While this may be possible in small groups where 
people are carefully selected, I think it may be too optimistic about human nature 
to make it work at scale.&lt;/p&gt;

&lt;p&gt;When I think how management works in France, we are decades away of even considering
using this kind of new methodologies. The US has always been in the forefront in
business thinking and I can understand how these ideas could make there way inside
big companies. Unfortunately, the prevalent opinion in France is that only elites,
having studied in the &lt;em&gt;Grandes Ecoles&lt;/em&gt;, are able to manage people and that anybody
else is simply an idiot that needs to be told what to do. Good luck explaining to
them that they shouldn’t strategies everything.&lt;/p&gt;

&lt;p&gt;Overall, I’m convinced this is the best management method (that I know of!) for startups.
It allows to build flexible and resilient companies built to satisfy the customers 
and follow them as things changed.&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>Publishing PHP libraries using Github, Travis and Composer</title>
            <link href="http://maximebf.com/blog/2013/02/publishing-php-libraries-with-github-travis-composer"/>
            <updated>2013-02-18T00:00:00+01:00</updated>
            <id>http://maximebf.com/blog/2013/02/publishing-php-libraries-with-github-travis-composer</id>
            <content type="html">&lt;p&gt;While PHP had a package manager for a long time, in the form of PEAR,
it never really took off or become ubiquitous. The most common way
to install a library has always been manually which is a shame
given how practical a package manager can be.&lt;/p&gt;

&lt;p&gt;Fortunately, things are changing for the best since 
&lt;a href=&quot;http://getcomposer.org&quot;&gt;Composer&lt;/a&gt;. This package manager, inspired
by NPM from Node.js, is getting a very good traction and, I think, 
is slowly becoming the &lt;em&gt;de facto&lt;/em&gt; PHP package manager.&lt;/p&gt;

&lt;p&gt;In combination with &lt;a href=&quot;https://github.com&quot;&gt;Github&lt;/a&gt; and &lt;a href=&quot;http://travis-ci.org&quot;&gt;Travis&lt;/a&gt;, 
the trio gives you all the right tools to publish and manage your 
Open Source PHP library.&lt;/p&gt;

&lt;p&gt;I don’t think Github needs any kind of presentation but you may
not know Travis. It is an online continuous integration service 
(based on the Open Source project of the same name). Basically, it runs your test 
suite for you and sends you a report each time some commits are
pushed on Github. You may have noticed the small green badge “build
successfull” on some Github projects which indicates that they’re
using Travis.&lt;/p&gt;

&lt;p&gt;Setting up your project to use these tools is pretty straightforward.
First you’ll need to have a good organization in your repository.
Messy source codes are harder to dive into and harder to manage.
Prefer saving the actual source code of your project in a &lt;em&gt;src&lt;/em&gt; or
&lt;em&gt;lib&lt;/em&gt; folder (your pick, there doesn’t seem to be any real convention) 
in the root of your repository. Use a coding convention and choose
your namespace organization accordingly. Follow the &lt;a href=&quot;http://www.php-fig.org/&quot;&gt;PHP FIG&lt;/a&gt;
conventions as much as you can, they’re becoming the standard.&lt;/p&gt;

&lt;p&gt;Your library should be testable. Writing unit tests can be a hassle
but it makes the whole thing much more easier to maintain, easier
for other people to contribute and (most of the time) avoids introducing
bugs in existing code.  The most common unit testing library in
PHP is obviously &lt;a href=&quot;https://github.com/sebastianbergmann/phpunit/&quot;&gt;PHPUnit&lt;/a&gt;. Save your test cases in a &lt;em&gt;tests&lt;/em&gt;
folder in the root of your repository. Create your &lt;em&gt;phpunit.xml.dist&lt;/em&gt;
file. Mines usually look like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;

&amp;lt;phpunit backupGlobals=&quot;false&quot;
         backupStaticAttributes=&quot;false&quot;
         colors=&quot;true&quot;
         convertErrorsToExceptions=&quot;true&quot;
         convertNoticesToExceptions=&quot;true&quot;
         convertWarningsToExceptions=&quot;true&quot;
         processIsolation=&quot;false&quot;
         stopOnFailure=&quot;false&quot;
         syntaxCheck=&quot;false&quot;
         bootstrap=&quot;tests/bootstrap.php&quot;
&amp;gt;
    &amp;lt;testsuites&amp;gt;
        &amp;lt;testsuite name=&quot;Example Test Suite&quot;&amp;gt;
            &amp;lt;directory&amp;gt;./tests/&amp;lt;/directory&amp;gt;
        &amp;lt;/testsuite&amp;gt;
    &amp;lt;/testsuites&amp;gt;

    &amp;lt;filter&amp;gt;
        &amp;lt;whitelist&amp;gt;
            &amp;lt;directory&amp;gt;./src/&amp;lt;/directory&amp;gt;
        &amp;lt;/whitelist&amp;gt;
    &amp;lt;/filter&amp;gt;
&amp;lt;/phpunit&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Note that I use a &lt;em&gt;tests/bootstrap.php&lt;/em&gt; file which is ran before
the test suite. It sets up the include path and any dependencies.
The library source code is located in &lt;em&gt;src&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Travis needs a &lt;em&gt;travis.yml&lt;/em&gt; file at the root of your repository.
You’ll find more information &lt;a href=&quot;http://about.travis-ci.org/docs/user/languages/php/&quot;&gt;here&lt;/a&gt; but it is a very simple
YAML file, here is an example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;language: php
php: 
  - 5.3
  - 5.4
script: phpunit
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If your library has any dependencies managed through Composer,
add this line:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;before_script: composer install
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;To enable Travis for your project, &lt;a href=&quot;https://travis-ci.org/&quot;&gt;signup&lt;/a&gt; on their website
using Github and choose which projects should be tested.&lt;/p&gt;

&lt;p&gt;Before announcing to the world your great new library, don’t
forget to provide a &lt;em&gt;LICENSE&lt;/em&gt; file containing the full text
of your license and a &lt;em&gt;README&lt;/em&gt; (or &lt;em&gt;README.md&lt;/em&gt; for a markdown
formated file). It should at least explain what the project
is about, how to install it and the basics of using it. 
If a README is not enough, consider writing proper documentation
(maybe using &lt;a href=&quot;http://beautifuldocs.com&quot;&gt;Beautiful Docs&lt;/a&gt;).
It’s always a good gesture to provide an example usage of
your library. I usually have an &lt;em&gt;example.php&lt;/em&gt; file or an
&lt;em&gt;example&lt;/em&gt; folder for more complex projects.&lt;/p&gt;

&lt;p&gt;To add the Travis build status to your &lt;em&gt;README.md&lt;/em&gt;, add the following
markdown snippet (replace example/example with your project name):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[![Build Status](https://travis-ci.org/example/example.png?branch=master)](http://travis-ci.org/example/example)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;To be able to publish your project using Composer, you’ll 
need to provide a &lt;em&gt;composer.json&lt;/em&gt; file. The project has
a pretty good &lt;a href=&quot;http://getcomposer.org/doc/04-schema.md&quot;&gt;documentation&lt;/a&gt;. Here is a basic one:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{
    &quot;name&quot;: &quot;example/example&quot;,
    &quot;description&quot;: &quot;One liner description&quot;,
    &quot;keywords&quot;: [&quot;keyword&quot;],
    &quot;homepage&quot;: &quot;https://github.com/example/example&quot;,
    &quot;type&quot;: &quot;library&quot;,
    &quot;license&quot;: &quot;MIT&quot;,
    &quot;authors&quot;: [{
        &quot;name&quot;: &quot;John Doe&quot;,
        &quot;email&quot;: &quot;john@example.com&quot;,
        &quot;homepage&quot;: &quot;http://example.com&quot;
    }],
    &quot;require&quot;: {
        &quot;php&quot;: &quot;&amp;gt;=5.3.0&quot;
    },
    &quot;autoload&quot;: {
        &quot;psr-0&quot;: {&quot;MyLibraryNamespace&quot;: &quot;src/&quot;}
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The project name is in two parts, the first one being the
vendor name and the second one the library name. Note the
autoload section which specifies that the PSR-0 convention
is used as well as the namespace and the source code location.&lt;/p&gt;

&lt;p&gt;Signup on &lt;a href=&quot;http://packagist.org/&quot;&gt;Packagist&lt;/a&gt;, the main Composer repository. Connect
your Github account and activate which projects Packagist
should publish. Note that version numbers are tracked using
Git tags (&lt;code&gt;git tag 1.2.3&lt;/code&gt; and &lt;code&gt;git push --tags&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;You can now patiently wait for your first issue or better, your
first pull request ;)&lt;/p&gt;
</content>
        </entry>
    
</feed>
