<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom">
	<title>open core</title>
	
	<link href="http://blog.rogeriopvl.com/" />
	<updated>2013-02-22T10:30:48+00:00</updated>
	<id>http://blog.rogeriopvl.com/</id>
	<author>
		<name>Rogério Vicente</name>
		<email>noreply@rogeriopvl.com</email>
	</author>
	
	<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/rogeriopvl" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="rogeriopvl" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><link rel="license" type="text/html" href="http://creativecommons.org/licenses/by-nc-sa/2.5/" /><entry>
		<title>Playing RTMP streaming on Mac with VLC and rtmpdump</title>
		<link href="http://blog.rogeriopvl.com/archives/playing-rtmp-streaming-on-mac-with-vlc-and-rtmpdump" />
		<updated>2013-02-21T00:00:00+00:00</updated>
		<id>http://blog.rogeriopvl.com/archives/playing-rtmp-streaming-on-mac-with-vlc-and-rtmpdump</id>
		<content type="html">&lt;p&gt;VLC is a great piece of software, but currently lacks RTMP support. The good news is that there might be some &lt;a href='http://forum.videolan.org/viewtopic.php?f=7&amp;amp;t=97803'&gt;RTMP support planned for the 2.1 release&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Meanwhile, to fix this, here&amp;#8217;s a simple workaround using &lt;a href='http://rtmpdump.mplayerhq.hu'&gt;rtmpdump&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;First make sure you have rtmpdump installed. If not, you can install it using the &lt;a href='http://mxcl.github.com/homebrew'&gt;Homebrew&lt;/a&gt; package manager:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;brew install rtmpdump
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now make sure you have installed &lt;a href='http://www.videolan.org/vlc/download-macosx.htm[0]:'&gt;VLC&lt;/a&gt; and use the following command to play the RTMP streaming:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;rtmpdump -r rtmp://foobar/live/stream --quiet | /Applications/VLC.app/Contents/MacOS/VLC -
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This will open VLC with a file named &lt;code&gt;fd://0&lt;/code&gt; on the playlist. Just click it and the streaming should be working.&lt;/p&gt;

&lt;p&gt;You can create a &lt;code&gt;vlc&lt;/code&gt; alias to make the command a lot simpler. Just add this in your &lt;code&gt;.bashrc&lt;/code&gt;, &lt;code&gt;.zshrc&lt;/code&gt; or &lt;code&gt;.profile&lt;/code&gt; (choose with one applies) and restart the terminal:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;&lt;span class='nb'&gt;alias &lt;/span&gt;&lt;span class='nv'&gt;vlc&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;/Applications/VLC.app/Contents/MacOS/VLC
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you don&amp;#8217;t like to mess around with long terminal commands, here&amp;#8217;s a bash function that makes it simpler:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;&lt;span class='k'&gt;function &lt;/span&gt;rtmp_open&lt;span class='o'&gt;()&lt;/span&gt; &lt;span class='o'&gt;{&lt;/span&gt;
        rtmpdump -r &lt;span class='nv'&gt;$1&lt;/span&gt; --quiet | /Applications/VLC.app/Contents/MacOS/VLC fd://0 --playlist-autostart
&lt;span class='o'&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Just copy paste this into your &lt;code&gt;.bashrc&lt;/code&gt;, &lt;code&gt;.zshrc&lt;/code&gt; or &lt;code&gt;.profile&lt;/code&gt; (choose which one applies), and restart the terminal.&lt;/p&gt;

&lt;p&gt;I had to use &lt;code&gt;fd://0&lt;/code&gt; instead of &lt;code&gt;-&lt;/code&gt; to refer to &lt;code&gt;stdin&lt;/code&gt; due to a &lt;a href='https://trac.videolan.org/vlc/ticket/7272'&gt;bug in VLC&lt;/a&gt; that ignores the &lt;code&gt;--playlist-autostart&lt;/code&gt; when using &lt;code&gt;-&lt;/code&gt; as input.&lt;/p&gt;

&lt;p&gt;Now to run this handy function just type the name and the URL of the RTMP stream you want to play:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;&lt;span class='nv'&gt;$ &lt;/span&gt;rtmp_open rtmp://foobar/live/stream
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And that&amp;#8217;s it. Enjoy :)&lt;/p&gt;</content>
	</entry>
	
	<entry>
		<title>Raspberry Pi fun</title>
		<link href="http://blog.rogeriopvl.com/archives/raspberry-pi-fun" />
		<updated>2012-08-09T00:00:00+01:00</updated>
		<id>http://blog.rogeriopvl.com/archives/raspberry-pi-fun</id>
		<content type="html">&lt;p&gt;&lt;img alt='Raspberry Pi logo' src='http://blog.rogeriopvl.com/img/2012/08/rbpi_logo.png' /&gt;&lt;/p&gt;

&lt;p&gt;I got my &lt;a href='http://raspberrypi.org'&gt;Raspberry Pi&lt;/a&gt; three days ago, and I&amp;#8217;ve been so busy &amp;#8220;playing&amp;#8221; with it, that I&amp;#8217;m only writing this post now.&lt;/p&gt;

&lt;p&gt;If you&amp;#8217;re living under a rock, let me tell you that the Raspberry Pi is an awesome credit-card sized computer that costs $35. But the Raspberry Pi website puts it better:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Yep, that&amp;#8217;s right: kids. And guess what? All the grown ups are loving it :)&lt;/p&gt;

&lt;p&gt;It&amp;#8217;s mind-blowing the tons of cool things you can do with this little computer. The first thing I did with it was to install &lt;a href='http://raspbian.org'&gt;Raspbian&lt;/a&gt; Wheezy image on the SD card (Debian for the RPi, available in the &lt;a href='http://raspberrypi.org/downloads'&gt;Downloads section of the RPi website&lt;/a&gt;) and put a &lt;a href='http://nodejs.org'&gt;Node&lt;/a&gt; server running on it. The performance is pretty acceptable.&lt;/p&gt;

&lt;p&gt;And there&amp;#8217;s also the community around the RPi. All kinds of people from experienced programmers to beginners are showing off everyday new things that can be done. It&amp;#8217;s a nice way to learn about the lower level stuff that goes on in your computer, and you can use it to control other stuff too, like robots, leds etc.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ll be writing here some of my experiences with the RPi as I get to know it better.&lt;/p&gt;

&lt;p&gt;Meanwhile, here&amp;#8217;s a photo of the unboxing:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Raspberry Pi unboxing' src='http://blog.rogeriopvl.com/img/2012/08/raspberrypi_unbox.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;And a photo of the RPi running headless and being configured through SSH:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Raspberry Pi up and running' src='http://blog.rogeriopvl.com/img/2012/08/raspberrypi_running.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;I bought it from &lt;a href='http://inmotion.pt'&gt;InMotion&lt;/a&gt;, a portuguese online store. So if you are in Portugal, I highly recommend buying your Rpi from this store. It costs about 42€ and the service is very fast (ordered on a thursday and had it on monday).&lt;/p&gt;

&lt;p&gt;So go get one, and feed your inner geek :)&lt;/p&gt;</content>
	</entry>
	
	<entry>
		<title>Nodo v0.2.0 released</title>
		<link href="http://blog.rogeriopvl.com/archives/nodo-v0.2.0-released" />
		<updated>2012-05-29T00:00:00+01:00</updated>
		<id>http://blog.rogeriopvl.com/archives/nodo-v0.2.0-released</id>
		<content type="html">&lt;p&gt;A new version of &lt;a href='http://rogeriopvl.github.com/nodo'&gt;Nodo&lt;/a&gt; is out. Version v0.2.0 has the following features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;New actions &lt;code&gt;star&lt;/code&gt; and &lt;code&gt;unstar&lt;/code&gt; that makes possible to mark ou unmark a task as important.&lt;/li&gt;

&lt;li&gt;UI improvements and some bug fixes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This new version is now available on NPM. To upgrade use:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;npm udpate -g nodo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Please report any issues you find on the &lt;a href='http://github.com/rogeriopvl/nodo/issues'&gt;github issues page&lt;/a&gt;.&lt;/p&gt;</content>
	</entry>
	
	<entry>
		<title>Nodo, the simple command line task manager</title>
		<link href="http://blog.rogeriopvl.com/archives/nodo%3A-the-simple-command-line-task-manager" />
		<updated>2012-05-18T00:00:00+01:00</updated>
		<id>http://blog.rogeriopvl.com/archives/nodo:-the-simple-command-line-task-manager</id>
		<content type="html">&lt;p&gt;&lt;a href='http://rogeriopvl.github.com/nodo'&gt;Nodo&lt;/a&gt; is a command line task manager, and I love it! Why? Mainly because I developed it, second, it does exactly what I needed from a TODO app: it&amp;#8217;s simple, easy and of course, it&amp;#8217;s on the command line.&lt;/p&gt;

&lt;p&gt;I spend most of the time on the command line (I&amp;#8217;m even writing this post on it with &lt;a href='http://vim.org'&gt;Vim&lt;/a&gt;) so it comes natural the fact that I needed to find a task management application that has a &lt;a href='http://en.wikipedia.org/wiki/Command-line_interface'&gt;CLI&lt;/a&gt;, avoiding the constant switch from keyboard to mouse and vice-versa. But still, I used &lt;a href='http://wunderlist.com'&gt;Wunderlist&lt;/a&gt;, an awesome mac/windows/iphone/android TODO app, that was lacking such interface.&lt;/p&gt;

&lt;h4 id='but_there_are_already_command_line_task_managers'&gt;But there are already command line task managers!&lt;/h4&gt;

&lt;p&gt;Yes it&amp;#8217;s true. I&amp;#8217;m not going to mention them all, but let&amp;#8217;s just say that none of them met my criteria. Some where too simple, some were just too complex (like TODO.txt) with tons of commands and options. Also, none of them supported my current Wunderlist database.&lt;/p&gt;

&lt;p&gt;So I developed one task manager that suited my needs.&lt;/p&gt;

&lt;h4 id='in_nodejs_but_i_thought_that_nodejs_was_only_good_at_x'&gt;In Node.js? But I thought that Node.js was only good at X&lt;/h4&gt;

&lt;p&gt;Well, it turns out that Node is actually pretty good at allot of stuff. Including command line apps. But I have to agree that it&amp;#8217;s not the best choice because there are no advantages in having non-blocking IO in this kind of app. But since I&amp;#8217;ve been learning allot of Node lately, I really wanted to put in practice all my newly aquired skills. Also, &lt;a href='http://npm.com'&gt;NPM&lt;/a&gt; is a great package manager, and it&amp;#8217;s ridiculously easy to publish new packages with it, not mentioning that it&amp;#8217;s very interesting the fact that it&amp;#8217;s entirely written in &lt;a href='http://couchdb.com'&gt;CouchDB&lt;/a&gt;.&lt;/p&gt;

&lt;h4 id='ok_so_how_does_nodo_work'&gt;Ok, so how does Nodo work?&lt;/h4&gt;

&lt;p&gt;It&amp;#8217;s pretty simple. It has an NPM package, so you can install it with the &lt;code&gt;npm&lt;/code&gt; command, just like this:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;&lt;span class='nv'&gt;$ &lt;/span&gt;npm install -g nodo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;A few seconds later, Nodo will be installed on your machine.&lt;/p&gt;

&lt;p&gt;After install, Nodo comes with a default list called &amp;#8220;inbox&amp;#8221;. This list is where you should put all the tasks that you are not sure in which list to put them. So, to add a task to the inbox list just type the following:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;&lt;span class='nv'&gt;$ &lt;/span&gt;nodo add inbox go shopping
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Later, you decide to organize your tasks, so let&amp;#8217;s create a list called &amp;#8220;home&amp;#8221; to contain all the home related tasks:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;&lt;span class='nv'&gt;$ &lt;/span&gt;nodo add list home
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And now, you can move your shopping task to this new list. Assuming that the shopping task has id 3:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;&lt;span class='nv'&gt;$ &lt;/span&gt;nodo move 3 home
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After you go shopping you can mark this task as done:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;&lt;span class='nv'&gt;$ &lt;/span&gt;nodo &lt;span class='k'&gt;done &lt;/span&gt;3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This is just the Nodo basics. For the full usage instructions I recommend watching the screencast below, or visiting the &lt;a href='http://rogeriopvl.github.com/nodo'&gt;Nodo page on Github&lt;/a&gt;.&lt;/p&gt;
&lt;div id='video_embed' style='text-align: center;'&gt;
    &lt;iframe frameborder='0' height='337' src='http://player.vimeo.com/video/42330826?title=0&amp;amp;byline=0&amp;amp;portrait=0' width='600'&gt; &lt;/iframe&gt;
&lt;/div&gt;
&lt;p&gt;Currently Nodo does not support adding/editing task notes, or setting a task as important, but these are all just features that are coming in the near future. Feel free to suggest features and/or fixes.&lt;/p&gt;</content>
	</entry>
	
	<entry>
		<title>On using mac instead of linux ...</title>
		<link href="http://blog.rogeriopvl.com/archives/on-using-mac-instead-of-linux" />
		<updated>2012-04-20T00:00:00+01:00</updated>
		<id>http://blog.rogeriopvl.com/archives/on-using-mac-instead-of-linux</id>
		<content type="html">&lt;p&gt;This is a very common and constant discussion at my workplace. And don&amp;#8217;t get me wrong, I love linux. But &lt;a href='http://en.wikipedia.org/wiki/Jamie_Zawinski'&gt;Jamie Zawinski&lt;/a&gt; says it in way that is very similar to what I feel about it:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I use a Mac instead of Linux on the desktop for a reason: because I think that the design and consistency that Apple&amp;#8217;s UI brings is extremely valuable. I don&amp;#8217;t buy computers based on how fast they are, I buy them based on how easy it is to get things done with them, and Apple is the hands-down winner on this pretty much across the board. (Oh, also because I want my audio card to work, but that&amp;#8217;s neither here nor there.)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This quote is taken from a post in his blog where he talks about why he prefers to use Safari instead of Firefox on his mac, and you can read it entirely &lt;a href='http://www.jwz.org/blog/2012/04/why-i-use-safari-instead-of-firefox/'&gt;here&lt;/a&gt;.&lt;/p&gt;</content>
	</entry>
	
	<entry>
		<title>Having fun developing useless apps</title>
		<link href="http://blog.rogeriopvl.com/archives/having-fun-developing-useless-apps" />
		<updated>2012-03-13T00:00:00+00:00</updated>
		<id>http://blog.rogeriopvl.com/archives/having-fun-developing-useless-apps</id>
		<content type="html">&lt;p&gt;I always thought that the first time I got on the &lt;a href='http://news.ycombinator.com'&gt;Hacker News&lt;/a&gt; and &lt;a href='http://reddit.com/r/programming'&gt;Proggit&lt;/a&gt; front-pages would be with some awesome and complex project. I was wrong.&lt;/p&gt;

&lt;h3 id='part_i__like_a_boss'&gt;Part I - Like A Boss&lt;/h3&gt;

&lt;p&gt;On 25th November, while browsing the web, I found a funny project developed by &lt;a href='http://zachholman.com'&gt;Zach Holman&lt;/a&gt; called &lt;a href='http://fuckyeah.herokuapp.com'&gt;Fuck Yeah&lt;/a&gt;. This was a simple API developed in &lt;a href='http://nodejs.org'&gt;Node.js&lt;/a&gt; that received a piece of text, searched Google Images for that piece of text, and added that text along with a &amp;#8220;Fuck Yeah!&amp;#8221; to the first image found.&lt;/p&gt;

&lt;p&gt;I found the project to be pretty cool, and since I got a little rusty with nodejs, I decided to fork the code and make a new version of the API, this time called &lt;a href='http://likeaboss.herokuapp.com'&gt;Like a Boss&lt;/a&gt;. You can pretty much guess what it does. You can check out the code at &lt;a href='http://github.com/rogeriopvl/likeaboss'&gt;Github&lt;/a&gt; by the way.&lt;/p&gt;

&lt;p&gt;Since I had some spare time, I decided to go further and build a website that presented the generated images in a more good looking way. And &lt;a href='http://likeaboss.herokuapp.com'&gt;here&amp;#8217;s the result&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Hack Like A Boss' src='http://blog.rogeriopvl.com/img/hacklikeaboss.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;I decided to post the &amp;#8220;Like a Boss&amp;#8221; website to Hacker News. It got upvoted somehow, and BAM! Hacker News front-page. In 2 hours the website had about 2000 pageviews. This was cool, but not without some problems showing up that had to be solved in order to keep the code from crashing the server. Still, &lt;a href='http://heroku.com'&gt;Heroku&lt;/a&gt;, the cloud application platform I used to host my nodejs app, handled all the traffic pretty well with only one web worker (included with the free plan).&lt;/p&gt;

&lt;p&gt;After about 3 hours, the Hacker News post dropped from the front-page, and traffic almost vanished.&lt;/p&gt;

&lt;h3 id='part_ii__http_cats_api'&gt;Part II - HTTP Cats API&lt;/h3&gt;

&lt;p&gt;On December 14th, again, while browsing the web, someone posted on Hacker News an awesome &lt;a href='http://www.flickr.com/photos/girliemac/sets/72157628409467125/'&gt;Flickr set of cat pictures&lt;/a&gt; authored by &lt;a href='http://twitter.com/girlie_mac'&gt;Tomomi Imura&lt;/a&gt; with each cat posing accordingly to a HTTP Status Code. These pictures ended up being a &lt;a href='http://girliemac.com/blog/2011/12/18/the-day-i-seized-the-interweb-http-status-cats/'&gt;huge success&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I instantly thought about how awesome would be to have those cat images show up when an error occured on a web-server. I fired up &lt;code&gt;vim&lt;/code&gt; and hacked some nodejs code to serve those images through a simple API. After some minutes, the &lt;a href='http://httpcats.herokuapp.com'&gt;HTTP Cats API&lt;/a&gt; was born. I pushed it to Heroku, and it was rocking. I sent the link to a couple of friends, we all laughed for a while and I thought that was it.&lt;/p&gt;

&lt;p&gt;&lt;img alt='HTTP Cat 404 Not Found' src='http://blog.rogeriopvl.com/img/httpcats_404.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;After a while, I posted the API link to Hacker News and Proggit. The Hacker News post never got voted, the Proggit one got allot of upvotes, and soon I was on Proggit front-page. An avalanche of traffic ensued.&lt;/p&gt;

&lt;p&gt;The post got duplicated on Hacker News, and this time it got allot of upvotes (probably a user with more influence). This was when all hell broke loose. Not only it got on the first-page it was also ranked in 2nd place.&lt;/p&gt;

&lt;p&gt;The results where: on the first day I got 19.412 unique visitors. The second day, 21.764 unique visitors. The two days together summed up 255.034 pageviews. These values are amazing for a simple app that serves cat images. Actually, while I write this post, which is 2 months later, it still has around 100 unique visitors a day. And I&amp;#8217;m not even counting direct API calls, just the index page visits.&lt;/p&gt;

&lt;h3 id='so_what'&gt;So what?&lt;/h3&gt;

&lt;p&gt;Yeah, I know these web applications are pretty much useless, but I had allot of fun hacking them and watching the traffic hit the sites. And of course, it doesn&amp;#8217;t really matter the fact that they are useless, as long as you have fun, learn and make other people smile, that&amp;#8217;s what really matters.&lt;/p&gt;</content>
	</entry>
	
	<entry>
		<title>Nginx and the HTTP OPTIONS method</title>
		<link href="http://blog.rogeriopvl.com/archives/nginx-and-the-http-options-method" />
		<updated>2012-01-27T00:00:00+00:00</updated>
		<id>http://blog.rogeriopvl.com/archives/nginx-and-the-http-options-method</id>
		<content type="html">&lt;p&gt;The current version of &lt;a href='http://nginx.com'&gt;Nginx&lt;/a&gt; (1.0.x) doesn&amp;#8217;t seem to support HTTP &lt;a href='http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html'&gt;OPTIONS&lt;/a&gt; requests. It returns &lt;code&gt;405 &amp;quot;Method Not Allowed&amp;quot;&lt;/code&gt; whenever this request is sent.&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s an example using &lt;a href='http://curl.haxx.se'&gt;curl&lt;/a&gt; from the terminal:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='gp'&gt;$&lt;/span&gt; curl -X OPTIONS busydudes.com

&lt;span class='go'&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
&lt;span class='go'&gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;405 Not Allowed&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class='go'&gt;&amp;lt;body bgcolor=&amp;quot;white&amp;quot;&amp;gt;&lt;/span&gt;
&lt;span class='go'&gt;&amp;lt;center&amp;gt;&amp;lt;h1&amp;gt;405 Not Allowed&amp;lt;/h1&amp;gt;&amp;lt;/center&amp;gt;&lt;/span&gt;
&lt;span class='go'&gt;&amp;lt;hr&amp;gt;&amp;lt;center&amp;gt;nginx/1.0.11&amp;lt;/center&amp;gt;&lt;/span&gt;
&lt;span class='go'&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class='go'&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;HTTP OPTIONS requests are essential if you&amp;#8217;re doing &lt;a href='https://developer.mozilla.org/En/HTTP_access_control'&gt;cross-site HTTP requests&lt;/a&gt; and need to obtain the server authorization for the URI where the request originated from.&lt;/p&gt;

&lt;p&gt;To solve this problem I found two solutions.&lt;/p&gt;

&lt;h4 id='solution_1_not_recommended'&gt;Solution 1 (not recommended)&lt;/h4&gt;

&lt;p&gt;If you&amp;#8217;re using another web server behind Nginx and want the request to be handled by that web server, you can trick Nginx into believing that the HTTP status 405 is actually a 200 OK status, so it will just delegate the request to your webserver using the &lt;code&gt;proxy_pass&lt;/code&gt; directive. Just keep in mind that this is an ugly fix. Edit your &lt;code&gt;nginx.conf&lt;/code&gt; file and add the following:&lt;/p&gt;

&lt;p&gt;&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='nginx'&gt;&lt;span class='k'&gt;error_page&lt;/span&gt; &lt;span class='mi'&gt;405&lt;/span&gt; &lt;span class='p'&gt;=&lt;/span&gt;&lt;span class='mi'&gt;200&lt;/span&gt; &lt;span class='s'&gt;@405&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
&lt;span class='k'&gt;location&lt;/span&gt; &lt;span class='s'&gt;@405&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
    &lt;span class='kn'&gt;root&lt;/span&gt; &lt;span class='s'&gt;/&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
    &lt;span class='kn'&gt;proxy_pass&lt;/span&gt; &lt;span class='s'&gt;http://localhost:8080&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
&lt;span class='p'&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;

&lt;h4 id='solution_2'&gt;Solution 2&lt;/h4&gt;

&lt;p&gt;If you&amp;#8217;re just using Nginx as your main server, or just want to obtain the authorization response for the origin domain, then this is definitely the best solution. Edit your &lt;code&gt;nginx.conf&lt;/code&gt; file and add the following:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='nginx'&gt;&lt;span class='k'&gt;location&lt;/span&gt; &lt;span class='s'&gt;/&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
    &lt;span class='kn'&gt;if&lt;/span&gt; &lt;span class='s'&gt;(&lt;/span&gt;&lt;span class='nv'&gt;$request_method&lt;/span&gt; &lt;span class='p'&gt;=&lt;/span&gt; &lt;span class='s'&gt;OPTIONS&lt;/span&gt; &lt;span class='s'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
        &lt;span class='kn'&gt;add_header&lt;/span&gt; &lt;span class='s'&gt;Access-Control-Allow-Origin&lt;/span&gt; &lt;span class='s'&gt;&amp;quot;http://example.com&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
        &lt;span class='kn'&gt;add_header&lt;/span&gt; &lt;span class='s'&gt;Access-Control-Allow-Methods&lt;/span&gt; &lt;span class='s'&gt;&amp;quot;GET,&lt;/span&gt; &lt;span class='s'&gt;OPTIONS&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
        &lt;span class='kn'&gt;add_header&lt;/span&gt; &lt;span class='s'&gt;Access-Control-Allow-Headers&lt;/span&gt; &lt;span class='s'&gt;&amp;quot;Authorization&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
        &lt;span class='kn'&gt;add_header&lt;/span&gt; &lt;span class='s'&gt;Access-Control-Allow-Credentials&lt;/span&gt; &lt;span class='s'&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
        &lt;span class='kn'&gt;add_header&lt;/span&gt; &lt;span class='s'&gt;Content-Length&lt;/span&gt; &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
        &lt;span class='kn'&gt;add_header&lt;/span&gt; &lt;span class='s'&gt;Content-Type&lt;/span&gt; &lt;span class='s'&gt;text/plain&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
        &lt;span class='kn'&gt;return&lt;/span&gt; &lt;span class='mi'&gt;200&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
    &lt;span class='p'&gt;}&lt;/span&gt;
&lt;span class='p'&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You should edit the &lt;code&gt;http://example.com&lt;/code&gt; to match the origin URI you want to allow. If you want to allow any origin just use the &lt;code&gt;*&lt;/code&gt; wildcard.&lt;/p&gt;</content>
	</entry>
	
	<entry>
		<title>Fixing libdlna formula in Homebrew</title>
		<link href="http://blog.rogeriopvl.com/archives/fixing-libdlna-formula-in-homebrew" />
		<updated>2011-12-06T00:00:00+00:00</updated>
		<id>http://blog.rogeriopvl.com/archives/fixing-libdlna-formula-in-homebrew</id>
		<content type="html">&lt;div class='update'&gt;&lt;strong&gt;Update:&lt;/strong&gt; This fix has now been added to the Homebrew package.&lt;/div&gt;
&lt;p&gt;Recently I got an &lt;a href='/img/xbox_xmas.jpg' rel='shadowbox'&gt;XBox 360 for xmas&lt;/a&gt;, and started looking for ways to stream the music in my Macbook Air to it. I found some interesting commercial software to do it, but stumbled upon an open-source linux tool called &lt;a href='http://ushare.geexbox.org'&gt;uShare&lt;/a&gt; that was also available through the &lt;a href='http://mxcl.github.com/homebrew'&gt;Homebrew&lt;/a&gt; package manager.&lt;/p&gt;

&lt;p&gt;Doing a &lt;code&gt;brew install ushare&lt;/code&gt; immediately stopped due to a &lt;code&gt;make install&lt;/code&gt; error of the &lt;code&gt;libdlna&lt;/code&gt; package, a dependency of uShare, that is required for compatibility with Playstation 3. Here&amp;#8217;s the error I got:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='go'&gt;profiles.c: In function &amp;#39;av_profile_get_codecs&amp;#39;:&lt;/span&gt;
&lt;span class='go'&gt;profiles.c:208: error: &amp;#39;CODEC_TYPE_AUDIO&amp;#39; undeclared (first use in this function)&lt;/span&gt;
&lt;span class='go'&gt;profiles.c:208: error: (Each undeclared identifier is reported only once&lt;/span&gt;
&lt;span class='go'&gt;profiles.c:208: error: for each function it appears in.)&lt;/span&gt;
&lt;span class='go'&gt;profiles.c:214: error: &amp;#39;CODEC_TYPE_VIDEO&amp;#39; undeclared (first use in this function)&lt;/span&gt;
&lt;span class='go'&gt;make[1]: *** [profiles.o] Error 1&lt;/span&gt;
&lt;span class='go'&gt;make[1]: *** Waiting for unfinished jobs....&lt;/span&gt;
&lt;span class='go'&gt;make: *** [install] Error 2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This error happens for newer versions of the &lt;code&gt;libavformat&lt;/code&gt; that no longer have the symbols &lt;code&gt;CODEC_TYPE_AUDIO&lt;/code&gt; and &lt;code&gt;CODEC_TYPE_VIDEO&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So, in order to fix the formula you need to apply this patch to the source code of &lt;code&gt;libdlna&lt;/code&gt;. You can find the content of this patch in a &lt;a href='https://gist.github.com/1434147'&gt;github gist&lt;/a&gt;. But to successfully install the Homebrew formula you have to edit the formula file and include this patch in the &lt;code&gt;patches&lt;/code&gt; method:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='gp'&gt;$&lt;/span&gt; brew edit libdnla
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then find the patches method (on line 10) and change the code inside to the following:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='ruby'&gt;&lt;span class='k'&gt;def&lt;/span&gt; &lt;span class='nf'&gt;patches&lt;/span&gt;
  &lt;span class='o'&gt;[&lt;/span&gt;
    &lt;span class='c1'&gt;# fixes ffmpeg locations&lt;/span&gt;
    &lt;span class='s2'&gt;&amp;quot;https://gist.github.com/raw/356431/fbddfeee80d9224f6c67886b119fbd813f3c0ffa/libdlna.patch&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='c1'&gt;# fixes missing symbols for newer versions of libavformat&lt;/span&gt;
    &lt;span class='s2'&gt;&amp;quot;https://gist.github.com/raw/1434147/293ec631536bc34a6e2dd49bb0f30c86f02b1107/libdlna023_fix_symbols.patch&amp;quot;&lt;/span&gt;
  &lt;span class='o'&gt;]&lt;/span&gt;
&lt;span class='k'&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Basically, instead of returning just the patch that was already in the formula as a string, I&amp;#8217;m now returning an array with that patch, and my patch.&lt;/p&gt;

&lt;p&gt;Now just save the file and:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='gp'&gt;$&lt;/span&gt; brew install libdlna
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And then resume the &lt;code&gt;ushare&lt;/code&gt; formula install:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='gp'&gt;$&lt;/span&gt; brew install ushare
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;That&amp;#8217;s it. It should now install without a hassle.&lt;/p&gt;

&lt;p&gt;I submitted this change to the Homebrew project with a &lt;a href='https://github.com/mxcl/homebrew/pull/8981'&gt;pull request&lt;/a&gt;, so anytime soon you won&amp;#8217;t be needing this workaround :)&lt;/p&gt;</content>
	</entry>
	
	<entry>
		<title>Hacker News Stack</title>
		<link href="http://blog.rogeriopvl.com/archives/hacker-news-stack" />
		<updated>2011-05-15T00:00:00+01:00</updated>
		<id>http://blog.rogeriopvl.com/archives/hacker-news-stack</id>
		<content type="html">&lt;p style='text-align:center;'&gt;&lt;img alt='Hacker News Stack logo' src='/img/hn128.png' /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href='https://chrome.google.com/webstore/detail/jcdfcpjmfpbnimkdackbcmdgdpoeklio' title='Hacker News Stack at Chrome Webstore'&gt;Hacker News Stack&lt;/a&gt; is a Chrome extension that improves the readability of the items in the &lt;a href='http://news.ycombinator.com' title='Hacker News website'&gt;Hacker News&lt;/a&gt; website, removing the items that were clicked (read).&lt;/p&gt;

&lt;p&gt;This extension is a page action, that acts on the website. As the user clicks on an item link, the item ID is parsed and stored in the &lt;a href='http://diveintohtml5.org/storage.html' title='HTML5 Storage'&gt;HTML5 storage database&lt;/a&gt; (&lt;code&gt;localStorage&lt;/code&gt;). Automatically this item will be moved to the bottom of the website (marked as read).&lt;/p&gt;

&lt;p&gt;This was a frustrating extension to build because of the fact that the HTML source in the Hacker News website &lt;a href='view-source:http://news.ycombinator.com/' title='View page source (link for Chrome only'&gt;is a total mess&lt;/a&gt;. Parsing it turned out to be an unreliable task, not only because the site layout is done with tables, but also because of the lack of semantics in the markup.&lt;/p&gt;

&lt;p&gt;Anyway, it seems to be working fine (with some minor bugs being taken care off). I&amp;#8217;m currently using it and it&amp;#8217;s making a big difference making me focus only on the news that I didn&amp;#8217;t clicked yet.&lt;/p&gt;
&lt;p style='text-align:center;'&gt;&lt;a href='/img/hnstack1.png' rel='shadowbox[hnstack]' style='border-bottom:0;'&gt;&lt;img alt='Hacker News Stack screenshot 1' src='/img/hnstack1_small.png' style='display:inline;' /&gt;&lt;/a&gt;
&lt;a href='/img/hnstack2.png' rel='shadowbox[hnstack]' style='border-bottom:0;'&gt;&lt;img alt='Hacker News Stack screenshot 2' src='/img/hnstack2_small.png' style='display:inline;' /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can install it from the &lt;a href='https://chrome.google.com/webstore/detail/jcdfcpjmfpbnimkdackbcmdgdpoeklio' title='Hacker News Stack at Chrome Webstore'&gt;Chrome Webstore&lt;/a&gt; or check out the source code at &lt;a href='https://github.com/rogeriopvl/hnstack' title='Hacker News Stack at Github'&gt;Github&lt;/a&gt;.&lt;/p&gt;</content>
	</entry>
	
	<entry>
		<title>hashr 1.0 for Firefox</title>
		<link href="http://blog.rogeriopvl.com/archives/hashr-1.0-for-firefox" />
		<updated>2011-04-11T00:00:00+01:00</updated>
		<id>http://blog.rogeriopvl.com/archives/hashr-1.0-for-firefox</id>
		<content type="html">&lt;p&gt;The hashr Firefox extension has reached version 1.0 with the launch of Firefox 4.&lt;/p&gt;

&lt;p&gt;This new version brings some UI improvements. Some users were complaining about the interface being clunky, it turns out that this was specially true in Firefox for Windows and Linux. I was only testing it on the Mac version, where it looked allot better. So I gave it a slightly better UI and made it consistent between all operating systems where Firefox runs.&lt;/p&gt;

&lt;p&gt;There&amp;#8217;s also a new toolbar button that is added by default on installation. It does the same thing as the addon-bar (aka &lt;a href='http://support.mozilla.com/en-US/kb/what-happened-status-bar'&gt;old status-bar&lt;/a&gt;), it shows/hides the hashr toolbar. It makes hashr more visible to new users after instalation, but it can be removed if you only wish to use the addon-bar button.&lt;/p&gt;

&lt;p&gt;A new version of the website is being (slowly) developed, and also a new version of the &lt;a href='https://chrome.google.com/webstore/detail/dladaomdbdobknaihmoieedebgcdgbkb'&gt;Google Chrome extension&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This new version is already available on the &lt;a href='https://addons.mozilla.org/en-US/firefox/addon/hashr/'&gt;Mozilla Addons&lt;/a&gt; website.&lt;/p&gt;</content>
	</entry>
	
	<entry>
		<title>Codebits 2010 Project - Chatstorm</title>
		<link href="http://blog.rogeriopvl.com/archives/codebits-2010-project-chatstorm" />
		<updated>2010-11-16T00:00:00+00:00</updated>
		<id>http://blog.rogeriopvl.com/archives/codebits-2010-project-chatstorm</id>
		<content type="html">&lt;p&gt;Still recovering from &lt;a href='http://codebits.eu' title='Codebits website'&gt;Codebits 2010&lt;/a&gt;. Congratulations to &lt;a href='http://sapo.pt' title='Sapo web portal'&gt;Sapo&lt;/a&gt; for putting up another awesome edition of this event. Three exausting days of coding, talks, and all kinds of crazy events (yes I&amp;#8217;m looking at you &lt;a href='http://videos.sapo.pt/AmiZBtwvUoUDsc30irCP' title='Nuclear Tacos Video at Codebits 2010'&gt;Nuclear Tacos&lt;/a&gt;)!&lt;/p&gt;

&lt;p&gt;Just like last year, this year, along with my teammates, I had a mission. To create a project and get it ready by the end of the 48 hour hackathon (actually we spent the first 24 hours attending some talks, playing some video-games and trying to &lt;a href='http://farm2.static.flickr.com/1415/5179956615_448e5e1555_b.jpg' rel='shadowbox'&gt;decide what to do&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Once more this mission was accomplished. The project is called &amp;#8220;Chatstorm&amp;#8221;.&lt;/p&gt;

&lt;p&gt;Chatstorm is an online brainstorming web application that uses a real-time chat to share ideas and automatically fetch and suggest web-content related with those ideas. Technically speaking it was developed in &lt;a href='http://nodejs.org' title='Node.js website'&gt;Node.js&lt;/a&gt; (Server-side Javascript) and &lt;a href='http://socket.io' title='Socket.io website'&gt;WebSockets&lt;/a&gt; (Client-side). It was allot of fun to work with these new technologies and to watch the final result.&lt;/p&gt;

&lt;p&gt;Unfortunately, Chatstorm won&amp;#8217;t be available online for now due to it&amp;#8217;s very immature state regarding security, but I&amp;#8217;ll leave you some screenshots and also I hope to post a video of the app in action in the next few days. &lt;p style='text-align:center;'&gt;&lt;a href='http://farm2.static.flickr.com/1265/5180366162_dc81694d1d_b.jpg' rel='shadowbox[Chatstorm]' style='border-bottom:0;'&gt;&lt;img alt='Chatstorm screenshot 1' src='http://farm2.static.flickr.com/1265/5180366162_dc81694d1d_t.jpg' style='display:inline;' /&gt;&lt;/a&gt;
&lt;a href='http://farm2.static.flickr.com/1327/5180366456_3eb5d590cb_b.jpg' rel='shadowbox[Chatstorm]' style='border-bottom:0;'&gt;&lt;img alt='Chatstorm screenshot 2' src='http://farm2.static.flickr.com/1327/5180366456_3eb5d590cb_t.jpg' style='display:inline;' /&gt;&lt;/a&gt;
&lt;a href='http://farm5.static.flickr.com/4127/5179766421_f23aca9151_b.jpg' rel='shadowbox[Chatstorm]' style='border-bottom:0;'&gt;&lt;img alt='Chatstorm screenshot 3' src='http://farm5.static.flickr.com/4127/5179766421_f23aca9151_t.jpg' style='display:inline;' /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;Currently Chatstorm uses &lt;a href='http://fotos.sapo.pt' title='Sapo Fotos website'&gt;Sapo Fotos&lt;/a&gt;, &lt;a href='http://videos.sapo.pt' title='Sapo Vídeos website'&gt;Sapo Vídeos&lt;/a&gt; and &lt;a href='http://twitter.com' title='Twitter website'&gt;Twitter&lt;/a&gt; as sources of information suggestion. But more sources can be easily added just like plugins.&lt;/p&gt;

&lt;p&gt;In the end, we didn&amp;#8217;t managed to get into the top 10 projects, but we got much more positive feedback than last year. Still it was worth it. Mission accomplished and now back to real life, counting the days to Codebits 2011.&lt;/p&gt;

&lt;p&gt;Check my Codebits 2010 photos at Flickr: &lt;a href='http://www.flickr.com/photos/rogeriopvl/sets/72157625396464122/' title='Codebits 2010 Flickr Gallery'&gt;Gallery&lt;/a&gt; or &lt;a href='http://www.flickr.com/photos/rogeriopvl/sets/72157625396464122/show' title='Codebits 2010 Flickr Slideshow'&gt;Slideshow&lt;/a&gt;.&lt;/p&gt;</content>
	</entry>
	
	<entry>
		<title>PHP mcrypt in Snow Leopard with Homebrew</title>
		<link href="http://blog.rogeriopvl.com/archives/php-mcrypt-in-snow-leopard-with-homebrew" />
		<updated>2010-08-16T00:00:00+01:00</updated>
		<id>http://blog.rogeriopvl.com/archives/php-mcrypt-in-snow-leopard-with-homebrew</id>
		<content type="html">&lt;div class='update'&gt;
    &lt;strong&gt;Update:&lt;/strong&gt; This also works on OS X Lion as it is. But just for the sake of correctness you can replace every occurrence of &lt;code&gt;10.6&lt;/code&gt; to &lt;code&gt;10.7&lt;/code&gt; in &lt;code&gt;MACOSX_DEPLOYMENT_TARGET&lt;/code&gt;.
&lt;/div&gt;
&lt;p&gt;If you are using &lt;a href='http://mxcl.github.com/homebrew/'&gt;Homebrew&lt;/a&gt; as your OSX package manager, chances are that you are using the default PHP that comes with Snow Leopard. This PHP installation does not have the &lt;code&gt;mcrypt&lt;/code&gt; extension, so if you are trying to use something like PHPMyAdmin, you&amp;#8217;ll get an error message saying that &lt;code&gt;mcrypt&lt;/code&gt; is not enabled in &lt;code&gt;php.ini&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I googled the answer and found little info about it. I found &lt;a href='http://michaelgracie.com/2009/09/23/plugging-mcrypt-into-php-on-mac-os-x-snow-leopard-10.6.1/'&gt;this post&lt;/a&gt; that it&amp;#8217;s pretty complete but it compiles &lt;code&gt;mcrypt&lt;/code&gt; manually, which is not Homebrew way of doing it. So the purpose of this post is to gather the info for those who are using Homebrew and the default PHP.&lt;/p&gt;

&lt;p&gt;First you have to install &lt;code&gt;mcrypt&lt;/code&gt; with Homebrew, but the current Formula for &lt;code&gt;mcrypt&lt;/code&gt; is not suitable for those on Snow Leopard, so let&amp;#8217;s change it. Open the Formula in your favorite code editor:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='gp'&gt;$&lt;/span&gt; sudo vim /usr/local/Library/Formula/mcrypt.rb 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Note that you only need the &lt;code&gt;sudo&lt;/code&gt; if you did not &lt;code&gt;chown&lt;/code&gt; your &lt;code&gt;/usr/local&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;Now lets change the &lt;code&gt;install&lt;/code&gt; method to this:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='ruby'&gt;&lt;span class='k'&gt;def&lt;/span&gt; &lt;span class='nf'&gt;install&lt;/span&gt;
  &lt;span class='nb'&gt;system&lt;/span&gt; &lt;span class='s2'&gt;&amp;quot;MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS=&amp;#39;-O3 -fno-common -arch i386 -arch x86_64&amp;#39; LDFLAGS=&amp;#39;-O3 -arch i386 -arch x86_64&amp;#39; CXXFLAGS=&amp;#39;-O3 -fno-common -arch i386 -arch x86_64&amp;#39; ./configure --disable-dependency-tracking --prefix=&lt;/span&gt;&lt;span class='si'&gt;#{&lt;/span&gt;&lt;span class='n'&gt;prefix&lt;/span&gt;&lt;span class='si'&gt;}&lt;/span&gt;&lt;span class='s2'&gt; --mandir=&lt;/span&gt;&lt;span class='si'&gt;#{&lt;/span&gt;&lt;span class='n'&gt;man&lt;/span&gt;&lt;span class='si'&gt;}&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;&lt;/span&gt;
  &lt;span class='nb'&gt;system&lt;/span&gt; &lt;span class='s2'&gt;&amp;quot;make -j6&amp;quot;&lt;/span&gt;
  &lt;span class='nb'&gt;system&lt;/span&gt; &lt;span class='s2'&gt;&amp;quot;make install&amp;quot;&lt;/span&gt;
&lt;span class='k'&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Save and run it:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='gp'&gt;$&lt;/span&gt; brew install mcrypt 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Just wait some seconds and you&amp;#8217;re done with this step. After this you might want to undo the changes in the Formula file to avoid git conflicts when updating Homebrew.&lt;/p&gt;

&lt;p&gt;Second, you have to download the PHP 5.3 source to compile the &lt;code&gt;mcrypt&lt;/code&gt; PHP extension and install it. You can download the source from &lt;a href='http://us.php.net/get/php-5.3.0.tar.gz/from/a/mirror'&gt;this link&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Extract the tarball to a directory of your choice, it can be &lt;code&gt;~/Desktop&lt;/code&gt; and then:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='gp'&gt;$&lt;/span&gt; &lt;span class='nb'&gt;cd&lt;/span&gt; ~/Desktop/php-5.3.0/ext/mcrypt 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And type:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='gp'&gt;$&lt;/span&gt; phpize 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Again wait some seconds and when its complete type:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='gp'&gt;$&lt;/span&gt; &lt;span class='nv'&gt;MACOSX_DEPLOYMENT_TARGET&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;10.6 &lt;span class='nv'&gt;CFLAGS&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;-O3 -fno-common -arch i386 -arch x86_64&amp;#39;&lt;/span&gt; &lt;span class='nv'&gt;LDFLAGS&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;-O3 -arch i386 -arch x86_64&amp;#39;&lt;/span&gt; &lt;span class='nv'&gt;CXXFLAGS&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;-O3 -fno-common -arch i386 -arch x86_64&amp;#39;&lt;/span&gt; ./configure --with-php-config&lt;span class='o'&gt;=&lt;/span&gt;/Developer/SDKs/MacOSX10.6.sdk/usr/bin/php-config; make -j6;sudo make install 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Allot will happen and hopefully you won&amp;#8217;t see any errors.&lt;/p&gt;

&lt;p&gt;Now finally you just need to edit the &lt;code&gt;/etc/php.ini&lt;/code&gt; file to enable the extension you just compiled and installed. If you don&amp;#8217;t have a &lt;code&gt;/etc/php.ini&lt;/code&gt; file you need to copy the default config file:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='gp'&gt;$&lt;/span&gt; sudo cp /etc/php.ini.default /etc/php.ini 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And let&amp;#8217;s edit it:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='gp'&gt;$&lt;/span&gt; sudo vim /etc/php.ini 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Find the &lt;code&gt;enable_dl&lt;/code&gt; setting and remove the &lt;code&gt;;&lt;/code&gt; in front of the line (if any) and change it to &lt;code&gt;On&lt;/code&gt;. It should look like this:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='go'&gt;enable_dl = On &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now find the &lt;code&gt;Dynamic Extensions&lt;/code&gt; section of the file and add this line at the end of that section:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='go'&gt;extension=mcrypt.so &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Restart the Apache server and you&amp;#8217;re done. Happy coding!&lt;/p&gt;</content>
	</entry>
	
	<entry>
		<title>Test Driven Development with PHP</title>
		<link href="http://blog.rogeriopvl.com/archives/test-driven-development-with-php" />
		<updated>2010-07-18T00:00:00+01:00</updated>
		<id>http://blog.rogeriopvl.com/archives/test-driven-development-with-php</id>
		<content type="html">&lt;p&gt;This week I had the oportunity to give an introduction talk about Test Driven Development with PHP at &lt;a href='http://www.dri.pt'&gt;DRI&lt;/a&gt; Code Sessions. I&amp;#8217;m no TDD expert, but I&amp;#8217;ve been using this methodology on some of my personal projects, and this was a great way to consolidate what I&amp;#8217;ve been learning and also share and discuss it with other programmers.&lt;/p&gt;

&lt;p&gt;The slides are very concise, as they had the sole purpose of guiding my speech. But I believe that they give, along with the code examples, a good notion of what TDD is about.&lt;/p&gt;

&lt;p&gt;You can find the &lt;a href='http://github.com/rogeriopvl/dri_codesessions_tdd'&gt;code examples&lt;/a&gt; on Github and also the slides in PDF and ODP formats.&lt;/p&gt;
&lt;script src='http://speakerdeck.com/embed/4f4d3b4fb3a003002202e4f2.js'&gt; &lt;/script&gt;</content>
	</entry>
	
	<entry>
		<title>Moved from Wordpress to Jekyll</title>
		<link href="http://blog.rogeriopvl.com/archives/moved-from-wordpress-to-jekyll" />
		<updated>2010-06-27T00:00:00+01:00</updated>
		<id>http://blog.rogeriopvl.com/archives/moved-from-wordpress-to-jekyll</id>
		<content type="html">&lt;p&gt;I&amp;#8217;ve been wanting to leave the &lt;a href='http://wordpress.com' title='Wordpress website'&gt;Wordpress&lt;/a&gt; platform for a while now, and last week I finally managed to start rebuilding this blog with &lt;a href='http://jekyllrb.com' title='Jekyll website'&gt;Jekyll&lt;/a&gt; - a blog-aware, static site generator in Ruby.&lt;/p&gt;

&lt;p&gt;Don&amp;#8217;t get me wrong, I still think that Wordpress is a great blogging/CMS platform. But for me and the purpose of this blog, it has become a little overkill.&lt;/p&gt;

&lt;p&gt;Jekyll is my ideal way to maintain a blog. I get to use my favorite daily work tools (&lt;a href='http://git-scm.com' title='Git website'&gt;Git&lt;/a&gt; and &lt;a href='http://macromates.com' title='Textmate website'&gt;Textmate&lt;/a&gt;) and in terms of performance, static files are just great, no need to spend precious VPS resources. Oh, did I mention that this blog is now running on a VPS? That&amp;#8217;s right, &lt;a href='http://prgmr.com' title='Prgmr website'&gt;prgmr.com&lt;/a&gt; powered. I&amp;#8217;m gradually moving all content in the Dreamhost account to the VPS.&lt;/p&gt;

&lt;p&gt;Regarding the migration, it went almost perfect except for the feed. Feed subscribers may notice some weird behavior, like sudden unread posts showing up that aren&amp;#8217;t new at all and stuff like that. Things will get stable with new posts.&lt;/p&gt;

&lt;p&gt;The blog design has also changed from a modified &lt;a href='http://wordpress.org/extend/themes/simplicitybright' title='Simplicity Bright theme'&gt;Wordpress template&lt;/a&gt; to something built from scratch. This new design keeps things simple and readable, just the way I like. So no fancy stuff, just plain focus on content. And it&amp;#8217;s still being improved along with the markup, so there will be some changes in the next few days.&lt;/p&gt;
&lt;div class='update'&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I&amp;#8217;m now using the &lt;a href='http://code.google.com/apis/webfonts/' title='Google Webfonts API'&gt;Google Webfonts API&lt;/a&gt; to serve the some beautiful fonts. The header title font is &lt;a href='http://code.google.com/webfonts/family?family=Lobster' title='Lobster font'&gt;Lobster&lt;/a&gt;, the body font is &lt;a href='http://code.google.com/webfonts/family?family=Droid+Sans' title='Droid Sans font'&gt;Droid Sans&lt;/a&gt; and the code font is &lt;a href='http://code.google.com/webfonts/family?family=Droid+Sans+Mono' title='Droid Sans Mono font'&gt;Droid Sans Mono&lt;/a&gt;. If your browser does not support Webfonts the CSS will fallback to Georgia, the original font of this blog.&lt;/p&gt;
&lt;/div&gt;</content>
	</entry>
	
	<entry>
		<title>Using Things with Dropbox</title>
		<link href="http://blog.rogeriopvl.com/archives/using-things-with-dropbox" />
		<updated>2010-03-28T00:00:00+00:00</updated>
		<id>http://blog.rogeriopvl.com/archives/using-things-with-dropbox</id>
		<content type="html">&lt;p&gt;&lt;a href='http://culturedcode.com/things/'&gt;Things&lt;/a&gt; is probably one of the best task management applications for Mac that I've come across. And the only that I didn't completely forgot after 2-3 days. The iPhone/iPod app is just the cherry on top of the cake. You can sync with your Mac app and all.&lt;/p&gt;&lt;p&gt;The one feature Things is missing (besides being Mac only), is sync between different computers. I constantly use 2 Macs (personal and work) so this was a major turn off. But that's where &lt;a href='https://www.dropbox.com/home'&gt;Dropbox&lt;/a&gt; kicks in and saves the day.&lt;/p&gt;&lt;p&gt;Although not very explicit, Things has the option to select the location of your tasks database. So it's pretty much obvious: save the database in a Dropbox folder, configure all your Things apps to use the new database location and you're done.&lt;/p&gt;&lt;p&gt;This is where you're Things database is stored:&lt;/p&gt;&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='go'&gt; ~/Library/Application Support/Cultured Code/ &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Just copy the &lt;code&gt;Things/&lt;/code&gt; folder that lives in the path above to your Dropbox and then open the Things app pressing simultaneously the option key (alt). A popup will show up asking you to choose the library (database) location:&lt;/p&gt;&lt;p style='text-align: center;'&gt;&lt;a href='http://blog.rogeriopvl.com/img/2010/03/ChooseALibraryDialog.jpg' rel='shadowbox'&gt;&lt;img alt='Things - Choose A Library Dialog' height='117' src='http://blog.rogeriopvl.com/img/2010/03/ChooseALibraryDialog-300x117.jpg' title='Things - Choose A Library Dialog' width='300' /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Now choose the Things folder in your Dropbox and that's it. Repeat this step for every application that you use on a different Mac, and you're ready to kick some serious ass at &lt;a href='http://en.wikipedia.org/wiki/Getting_Things_Done'&gt;Getting Things Done&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;You can find this info about selecting Things library/database on the &lt;a href='http://culturedcode.com/things/wiki/index.php/Syncing_Things_on_multiple_Macs_%28FAQ%29'&gt;Cultured Code wiki&lt;/a&gt;.&lt;/p&gt;&lt;div class='update'&gt;
&lt;strong&gt;Update:&lt;/strong&gt; One thing I forgot to mention is that this approach I described does not work with multiple Things applications running at the same time in different computers. Because Things only reloads the &lt;code&gt;database.xml&lt;/code&gt; file on startup, if you don't close the application, it won't be aware of the new changes made to the database, and will eventually save the current state over the changes you've made in other instances of the application.
&lt;/div&gt;</content>
	</entry>
	
	<entry>
		<title>hashr for Google Chrome</title>
		<link href="http://blog.rogeriopvl.com/archives/hashr-for-google-chrome" />
		<updated>2010-01-19T00:00:00+00:00</updated>
		<id>http://blog.rogeriopvl.com/archives/hashr-for-google-chrome</id>
		<content type="html">&lt;p&gt;Yesterday I've released &lt;a href='http://rogeriopvl.com/hashr'&gt;hashr&lt;/a&gt; extension for &lt;a href='http://chrome.google.com'&gt;Google Chrome&lt;/a&gt;. This is the first version, and it was just to try out the extensions platform for Google's browser.&lt;/p&gt;&lt;p&gt;So basically this extension does the same as the &lt;a href='https://addons.mozilla.org/en-US//addon/8539/'&gt;Firefox addon&lt;/a&gt;, and the &lt;a href='http://rogeriopvl.com/hashr'&gt;website&lt;/a&gt;, but in Chrome. Here's a screenshot of it in action:&lt;/p&gt;&lt;p style='text-align:center;'&gt;&lt;a href='http://blog.rogeriopvl.com/img/2010/01/screen1.png' rel='shadowbox'&gt;&lt;img alt='hashr chrome extension' class='aligncenter size-medium wp-image-736' height='176' src='http://blog.rogeriopvl.com/img/2010/01/screen1-300x176.png' title='hashr for chrome' width='300' /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;You can find more screenshots, info and install it at the &lt;a href='https://chrome.google.com/extensions/detail/dladaomdbdobknaihmoieedebgcdgbkb'&gt;Extension Gallery page&lt;/a&gt;. Or you can just check out the source at &lt;a href='http://github.com/rogeriopvl/hashr'&gt;GitHub&lt;/a&gt;.&lt;/p&gt;</content>
	</entry>
	
	<entry>
		<title>Tinyscrobbler</title>
		<link href="http://blog.rogeriopvl.com/archives/tinyscrobbler" />
		<updated>2010-01-17T00:00:00+00:00</updated>
		<id>http://blog.rogeriopvl.com/archives/tinyscrobbler</id>
		<content type="html">&lt;p&gt;On my spare time I've been learning the &lt;a href='http://www.ruby-lang.org'&gt;Ruby&lt;/a&gt; language. And &lt;a href='http://github.com/rogeriopvl/tinyscrobbler'&gt;Tinyscrobbler&lt;/a&gt; is the first result.&lt;/p&gt;&lt;p&gt;Tinyscrobbler is a lightweight &lt;a href='http://last.fm'&gt;Last.fm&lt;/a&gt; scrobbler library. It can be used to implement the track scrobbling feature in a ruby player app.&lt;/p&gt;&lt;p&gt;You can find the source (GitHub) &lt;a href='http://github.com/rogeriopvl/tinyscrobbler'&gt;here&lt;/a&gt; and install the ruby gem from &lt;a href='http://gemcutter.org/gems/tinyscrobbler'&gt;Gemcutter&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;If you opt to install from Gemcutter, you need to add it to your gem sources. Just type the following in your terminal (depending on your system you might need to execute these commands with &lt;code&gt;sudo&lt;/code&gt;):&lt;/p&gt;&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='gp'&gt;$&lt;/span&gt; gem sources -a http://gemcutter.org
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will add gemcutter to your gem sources. Finally to install the gem just type:&lt;/p&gt;&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='gp'&gt;$&lt;/span&gt; gem install tinyscrobbler
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Tinyscrobbler contains a helper class to read the audio files metadata, but for now it only supports &lt;code&gt;.mp3&lt;/code&gt; files. I'll be working on extending the support to other file formats like &lt;code&gt;.ogg&lt;/code&gt;, &lt;code&gt;.mp4a&lt;/code&gt; and &lt;code&gt;.wma&lt;/code&gt;.&lt;/p&gt;</content>
	</entry>
	
	<entry>
		<title>New website and api for hashr</title>
		<link href="http://blog.rogeriopvl.com/archives/new-website-and-api-for-hashr" />
		<updated>2009-12-10T00:00:00+00:00</updated>
		<id>http://blog.rogeriopvl.com/archives/new-website-and-api-for-hashr</id>
		<content type="html">&lt;p&gt;Finally I just got some time to update the &lt;a href='http://rogeriopvl.com/hashr'&gt;hashr&lt;/a&gt; website.&lt;/p&gt;&lt;p&gt;I decided to give it some color and some usability improvements. The resulting hash now shows up in a readonly text box so that when you choose long hash algorithms like &lt;a href='http://en.wikipedia.org/wiki/Whirlpool_(cryptography)'&gt;whirlpool&lt;/a&gt; the hash doesn't break the website design.&lt;/p&gt;&lt;p&gt;Also related with this change it's the copy button. I know, I hate flash too, but unfortunately due to security issues like &lt;a href='http://blogs.pcmag.com/securitywatch/2008/08/more_on_the_clipboardjacking_a.php'&gt;clipboard-jacking&lt;/a&gt;, there's no cross-browser compatible way to place text in user's clipboard unless you use flash and the user clicks that.&lt;/p&gt;&lt;p&gt;Anyway, the button is there to make it easy to copy the hash. But you can still do it the usual way.&lt;/p&gt;&lt;p&gt;Apart from the interface changes, hashr now also has a stats page. This page for now only shows a chart of the top 10 most used hashing algorithms in the website and api and the total generated hashes. But it will have more charts in the future.&lt;/p&gt;&lt;p&gt;And finally I rewrote the api and made it public with some documentation. It now supports &lt;code&gt;xml&lt;/code&gt;, &lt;code&gt;json&lt;/code&gt; and &lt;code&gt;text&lt;/code&gt; responses.&lt;/p&gt;&lt;p&gt;The &lt;a href='https://addons.mozilla.org/en-US/firefox/addon/8539'&gt;Firefox extension&lt;/a&gt; is still using the old api, but soon I'll upload to &lt;a href='http://addons.mozilla.com'&gt;Mozilla Addons&lt;/a&gt; a new version using the new one.&lt;/p&gt;</content>
	</entry>
	
	<entry>
		<title>Codebits project - Got Gigs?</title>
		<link href="http://blog.rogeriopvl.com/archives/codebits-project-got-gigs" />
		<updated>2009-12-07T00:00:00+00:00</updated>
		<id>http://blog.rogeriopvl.com/archives/codebits-project-got-gigs</id>
		<content type="html">&lt;p style='text-align:center;'&gt;&lt;img alt='Got Gigs?' src='http://blog.rogeriopvl.com/img/gotg.jpg' /&gt;&lt;/p&gt;&lt;p&gt;In the last 3 days I've been at &lt;a href='http://www.sapo.pt'&gt;Sapo&lt;/a&gt; &lt;a href='http://codebits.eu'&gt;Codebits&lt;/a&gt;. It was the first time I attended the event and I can only say that I'll do my best to be at the next one. Three days of absolute awesomeness.&lt;/p&gt;&lt;p&gt;The programming contest was sort of an endurance test. Thirty two hours awake, most of them coding like mad (with some PES2009,  lots of pizza and redbull in between).&lt;/p&gt;&lt;p&gt;And the final output of the contest was an iPhone app called &lt;code&gt;Got Giggs?&lt;/code&gt;. The project consists of not only an iPhone app, but also a web app that fetches concerts from a given country/city from the &lt;a href='http://www.last.fm/api'&gt;Last.fm&lt;/a&gt; api and a public api that serves them from our database in various formats including JSON, XML etc.&lt;/p&gt;&lt;p&gt;The iPhone app was built using &lt;a href='http://phonegap.com'&gt;PhoneGap&lt;/a&gt;. This open source tool let's you build apps for mobile devices like iPhone, Blackberry, Android, etc. using HTML and Javascript. The concept is nice, but the lack of decent documentation and examples makes it a harder challenge than it seems at first hand. But with some persistence and lack of sleep we came up with the app almost complete:&lt;/p&gt;&lt;p&gt;&lt;a href='http://farm3.static.flickr.com/2619/4166108750_ffc8740437.jpg' rel='shadowbox[gotgigs]'&gt;Featured&lt;/a&gt; | &lt;a href='http://farm3.static.flickr.com/2778/4165425353_487c76d8ee.jpg' rel='shadowbox[gotgigs]'&gt;Soon&lt;/a&gt; | &lt;a href='http://farm3.static.flickr.com/2689/4165425185_f7a16f3c81.jpg' rel='shadowbox[gotgigs]'&gt;All Concerts&lt;/a&gt; | &lt;a href='http://farm3.static.flickr.com/2643/4165425187_3547e7152c.jpg' rel='shadowbox[gotgigs]'&gt;My Bands&lt;/a&gt; | &lt;a href='http://farm3.static.flickr.com/2615/4165425193_1f3584aa27.jpg' rel='shadowbox[gotgigs]'&gt;Settings&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The presentation didn't ran quite well. First I got nervous when I opened the macbook pro on stage and found out that I only had less than 20 minutes of battery. This laptop normally shuts down to sleep on the 10 minute mark.&lt;/p&gt;&lt;p&gt;I had 90 seconds to present the project, but it seemed more like 10 seconds to me. I didn't even had the chance to explain half of the app's features. That's for being a noob presenting projects in public. But well, lesson learned.&lt;/p&gt;&lt;p&gt;Anyway, this project won't stop here. We will continue developing it to reach a final product. The name will be different and will target only musical events in Portugal. So if you're interested in this web app/ iPhone app, check this blog for more updates.&lt;/p&gt;&lt;p&gt;Overall this experience was very enlightening and definitely worth repeating. Next year will be better ;)&lt;/p&gt;</content>
	</entry>
	
	<entry>
		<title>Using git with dropbox</title>
		<link href="http://blog.rogeriopvl.com/archives/using-git-with-dropbox" />
		<updated>2009-11-15T00:00:00+00:00</updated>
		<id>http://blog.rogeriopvl.com/archives/using-git-with-dropbox</id>
		<content type="html">&lt;p&gt;This is just another way to give some use to your &lt;a href='http://www.dropbox.com'&gt;dropbox&lt;/a&gt; account. Although I use &lt;a href='http://git-scm.com/'&gt;git&lt;/a&gt; in this article, you can pretty much do it with any other &lt;a href='http://en.wikipedia.org/wiki/Source_Code_Management'&gt;SCM&lt;/a&gt; tool.&lt;/p&gt;&lt;p&gt;First of all you obviously need a dropbox account. If you don't have one already, go register for one and get 2Gb of free online storage.&lt;/p&gt;&lt;p&gt;Now that you have an account, create a folder on your dropbox and on the web interface and share the folder with some friends if you wish to do so.&lt;/p&gt;&lt;p&gt;All is ready now to start creating the repo. For this post I'm assuming you already have a local git repository of a project called &lt;code&gt;my_killer_app&lt;/code&gt; and that you are working on a unix based operating system like OS X or Linux.&lt;/p&gt;&lt;p&gt;Open up a terminal, and change directory to your project folder:&lt;/p&gt;&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='go'&gt;cd ~/Sites/my_killer_app&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The next step is to clone your existing local repo into the shared dropbox folder:&lt;/p&gt;&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='go'&gt;git clone --bare . ~/Dropbox/shared_folder/my_killer_app.git&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;--bare&lt;/code&gt; option tells git to not include the project files. Only those files needed to track the versioning are cloned (mainly those present in the &lt;code&gt;.git/&lt;/code&gt; folder).&lt;/p&gt;&lt;p&gt;Now you have sort of a remote repository. Although it's on your machine, it's remote to everyone else sharing the folder. But to make things work we need to add this "remote" location and give it an alias:&lt;/p&gt;&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='go'&gt;git remote add my_killer_app ~/Dropbox/shared_folder/my_killer_app.git&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There! It's done. Now you can push your changes to the repository. And pull the changes on another machine with your dropbox account. Also people sharing the folder will be able to do the same.&lt;/p&gt;&lt;p&gt;Just for the sake of completeness, here's how you would make changes and commit them to the "remote" server:&lt;/p&gt;&lt;p&gt;You made changes to the code, now it's time to add and commit:&lt;/p&gt;&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='go'&gt;git commit -a -m &amp;quot;another commit example&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Nice! Now let push them to the "remote" server:&lt;/p&gt;&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='go'&gt;git push my_killer_app master&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Piece of cake.&lt;/p&gt;&lt;p&gt;And here's how a different user sharing the folder would do to collaborate on your project:&lt;/p&gt;&lt;p&gt;Clone the repository:&lt;/p&gt;&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='go'&gt;git clone ~/Dropbox/shared_folder/my_killer_app.git&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Add the alias to remote repository:&lt;/p&gt;&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='go'&gt;git remote add my_killer_app ~/Dropbox/shared_folder/my_killer_app.git&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And that's it! Now it's pull, commit, push. If you need more info on git usage you can check this &lt;a href='http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html'&gt;manual&lt;/a&gt;.&lt;/p&gt;</content>
	</entry>
	
</feed>
