<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title>elCuervo</title>
  <link href="http://elcuervo.co/atom.xml" rel="self"/>
  <link href="http://elcuervo.co"/>
  <updated>2012-01-06T14:35:20-02:00</updated>
  <id>http://elcuervo.co/</id>
  <author>
    <name>elCuervo - Bruno Aguirre</name>
    <email>elcuervo@elcuervo.co</email>
  </author>
  
  <entry>
    <title>Airplay Protocol</title>
    <link href="/protocol/airplay/apple/2012/01/05/airplay-protocol.html"/>
    <updated>2012-01-05T00:00:00-02:00</updated>
    <id>http://elcuervo.co/protocol/airplay/apple/2012/01/05/airplay-protocol</id>
    <content type="html">&lt;p&gt;I've spent a lot of time figuring out how to connect to my AppleTV and send it pictures, videos, music, etc... then i've realize that there is no documented protocol for it. Apple just mantains the interface for Cocoa and hides the undelying protocol&lt;/p&gt;

&lt;p&gt;The research to make the &lt;a href=&quot;http://github.com/elcuervo/airplay&quot;&gt;airplay&lt;/a&gt; gem was slow, mainly because was only a proof of
concept to communicate with the AppleTV from ruby.&lt;/p&gt;

&lt;h1&gt;General Info&lt;/h1&gt;

&lt;p&gt;One of the first things to know is that the Airplay Protocol uses a subset of
HTTP to communicate, uses an upgraded connections
&lt;a href=&quot;http://wiki.secondlife.com/wiki/Reverse_HTTP&quot;&gt;PTTH&lt;/a&gt; and persistent
connections to the resources.&lt;/p&gt;

&lt;p&gt;Second generation AppleTV with iOS 5 will also broadcast Airtunes and Mirroring
through the LAN.&lt;/p&gt;

&lt;h1&gt;Finding the server&lt;/h1&gt;

&lt;p&gt;The AppleTV will broadcast himself in the LAN using
&lt;a href=&quot;http://en.wikipedia.org/wiki/Bonjour_(software&quot;&gt;Bonjour&lt;/a&gt;). You can find
yours browsing for '_airplay._tcp.'.&lt;/p&gt;

&lt;p&gt;This will give you and Ip and a port, normally being :7000.&lt;/p&gt;

&lt;h1&gt;Photos&lt;/h1&gt;

&lt;p&gt;The resource for photos is &quot;photo&quot; there are only a few things that you can do
here.&lt;/p&gt;

&lt;p&gt;You cannot send the path of the image, you need to send it's content so if you
wanted so send an image you could only:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;      &lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;cat image.jpg
    
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Or&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;      &lt;span class=&quot;n&quot;&gt;content&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;image_path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;h2&gt;Request&lt;/h2&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;      &lt;span class=&quot;c1&quot;&gt;# PUT /photo&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;# X-Apple-Transition: None&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;# Connection: Keep-Alive&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;#&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;# ... raw img content ...&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;#&lt;/span&gt;
    
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Please note the &quot;X-Apple-Transition&quot; header, this header is not mandatory with
it you can create transitions between the current image and another.&lt;/p&gt;

&lt;p&gt;The ones i've found are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;None&lt;/li&gt;
&lt;li&gt;SlideLeft&lt;/li&gt;
&lt;li&gt;SlideRight&lt;/li&gt;
&lt;li&gt;Dissolve&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Two of them will give the chance so simulate the slide as when seeing in an
iPhone.&lt;/p&gt;

&lt;h2&gt;Request flow&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;+-----------+
|  AppleTV  +----+
+-----------+    |
                 |
       +---------+-----+
       |  PUT /photo   |
       |               |
       |  img content  |
       +---------+-----+
                 |
+----------+     |
|  Client  +-----+
+----------+
&lt;/code&gt;&lt;/pre&gt;

&lt;h1&gt;Video&lt;/h1&gt;

&lt;p&gt;The resource for videos is divided according for some it features, so you'll
have &quot;play&quot;, &quot;stop&quot;, &quot;rate&quot;.&lt;/p&gt;

&lt;h3&gt;play&lt;/h3&gt;

&lt;p&gt;Note three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There is a content in the body of the request, those are the 'commands' that
make magic&lt;/li&gt;
&lt;li&gt;The connection &lt;em&gt;must&lt;/em&gt; be kept alive for all the time of the video
playback.&lt;/li&gt;
&lt;li&gt;The Start-Position command as it's name suggest will set the start position to
n seconds of start.&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;Request&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;      &lt;span class=&quot;c1&quot;&gt;# POST /play&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;# Connection: Keep-Alive&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;#&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;# Content-Location: http://something.com/video.mp4&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;# Start-Position: 0&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;#&lt;/span&gt;
    
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;h3&gt;stop&lt;/h3&gt;

&lt;p&gt;This will stop (and end) the current playback&lt;/p&gt;

&lt;h4&gt;Request&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;      &lt;span class=&quot;c1&quot;&gt;# POST /stop&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;# Connection: Keep-Alive&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;#&lt;/span&gt;
    
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;h3&gt;rate&lt;/h3&gt;

&lt;p&gt;This was a tricky one, rate it's just to pausing and resuming playback of media.&lt;/p&gt;

&lt;p&gt;To pause:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;      &lt;span class=&quot;c1&quot;&gt;# POST /rate?value=0&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;# Connection: Keep-Alive&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;#&lt;/span&gt;
    
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;To play:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;      &lt;span class=&quot;c1&quot;&gt;# POST /rate?value=1&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;# Connection: Keep-Alive&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;#&lt;/span&gt;
    
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;h2&gt;Request flow&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;+-----------+
|  AppleTV  +----+
+-----------+    |
                 |
       +---------+---------------------------------------------------+
       |  POST /play                                                 |
       |                                                             |
       |  Content-Location: http://somewhere.com/overtherainbow.mp4  |
       |  Start-Position: 5                                          |
       +---------+---------------------------------------------------+
                 |
+----------+     |
|  Client  +-----+
+----------+
&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  
  <entry>
    <title>PostGIS in osx and debian</title>
    <link href="/postgres/postgis/debian/osx/2011/12/29/postgis-in-osx-and-debian.html"/>
    <updated>2011-12-29T00:00:00-02:00</updated>
    <id>http://elcuervo.co/postgres/postgis/debian/osx/2011/12/29/postgis-in-osx-and-debian</id>
    <content type="html">&lt;p&gt;I'm working in some cool GIS stuff using some shapefiles so i've finished using postgis... well... that was the idea, but i had some issues trying to setup everything in my mac so after some research i've found a gist that saved my life and here it is with some minor modifications. Hopefully in a few days i'll upload a tele script for it.&lt;/p&gt;

&lt;p&gt;All the fame and fortune belongs to &lt;a href=&quot;https://gist.github.com/1198957&quot;&gt;this gist&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;OSX&lt;/h2&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;      &lt;span class=&quot;c&quot;&gt;#0. Setup some stuff&lt;/span&gt;
      &lt;span class=&quot;nv&quot;&gt;db_name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;name&amp;#39;&lt;/span&gt;
      &lt;span class=&quot;nv&quot;&gt;db_user&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;user&amp;#39;&lt;/span&gt;

      &lt;span class=&quot;c&quot;&gt;# As in Postgres 9.0.1 in brew initdb causes some malloc issues&lt;/span&gt;
      sudo sysctl -w kern.sysv.shmall&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;65536
      sudo sysctl -w kern.sysv.shmmax&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;16777216

      &lt;span class=&quot;c&quot;&gt;# To make the changes permanent instead of just the running kernel&lt;/span&gt;
      &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;kern.sysv.shmall=65536\nkern.sysv.shmmax=16777216&amp;quot;&lt;/span&gt; &amp;gt;&amp;gt; /etc/sysctl.conf

      &lt;span class=&quot;c&quot;&gt;#1. Install PostgreSQL postgis and postgres&lt;/span&gt;

      brew install postgis
      initdb /usr/local/var/postgres
      pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start

      &lt;span class=&quot;c&quot;&gt;#2. Create a template to be used on creating GIS-enabled databases&lt;/span&gt;

      createdb postgis_template
      createlang plpgsql postgis_template

      &lt;span class=&quot;c&quot;&gt;# Import Postgis Data&lt;/span&gt;
      psql -d postgis_template -f
      /usr/local/Cellar/postgis/1.5.3/share/postgis/postgis.sql
      psql -d postgis_template -f
      /usr/local/Cellar/postgis/1.5.3/share/postgis/spatial_ref_sys.sql

      &lt;span class=&quot;c&quot;&gt;# Test if works&lt;/span&gt;
      psql -d postgis_template -c &lt;span class=&quot;s2&quot;&gt;&amp;quot;SELECT postgis_full_version();&amp;quot;&lt;/span&gt;

      &lt;span class=&quot;c&quot;&gt;#3. Set template permissions to gisgroup&lt;/span&gt;
      createuser -R -S -L -D -I gisgroup;

      psql -d postgis_template
      ALTER DATABASE postgis_template OWNER TO gisgroup;
      ALTER TABLE geometry_columns OWNER TO gisgroup;
      ALTER TABLE spatial_ref_sys OWNER TO gisgroup;
      CREATE SCHEMA gis_schema AUTHORIZATION gisgroup;
      &lt;span class=&quot;se&quot;&gt;\q&lt;/span&gt;

      &lt;span class=&quot;c&quot;&gt;#4. Adds an app to your application&lt;/span&gt;
      createuser -i -l -S -R -P -d &lt;span class=&quot;nv&quot;&gt;$db_user&lt;/span&gt;

      &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;GRANT gisgroup TO $db_user;\q&amp;quot;&lt;/span&gt; | psql -d postgres

      &lt;span class=&quot;c&quot;&gt;#5. Create your app database&lt;/span&gt;
      createdb -T postgis_template -O &lt;span class=&quot;nv&quot;&gt;$db_user&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$db_name&lt;/span&gt;;
    
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;h2&gt;Debian&lt;/h2&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;      &lt;span class=&quot;c&quot;&gt;#0. Setup some stuff&lt;/span&gt;
      &lt;span class=&quot;nv&quot;&gt;db_name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;name&amp;#39;&lt;/span&gt;
      &lt;span class=&quot;nv&quot;&gt;db_user&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;user&amp;#39;&lt;/span&gt;

      &lt;span class=&quot;c&quot;&gt;#1. Install PostgreSQL postgis and postgres&lt;/span&gt;

      sudo apt-get install postgresql postgresql-client postgresql-contrib
      sudo apt-get install postgresql-8.4-postgis

      &lt;span class=&quot;c&quot;&gt;#2. Create a template to be used on creating GIS-enabled databases&lt;/span&gt;

      sudo su postgres

      createdb postgis_template
      createlang plpgsql postgis_template

      &lt;span class=&quot;c&quot;&gt;#Import Postgis Data&lt;/span&gt;
      psql -d postgis_template -f
      /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql
      psql -d postgis_template -f
      /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql

      &lt;span class=&quot;c&quot;&gt;#Test if works&lt;/span&gt;
      psql -d postgis_template -c &lt;span class=&quot;s2&quot;&gt;&amp;quot;SELECT postgis_full_version();&amp;quot;&lt;/span&gt;

      &lt;span class=&quot;c&quot;&gt;#3. Set template permissions to gisgroup&lt;/span&gt;
      createuser -R -S -L -D -I gisgroup;

      psql -d postgis_template
      ALTER DATABASE postgis_template OWNER TO gisgroup;
      ALTER TABLE geometry_columns OWNER TO gisgroup;
      ALTER TABLE spatial_ref_sys OWNER TO gisgroup;
      CREATE SCHEMA gis_schema AUTHORIZATION gisgroup;
      &lt;span class=&quot;se&quot;&gt;\q&lt;/span&gt;

      &lt;span class=&quot;c&quot;&gt;#4. Adds an app to your application&lt;/span&gt;
      createuser -i -l -S -R -P -d &lt;span class=&quot;nv&quot;&gt;$db_user&lt;/span&gt;

      &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;GRANT gisgroup TO $db_user;\q&amp;quot;&lt;/span&gt; | psql -d postgres

      &lt;span class=&quot;c&quot;&gt;#5. Create your app database&lt;/span&gt;
      createdb -T postgis_template -O &lt;span class=&quot;nv&quot;&gt;$db_user&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$db_name&lt;/span&gt;;
    
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;



</content>
  </entry>
  
  <entry>
    <title>Easy websockets with Cuba</title>
    <link href="/cuba/websockets/2011/12/23/easy-websockets-with-cuba.html"/>
    <updated>2011-12-23T00:00:00-02:00</updated>
    <id>http://elcuervo.co/cuba/websockets/2011/12/23/easy-websockets-with-cuba</id>
    <content type="html">&lt;p&gt;I have the urge to find simple solutions to complex problems, in that mad quest i've found myself reading extremely long libraries that do things in complicated ways just to have more 'features'. Nowdays the web only wants to add realtime in any sentence and thanks to HTML5 and Websockets it's a pretty easy thing to do but... doing that with ruby gets overcomplicated.&lt;/p&gt;

&lt;p&gt;Trying to find a simple solution i've researched a lot. I've found
&lt;a href=&quot;http://github.com/lifo/cramp&quot;&gt;Cramp&lt;/a&gt; to work pretty well, but requiring
activesupport it's against my religion :D.&lt;/p&gt;

&lt;p&gt;After some googling and githubbing i've found
&lt;a href=&quot;https://github.com/imanel/websocket-rack&quot;&gt;websocket-rack&lt;/a&gt; which is a clean and
simple solution for a problem that it's actually simple.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;      &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;cuba&amp;#39;&lt;/span&gt;
      &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;rack/websocket&amp;#39;&lt;/span&gt;

      &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Websockets&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Rack&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;WebSocket&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Application&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;on_open&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;env&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
          &lt;span class=&quot;n&quot;&gt;send_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;Welcome&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

        &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;on_message&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;env&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
          &lt;span class=&quot;n&quot;&gt;send_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;reverse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

      &lt;span class=&quot;no&quot;&gt;Cuba&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;ws&amp;quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Websockets&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

        &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
          &lt;span class=&quot;n&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;write&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;The websockets are in /ws&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;This is a silly example, but enough in most of the cases, in here you will have
to choose a way to id the clients and send them some messages but that's the fun
part.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Gerbil, TDD for the rest of us</title>
    <link href="/tdd/js/2011/12/02/gerbil-tdd-for-the-rest-of-us.html"/>
    <updated>2011-12-02T00:00:00-02:00</updated>
    <id>http://elcuervo.co/tdd/js/2011/12/02/gerbil-tdd-for-the-rest-of-us</id>
    <content type="html">&lt;p&gt;Gerbil is my attempt to use a really simple (for real) tdd framework in js, both browser and node.js. The main idea is to provide a simple way to test certain behaviours like assert, assertEqual, assertThrow, etc. Currently the API in really simple and will eventually include some cool features.&lt;/p&gt;

&lt;p&gt;Most of the time the tests that we need to execute are not THAT complex, one of
my side project is &lt;a href=&quot;http://github.com/elcuervo/lodis&quot;&gt;Lodis&lt;/a&gt; an implementation
in javascript of the well known &lt;a href=&quot;http://redis.io&quot;&gt;Redis Server&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For it i'm using LocalStorage as foundation to implement the Redis commands, for
that i needed a way to test things in the browser. But all of it seemed so
complex for a simple console.log.&lt;/p&gt;

&lt;p&gt;So i started that, a REALLY SIMPLE testing suite to do that, assert to
console.log. Eventually i've needed some other things so it grow enough to
release it.&lt;/p&gt;

&lt;h2&gt;Install&lt;/h2&gt;

&lt;p&gt;You can see the project in &lt;a href=&quot;http://github.com/elcuervo/gerbil&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using &lt;a href=&quot;http://npmjs.org/&quot;&gt;npm&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;npm install gerbil
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Or in a browser&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;https://raw.github.com/elcuervo/gerbil/master/build/gerbil.pack.js
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;h2&gt;A simple example&lt;/h2&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;&lt;span class=&quot;nx&quot;&gt;scenario&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;This is my scenario&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;setup&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// When scenario starts&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;someThing&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Thing&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;before&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// Before every test&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;someThing&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;magic_magic&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;after&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// After every test&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;someThing&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;clean&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;cleanup&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// When the scenario ends&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;someThing&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;

  &lt;span class=&quot;s2&quot;&gt;&amp;quot;MagicClass should have a length&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;someThing&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;assertEqual&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;someThing&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;

  &lt;span class=&quot;s2&quot;&gt;&amp;quot;MagicClass should be valid&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;assert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;someThing&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;valid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;h2&gt;Example output&lt;/h2&gt;

&lt;h3&gt;Console&lt;/h3&gt;

&lt;p&gt;As i said node.js is supported so the output will look like this:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/posts/gerbil-tdd-for-the-rest-of-us/console-output.png&quot; alt=&quot;Console Output&quot; /&gt;
&lt;img src=&quot;/images/posts/gerbil-tdd-for-the-rest-of-us/error-output.png&quot; alt=&quot;Console Output&quot; /&gt;&lt;/p&gt;

&lt;h3&gt;Browser&lt;/h3&gt;

&lt;p&gt;On the other hand if you ran it within a browser by default the output will be
like this:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/posts/gerbil-tdd-for-the-rest-of-us/browser-output.png&quot; alt=&quot;Browser Output&quot; /&gt;&lt;/p&gt;

&lt;h3&gt;Custom&lt;/h3&gt;

&lt;p&gt;But somethimes you just want to show some thing in your tests so there is a way
to use a custom logger to show your tests any way you want.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;my_cool_logger&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;warn&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;   &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){},&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;log&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;    &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){},&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;info&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;   &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){},&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;error&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;scenario&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;Fancy scenario&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;somewhere over the rainbow&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;assert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;my_cool_logger&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;&lt;img src=&quot;/images/posts/gerbil-tdd-for-the-rest-of-us/custom-logger.png&quot; alt=&quot;Custom Logger&quot; /&gt;&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Backbone Atlas</title>
    <link href="/backbone/atlas/js/coffeescript/2011/05/28/backbone-atlas.html"/>
    <updated>2011-05-28T00:00:00-03:00</updated>
    <id>http://elcuervo.co/backbone/atlas/js/coffeescript/2011/05/28/backbone-atlas</id>
    <content type="html">&lt;p&gt;Backbone-Atlas is an extension for Backbone that provides a cleaner way of loading relations and data within any model. It does not overwrites Backbone.Atlas and helps in having chained relations.&lt;/p&gt;

&lt;p&gt;In an ager for finding a cleaner way for working with Rails but in the client side I started to work with &lt;a href=&quot;http://github.com/documentcloud/backbone.git&quot;&gt;Backbone&lt;/a&gt; and realized that it provides a huge set of tools to create incredible rich client side applications.&lt;/p&gt;

&lt;p&gt;One of the most common helpers to use within a ruby application is current_user and I'd really like to have something similar in my client application. So with that in mind I started to code.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/posts/backbone-atlas/atlas-bone.jpg&quot; alt=&quot;Backbone Atlas&quot; /&gt;
Atlas provides attribute accessibility like ruby instead of using the .get(attr) from backbone. So instead of writing&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;      &lt;span class=&quot;n&quot;&gt;current_user&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;posts&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Now you can do this&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;      &lt;span class=&quot;n&quot;&gt;current_user&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;posts&lt;/span&gt;
    
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;There are some rules to make this extension to work. You must inherit from Backbone.Atlas.Model and you must be explicit in the key you want to use this is an example&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;      &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;vi&quot;&gt;@Post&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Backbone&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Atlas&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Model&lt;/span&gt;
        &lt;span class=&quot;kp&quot;&gt;initialize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;attributes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;
          &lt;span class=&quot;vi&quot;&gt;@has&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;attributes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;comments&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;CommentList&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;author&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;User&lt;/span&gt;
    
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;This will give you an author attribute to the model, initializated nil after creation, if loaded with json data will instance the model for the relation&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;      &lt;span class=&quot;nx&quot;&gt;post&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Post&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Uber Title&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;author&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
          &lt;span class=&quot;nx&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;29&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
          &lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Joe Doe&amp;#39;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
    
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Now accesible like this:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;      &lt;span class=&quot;n&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# =&amp;gt; nil&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;author&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# =&amp;gt; User&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;author&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# =&amp;gt; Joe Doe&lt;/span&gt;
    
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;You can find more in &lt;a href=&quot;http://github.com/elcuervo/backbone-atlas.git&quot;&gt;Backbone Atlas&lt;/a&gt; with more examples. This is really simple but supports deep nesting of objects and relations.&lt;/p&gt;

&lt;p&gt;In a few days a new version will be available, with npm support and internal identity map.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Having fun with QR codes</title>
    <link href="/qr-code/fun/recognition/card/elcuervo/2011/05/20/having-fun-with-qr-codes.html"/>
    <updated>2011-05-20T00:00:00-03:00</updated>
    <id>http://elcuervo.co/qr-code/fun/recognition/card/elcuervo/2011/05/20/having-fun-with-qr-codes</id>
    <content type="html">&lt;p&gt;I wanted to have a cool personal card but I wanted to be a little different and really geek-ish of course. So after some time thinking about the way i get some ideas and ane of them is this. A QR based card with some tweaking to make it appealing.&lt;/p&gt;

&lt;p&gt;Inspired in &lt;a href=&quot;http://whomwah.com/2008/03/12/more-fun-with-qr-codes-and-the-bbc-logo/&quot;&gt;this post&lt;/a&gt; i started the search for some library to create qr codes and thanks to &lt;a href=&quot;http://www.qrme.co.uk/qr-code-resources/understanding-a-qr-code.html&quot;&gt;the error correction&lt;/a&gt; i realized that i have more space in the QR than i thogth.&lt;/p&gt;

&lt;p&gt;A lot of variations can be made and some ads are using this approach to get more people to photograph the qr codes. In my opinion this also helps to extend the social gap between a qr code and a bar code.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/posts/having-fun-with-qr-codes/hbo-example-image.jpg&quot; alt=&quot;HBO&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;http://davidszotten.github.com/prettyqr/&quot;&gt;Pretty QR&lt;/a&gt; library also gave me enoght help to create a really cool qr code and the result is fantastic.
I'm starting to port it to Ruby so hopefully in some time i will be uploading it to github.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Cuba Libre chico</title>
    <link href="/web-framework/cuba/sugar/ruby/2011/05/12/cuba-libre-chico.html"/>
    <updated>2011-05-12T00:00:00-03:00</updated>
    <id>http://elcuervo.co/web-framework/cuba/sugar/ruby/2011/05/12/cuba-libre-chico</id>
    <content type="html">&lt;p&gt;I've been wandering in the Ruby world a year now, from Rails to Sinatra. But sometimes i'd really want things simpler and perhaps more clean of developing web applications. Specially when you can get something fast and get total control. Thats when i've found Cuba a great web framework.&lt;/p&gt;

&lt;p&gt;In that spirit &lt;a href=&quot;https://github.com/soveran/cuba&quot;&gt;Cuba&lt;/a&gt; its a powerful web framework aiming simplicity, speed and clean syntaxt.
Cuba inherits all its power from &lt;a href=&quot;https://github.com/chneukirchen/rack&quot;&gt;Rack&lt;/a&gt; and &lt;a href=&quot;https://github.com/chneukirchen/rum&quot;&gt;Rum&lt;/a&gt; but now overpowers it to make it even cooler.
Being refactored some time ago now looks a lot like &lt;a href=&quot;https://github.com/sinatra/sinatra&quot;&gt;Sinatra&lt;/a&gt; routes, here's an example&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;cuba&amp;#39;&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;Cuba&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# /&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;write&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Home page&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;# /users/:username&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;users/:username&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;username&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;find_by_username&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;username&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# GET /users/:username&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;get&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;write&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Hello, i&amp;#39;m &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# POST /users/:username w/params[:user]&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;param&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;user&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;update_attributes&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;query&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;write&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;user: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; updated!&amp;quot;&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;This encourages a cleaner and simpler way of writing routes, besides it also includes the power of &lt;a href=&quot;https://github.com/rtomayko/tilt.git&quot;&gt;Tilt&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;cuba&amp;#39;&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;Cuba&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;register&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;vi&quot;&gt;@message&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Hello dude!&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;write&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;templates/register.erb&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;I liked Cuba so much i started a little lib to include all the contrib of Cuba, and i called it &lt;a href=&quot;https://github.com/elcuervo/cuba-sugar&quot;&gt;cuba-sugar&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/posts/cuba-libre-chico/cuba-sugar.jpeg&quot; alt=&quot;Cuba Sugar&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Which adds some things not so much, just to make writing a little easier following the way Cuba is doing stuff right now.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;cuba&amp;#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;cuba/sugar&amp;#39;&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;Cuba&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;faq&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# You can output the return of the block as the response&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;s2&quot;&gt;&amp;quot;This are the most common questions&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;fancy&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;vi&quot;&gt;@captcha&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;123456&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;templates/captcha.haml&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;coffee&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# And you can choose what HTTP code and extra headers&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;419&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Content-Type&amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;text/teapot&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;s2&quot;&gt;&amp;quot;I DONT KNOW :((((&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;users/:username/json&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;username&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;find_by_username&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;username&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;as_json&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;           &lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;       &lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;is_it_friday&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;   &lt;span class=&quot;no&quot;&gt;Time&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;now&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;friday?&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;



</content>
  </entry>
  
  <entry>
    <title>More than a Cubox way</title>
    <link href="/personal/work/life/2011/04/19/more-than-a-cubox-way.html"/>
    <updated>2011-04-19T00:00:00-03:00</updated>
    <id>http://elcuervo.co/personal/work/life/2011/04/19/more-than-a-cubox-way</id>
    <content type="html">&lt;p&gt;I know what you might think about writing something of the place you are actually working for, you might think that this is staged, payed for or even forced. You have all the possibilities in the world... and you will be wrong in any which.&lt;/p&gt;

&lt;p&gt;This year will be my tenth aniversay of being working. Yep, 10 years, that's a lot of time, specially if you consider that my first official work was to clean a cybercafe.
But don't take me the wrong way... i've loved each one of my jobs, i've learned a lot about being a professional, a teammate and a boss.&lt;/p&gt;

&lt;p&gt;All my work experiences was pretty much the same: i go to the interview, some silly questions and go to work.
I've met great people who teached me a lot.&lt;/p&gt;

&lt;p&gt;And then i was one year ago, great paycheck, easy job and working in the core of great multinational powering a &lt;a href=&quot;http://en.wikipedia.org/wiki/SMPP&quot;&gt;SMPP&lt;/a&gt; system.
And one day that wasn't enoght, one day the work was not that fun, one day i saw myself in the same old spot, doing the same old thing.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/posts/more-than-a-cubox-way/old-office.jpg&quot; alt=&quot;Cubox old office&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Then a mail arrived, a friend of a friend was looking for someone to code &lt;a href=&quot;http://en.wikipedia.org/wiki/Ruby_(programming_language)&quot;&gt;Ruby&lt;/a&gt;. I only have C, PHP and Python as my everyday tools, but i take that chance.
One small house in a common neighborhood, one cold basement as an enterview room and the thoghfest enterview i've ever faced. There was no psycologhist, no human resources guys... just badass developers with mad questions about the edge tech and things i've only read in wikipedia.&lt;/p&gt;

&lt;p&gt;The truth is that i felt depressed after that enterview, i've felt that i was not enogh developer, that i needed to learn more... and i've loved that feeling. For the first time in years i realized that there's still much road to walk.
I was really surprised when they mailed me to do pairing for a week. I really enjoyed to pair with all of them. I've learn about TDD, git secrets and to feel like part of a team.&lt;/p&gt;

&lt;p&gt;The week was over and they made me an offer... less money than i was needed at the time and less guaranties. I was scared, just moved to a new apartament and a lot of debts in the credit cards. But things like this happen only once so i take the chance.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/posts/more-than-a-cubox-way/lunch.jpg&quot; alt=&quot;Lunch at Cubox&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Months later we moved to a new house, bigger, lighter and in a better location. Founding myself surounded by coding ninjas increased my skills, my open source projects and my ability to grow.
A relaxed enviroment with games, jokes and friends not only make me more productive also for the first time it makes me feel &lt;strong&gt;really&lt;/strong&gt; part of something.
They teached me about Scrum, Lean Startups and Agile Development. &lt;a href=&quot;http://cuboxsa.com&quot;&gt;Cubox&lt;/a&gt; contributes OSS a lot and provides sponsorship if we want to. That's a big change from the places i used to work when you are just a number, just an asset.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/posts/more-than-a-cubox-way/window.jpg&quot; alt=&quot;Cubox Window&quot; /&gt;&lt;/p&gt;

&lt;p&gt;When you work in a place where all the time you are being motivated with tech talks,  retrospectives and even gifts. Yeah, we have T-shirts and new clothes :D.
We do code reviews, debate with blankboards in every wall and talk everyday about the edge technologies in the world.&lt;/p&gt;

&lt;p&gt;We play football, basketball and Paintball.
We drink beers and go out.
We also train together.&lt;/p&gt;

&lt;p&gt;When you &lt;em&gt;work&lt;/em&gt; with real friends and outstanding profesionals actually feeling like working is hard, at least to me.
When you work the &lt;a href=&quot;http://cuboxsa.com&quot;&gt;Cubox&lt;/a&gt; way you ofter forget the work part and just feel it like the only way of really enjoying everyday.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Migration to Github</title>
    <link href="/blog/github/2011/04/16/migration-to-github.html"/>
    <updated>2011-04-16T00:00:00-03:00</updated>
    <id>http://elcuervo.co/blog/github/2011/04/16/migration-to-github</id>
    <content type="html">&lt;p&gt;My journey starting over a blog in a way i really like. The quirks and things i must do to make this blog what it is today. So, after many years having (almost) a blog I've chose the best way of having one, using the incredible http://pages.github.com.  I started the migration a few days ago and i found that for a developer like me having a git-powered blog is the only way to blog.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/posts/migration-to-github/jekyll.png&quot; alt=&quot;Jekyll&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Just using the http://github.com/{username}/{username}.github.com repo will give you the ability of using static pages or &lt;a href=&quot;http://jekyllrb.com&quot;&gt;Jekyll&lt;/a&gt;, the best way of managing a blog.&lt;/p&gt;

&lt;p&gt;If you are curious about this blog, check it out here: &lt;a href=&quot;http://github.com/elcuervo/elcuervo.github.com&quot;&gt;elcuervo.github.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The most amazing thing is the compatibility with different programming languages out of the box&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Go ruby!&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;clojure&quot;&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;defn &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;println &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;



</content>
  </entry>
  
</feed>

