<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>qvister &#187; english</title>
	<atom:link href="http://qvister.se/tag/english/feed/" rel="self" type="application/rss+xml" />
	<link>http://qvister.se</link>
	<description></description>
	<lastBuildDate>Tue, 01 Nov 2011 12:56:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>Nordic Ruby day 2</title>
		<link>http://qvister.se/2011/06/18/nordic-ruby-day-2/</link>
		<comments>http://qvister.se/2011/06/18/nordic-ruby-day-2/#comments</comments>
		<pubDate>Sat, 18 Jun 2011 17:56:47 +0000</pubDate>
		<dc:creator>Anton Lindqvist</dc:creator>
				<category><![CDATA[Blogg]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[konferens]]></category>
		<category><![CDATA[nordicruby]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://qvister.se/?p=1240</guid>
		<description><![CDATA[Second day of Nordic Ruby and here&#8217;s a roundup of some talks I found interesting. Beyond Ruby Jakob Mattson from Burt talked about his view on Ruby as a language. Ruby is often titled as a fully dynamically typed language. Something the speaker wouldn&#8217;t  totally agree upon. Especially when it comes to the dynamic features. He [...]]]></description>
			<content:encoded><![CDATA[<p>Second day of <a href="http://nordicruby.org/">Nordic Ruby</a> and here&#8217;s a roundup of some talks I found interesting.<span id="more-1240"></span></p>
<h4>Beyond Ruby</h4>
<p><a href="http://twitter.com/jakobmattsson">Jakob Mattson</a> from Burt talked about his view on Ruby as a language. Ruby is often titled as a fully dynamically typed language. Something the speaker wouldn&#8217;t  totally agree upon. Especially when it comes to the dynamic features. He made his point clear and we all could agree that everything in Ruby isn&#8217;t dynamic. He did also bring up the false assumption that everything (really everything) is an object in Ruby. For instance the &#8220;<em>end</em>&#8221; statement or the booleans operators (also referred to as &#8220;<em>Chuck Norris</em>&#8221; operators) aren&#8217;t object therefor almost impossible to overwrite their behavior.</p>
<p>I liked the fact that someone had the curage to share a rather critical opinion after lots of Ruby embracing. New programming languages often arises from frustration over the current available ones.</p>
<p><span style="font-weight: bold;">Mountain Dew and My Trail of Tears</span></p>
<p>Aaron Patterson more commonly known as <a href="http://twitter.com/tenderlove">@tenderlove</a> held a real entertaining talk. This man knows how to get every single person in the audience attention during the whole talk. The topic was legacy code and what methods and techniques that can help us dealing with this phenomena on a regular basis.</p>

<p>Overall it was good stuff. A few notes that stuck:</p>
<ul>
<li>Appending the &#8220;<em>w</em>&#8221; flag when using the Ruby binary will output warnings. Ruby 1.9.3 will even inform you when there&#8217;s unused variabels in your code(!).</li>
<li>The &#8220;<em>I</em>&#8221; flag lets you specify the load path when running the Ruby binary from your console. Comes handy if you for instance want to overwrite some dependencies with your own code.</li>
<li>Aaron uses pure Ruby to mock objects during testing.</li>
<li>Deprecation warnings should be omitted if the $VERBOSE variable isn&#8217;t present.</li>
</ul>
<p><strong>&#8220;Legacy&#8221;</strong></p>
<p><a href="http://twitter.com/chadfowler">Chad Fowler</a> a respected and well-known person from the Ruby community did also talk about legacy. But from a totally different perspective.</p>
<p>Legacy isn&#8217;t by all definitions a bad thing. Legacy also means inheritance, gift or benefaction. Take Beethovens symphonies for instance. They&#8217;ve been around for ages by now and can therefor be classified as legacy by all means.</p>
<p>Keeping this definition in mind how do we then make software that stick? Statistics tells us the chances your code will still be around after a five year period of time is close to zero. Definitely worth thinking about.</p>

<p>Also worth mentioning. Nordic Ruby was one of the first conferences I attended that did have a fully mobile optimized website. It&#8217;s even <a href="http://qvister.se/tag/responsive-web-design">responsive</a>! Strangely enough this isn&#8217;t as common as you might assume.</p>
<p>Thanks to all the folks that made Nordic Ruby possible. I will definitely be back next year!</p>
]]></content:encoded>
			<wfw:commentRss>http://qvister.se/2011/06/18/nordic-ruby-day-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Nordic Ruby day 1</title>
		<link>http://qvister.se/2011/06/17/nordic-ruby-day-1/</link>
		<comments>http://qvister.se/2011/06/17/nordic-ruby-day-1/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 17:27:04 +0000</pubDate>
		<dc:creator>Anton Lindqvist</dc:creator>
				<category><![CDATA[Blogg]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[konferens]]></category>
		<category><![CDATA[nordicruby]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://qvister.se/?p=1205</guid>
		<description><![CDATA[Nordic Ruby is a two day conference taking place in Gothenburg, Sweden. This is the second annual year and my first. I arrived yesterday and went straight for a run in the beautiful Slottsparken. Sadly enough I got to tired and had to skip the preparty. Instead I spent some time hacking CoffeeScript which I [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://nordicruby.org/">Nordic Ruby</a> is a two day conference taking place in Gothenburg, Sweden. This is the second annual year and my first.<span id="more-1205"></span></p>
<p>I arrived yesterday and went straight for a run in the beautiful Slottsparken. Sadly enough I got to tired and had to skip the preparty. Instead I spent some time hacking <a href="http://jashkenas.github.com/coffee-script/">CoffeeScript</a> which I recently became very found of.</p>

<p>Below is a short summary of some of the talks that I found interesting.</p>
<h4>GitHub Flavored Ruby</h4>
<p><a href="http://twitter.com/mojombo">Tom Preston-Werner</a>, one of the founders of GitHub, talked about various techniques used internally at GitHub in order to avoid complexity. Which most often tend to grow into a invincibly battle when dealing with software development in general.</p>
<p>Most of techniques is essentially about opposing the <a href="http://en.wikipedia.org/wiki/Waterfall_model">Waterfall model</a> or &#8220;<em>cowboy coding</em>&#8221; as Tom put it.</p>
<p>One technique I did find interesting was <a href="http://tom.preston-werner.com/2010/08/23/readme-driven-development.html">Readme Driven Development</a>. The idea is basically to start of with the readme of your project. Which if often is the initial encounter for your end-users who&#8217;s starting to dig into your project.</p>

<p>Tom also mentioned <a href="http://tomdoc.org/">TomDoc</a> (named after Tom himself) which I hadn&#8217;t heard of before. Finally a &#8220;<em>non-bullshit</em>&#8221; specification for writing code-level documentation with humans and not machines in mind. Similiar specifications like RDoc or phpDoc is a good thing but it forces you to use this strict grammar in order to make it parser friendly. Just like one of the essential foundations of Ruby TomDoc puts the human in center of attention.</p>
<p>Some trivia about Tom to round of. He&#8217;s also the creator of <a href="http://semver.org/">Semantic Versioning</a> which I adopted in almost all of my work by now.</p>
<p>As you might concluded Tom&#8217;s and GitHub&#8217;s contributions to Open source is by far extremely impressive.</p>
<h4>The Limited Red Society</h4>
<p><a href="http://twitter.com/josephwilk">Joseph Wilk</a> from Songkick held an inspiring talk on the subject of testing. Where the &#8220;<em>red society</em>&#8221; is a reference to failing tests. He mentioned and demoed a few tools that can help you gather better insight about your test suite. And especially help you find the pitfalls who either tends to fail most often or consume most of your time.</p>
<p>Rounding of with a quote from the presentation which I found real compelling: &#8220;<em>to measure is to know</em>&#8220;.</p>
<h4>Lightning Talks</h4>
<p>The first day ended with five minutes talks from a bunch of attendees. This was probably the hilight of the day.</p>
<p>Stephen Sykes help a entertaining talk on <a href="http://www.stephensykes.com/obfu_lightening.pdf">obfuscated code</a> and showed of some crazy Ruby one-liners. Great fun!</p>
<p><a href="http://twitter.com/nikolayb">Nikolay</a> talked about what he thought started out as a bad idea. Namely to give all developers on a project the ability to deploy at any time. Doesn&#8217;t sound to bad does it. Well let me put you in to context. We&#8217;re not talking about a regular site. We&#8217;re talking about WordPress.com. Severing around 6 000 000 pageviews a day. Now you might start to realize why this is considered being a bad idea.</p>
<p>One prerequisite to even make this possible in practice is speed. Since the code needs to be deployed to around 1000 servers. This was simply solved by not running any kind of tests before deployment. For any Ruby developer this is considered pure madness. To spice things up he did also confessed that their only using one branch for all their code.</p>
<p>But even how paradoxical this might sound it turnes out this is one of the best decisions made at WordPress.com. Due to the rapid deployment cycle their able to test their code live and get instant feedback. Since deployment occurs that often the changes are quite small and bugs are therefor most often easily to track down.</p>
<p>Last but not least. Ruby is definitely hot stuff. Everybody seems to be hiring.</p>

]]></content:encoded>
			<wfw:commentRss>http://qvister.se/2011/06/17/nordic-ruby-day-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>lastcred.fm</title>
		<link>http://qvister.se/2011/06/01/lastcred-fm/</link>
		<comments>http://qvister.se/2011/06/01/lastcred-fm/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 19:42:34 +0000</pubDate>
		<dc:creator>Anton Lindqvist</dc:creator>
				<category><![CDATA[Blogg]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[music hack day]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://qvister.se/?p=1187</guid>
		<description><![CDATA[This weekend was spent hacking in Berlin at Music Hack Day. The concept of the event is as follows: gather hackers with a passion for music and try building something during 24 consecutive hours. Brilliant if you ask me. I decided to create a service called lastcred.fm. With the following tagline: last.fm without shame. Since I [...]]]></description>
			<content:encoded><![CDATA[
<p>This weekend was spent hacking in Berlin at <a href="http://berlin.musichackday.org/2011/">Music Hack Day</a>. The concept of the event is as follows: gather hackers with a passion for music and try building something during 24 consecutive hours. Brilliant if you ask me.<span id="more-1187"></span></p>
<p>I decided to create a service called <a href="http://lastcred.fm/">lastcred.fm</a>. With the following tagline: last.fm without shame. Since I think we all at some point get ashamed of our last.fm profile lastcred.fm is here to help. The service simply lets you scrobble music from a given set of genres. I highly recommend you giving it a try and save your cluttered last.fm profile!</p>
<p>Built using my favorite framework Ruby on Rails and hosted on Heroku.</p>
<p>Last but not least thanks to <a href="http://www.adriantomic.se/">Adrian</a> for helping me out with the design, <a href="https://twitter.com/jonascarlsson">Jonas</a> for coming up with the tagline and <a href="http://twitter.com/freenerd">Johan</a> and <a href="http://twitter.com/roelven">Roel</a> for organizing a splending Music Hack Day.</p>
]]></content:encoded>
			<wfw:commentRss>http://qvister.se/2011/06/01/lastcred-fm/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why Ruby makes my heart go Boom Boom</title>
		<link>http://qvister.se/2011/02/18/why-ruby-makes-my-heart-go-boom-boom/</link>
		<comments>http://qvister.se/2011/02/18/why-ruby-makes-my-heart-go-boom-boom/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 15:36:53 +0000</pubDate>
		<dc:creator>Anton Lindqvist</dc:creator>
				<category><![CDATA[Blogg]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[keynote]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://qvister.se/?p=1157</guid>
		<description><![CDATA[Today I held a presentation about a real passion of mine which is Ruby. The programing language. The presentation was held at a company called Improove. I came in contact with the company through @andk. A friend of mine. Improove invites speakers on a montly basis to talk about web related topics. The presentation hilights a selection [...]]]></description>
			<content:encoded><![CDATA[<p>Today I held a presentation about a real passion of mine which is Ruby. The programing language.<span id="more-1157"></span></p>
<p>The presentation was held at a company called <a href="http://www.improove.se/" target="_blank">Improove</a>. I came in contact with the company through <a href="http://twitter.com/andk">@andk</a>. A friend of mine. Improove invites speakers on a montly basis to talk about web related topics.</p>
<p>The presentation hilights a selection of features I became very found of in Ruby. All in all the presentation went well and I hopefully inspired a few to start digging into the world of Ruby.</p>
<div id="__ss_6973792" style="width: 500px;"><object id="__sse6973792" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="500" height="420" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=ruby-110218085603-phpapp01&amp;stripped_title=why-ruby-makes-my-heart-go-boom-boom&amp;userName=mptre" /><param name="name" value="__sse6973792" /><param name="allowfullscreen" value="true" /><embed id="__sse6973792" type="application/x-shockwave-flash" width="500" height="420" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=ruby-110218085603-phpapp01&amp;stripped_title=why-ruby-makes-my-heart-go-boom-boom&amp;userName=mptre" name="__sse6973792" allowscriptaccess="always" allowfullscreen="true"></embed></object></div>
]]></content:encoded>
			<wfw:commentRss>http://qvister.se/2011/02/18/why-ruby-makes-my-heart-go-boom-boom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My christmas gift to open source and why you should do the same</title>
		<link>http://qvister.se/2010/12/22/my-christmas-gift-to-open-source-and-why-you-should-do-the-same/</link>
		<comments>http://qvister.se/2010/12/22/my-christmas-gift-to-open-source-and-why-you-should-do-the-same/#comments</comments>
		<pubDate>Wed, 22 Dec 2010 14:32:22 +0000</pubDate>
		<dc:creator>Anton Lindqvist</dc:creator>
				<category><![CDATA[Blogg]]></category>
		<category><![CDATA[christmas]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[gift]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://qvister.se/?p=1119</guid>
		<description><![CDATA[Everyday in both private and workwise matters I encounter and utilize open source solutions. These tools and solutions are made possible by a fantastic bunch of people. Since christmas is just around the corner I want to share the joy with a few of these people. This year I decided to donate a total of $300 [...]]]></description>
			<content:encoded><![CDATA[<p>Everyday in both private and workwise matters I encounter and utilize open source solutions. These tools and solutions are made possible by a fantastic bunch of people. Since christmas is just around the corner I want to share the joy with a few of these people.<span id="more-1119"></span></p>
<p>This year I decided to donate a total of $300 to two people I think have embraced and contributed to the world of open source in a outstanding way. It ain&#8217;t that much but hopefully something.</p>

<h3>Ryan Bates</h3>
<p>Ryan is the author of a fanatstic resource called <a href="http://railscasts.com/" target="_blank">Railscasts</a>. Every week a new screencast if being released where Ryan covers something from the world of Ruby on Rails which he finds interesting. By now almost 250 episodes have been released. Therefor the chance of that gem or functionality you&#8217;re seeking isn&#8217;t yet covered by Ryan is close to nonexistent.</p>
<h3>FUEL PHP5 Framework</h3>
<p>The <a href="http://fuelphp.com/" target="_blank">FUEL framework</a> is definitely the most promising PHP framework out there. I&#8217;ve spent quite an amount of time working with <a href="http://qvister.se/tag/codeigniter/" target="_blank">CodeIgniter</a> during this year. Don&#8217;t get me wrong I really like CodeIgniter but once I tried Ruby on Rails I&#8217;ve been looking for something equivalent written in PHP. FUEL might be the answer to my prayers.</p>
<p>Almost all my work I do for my clients are based upon open source tools. Contributing back is an important matter of keeping this ecosystem healthy and fair. I&#8217;m not asking you to donate cash. But giving somekind back is a nice gesture especially since it&#8217;s christmas.</p>
<p>I&#8217;ve borrowed Ryan Bates <a href="http://railscasts.com/give_back" target="_blank">list</a> filled with ideas on how to contribute back to open source. Slightly modified.</p>
<p>Start of by choosing one tool or solution you&#8217;ve been using alot during the last year. Contribute back by:</p>
<ul>
<li>Making a donation.</li>
<li>Fixing a bug.</li>
<li>Adding documentation.</li>
<li>Or simply thanking them.</li>
</ul>
<p>Go out there and start contributing back to open source!</p>
<p><em>The image in this post is borrowed from <a href="http://www.flickr.com/photos/atxjen/" target="_blank">Jen</a>.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://qvister.se/2010/12/22/my-christmas-gift-to-open-source-and-why-you-should-do-the-same/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Updated SoundCloud API wrapper with OAuth 2.0 support</title>
		<link>http://qvister.se/2010/11/23/updated-soundcloud-api-wrapper-with-oauth-2-0-support/</link>
		<comments>http://qvister.se/2010/11/23/updated-soundcloud-api-wrapper-with-oauth-2-0-support/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 06:56:03 +0000</pubDate>
		<dc:creator>Anton Lindqvist</dc:creator>
				<category><![CDATA[Blogg]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[soundcloud]]></category>

		<guid isPermaLink="false">http://qvister.se/?p=1090</guid>
		<description><![CDATA[I&#8217;m glad to announce the release of version 2.0 of the SoundCloud PHP API wrapper. The wrapper got a complete overhaul including support for authentication using OAuth 2.0. As stated above the wrapper now uses the OAuth 2.0 protocol instead of 1.0. The new shiny updated protocol is in my opinion a huge step forward [...]]]></description>
			<content:encoded><![CDATA[
<p>I&#8217;m glad to announce the release of version 2.0 of the SoundCloud PHP API wrapper. The wrapper got a complete overhaul including support for authentication using <a href="http://oauth.net/2/" target="_blank">OAuth 2.0</a>.<span id="more-1090"></span></p>
<p>As stated above the wrapper now uses the OAuth 2.0 protocol instead of 1.0. The new shiny updated protocol is in my opinion a huge step forward and the authentication flow isn&#8217;t that much of a hazzle anymore.</p>
<p>The wrapper has been written with <a href="http://pear.php.net/" target="_blank">PEAR</a> in mind and can easily be distributed as a PEAR package. The <a href="http://pear.php.net/manual/en/standards.php" target="_blank">PEAR coding standard</a> is also adapted.</p>
<p>Also worth mentioning is that most of the code is now covered by unit tests which makes maintaning and contributing to the project a more gentle matter.</p>
<p>Check out the new <a href="http://soundcloud.qvister.se" target="_blank">demo application</a> or go grab the updated wrapper over at <a href="http://github.com/mptre/php-soundcloud" target="_blank">GitHub</a>.</p>
<p>Happy hacking!</p>
<p><em>Image borrowed from <a href="http://www.flickr.com/photos/pollas/" target="_blank">Anders Pollas</a>.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://qvister.se/2010/11/23/updated-soundcloud-api-wrapper-with-oauth-2-0-support/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Deploy almost anything using Capistrano</title>
		<link>http://qvister.se/2010/04/06/deploy-almost-anything-using-capistrano/</link>
		<comments>http://qvister.se/2010/04/06/deploy-almost-anything-using-capistrano/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 07:33:42 +0000</pubDate>
		<dc:creator>Anton Lindqvist</dc:creator>
				<category><![CDATA[Blogg]]></category>
		<category><![CDATA[capistrano]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://qvister.se/?p=737</guid>
		<description><![CDATA[I recently started digging into the world of Ruby on Rails and quite early came across Capistrano. The whole idea and concept of Capistrano could be explained with their own quite catchy tagline &#8220;Welcome to easyish deployment&#8220;. I&#8217;ve been doing deployment using Git for a while by now. But I find Capistrano more flexible and reliable. [...]]]></description>
			<content:encoded><![CDATA[
<p>I recently started digging into the world of Ruby on Rails and quite early came across <a href="http://www.capify.org/">Capistrano</a>. The whole idea and concept of Capistrano could be explained with their own quite catchy tagline &#8220;<em>Welcome to easy<span style="text-decoration: line-through;">ish</span> deployment</em>&#8220;.<span id="more-737"></span></p>
<p>I&#8217;ve been doing deployment using Git for a while by now. But I find Capistrano more flexible and reliable. Since Capistrano is intended to be used with Ruby on Rails it doesn&#8217;t work with other platforms &#8220;<em>out-of-the-box</em>&#8220;. But magic can still occur with a few lines of code.</p>
<p>Below you&#8217;ll a &#8220;<em>step-by-step</em>&#8221; tutorial on how the get started using Capistrano for easier deployment. The whole idea for this post came in mind during a Capistrano setup for a <a href="http://qvister.se/tag/codeigniter/">Codeigniter</a> application I did recently. But I don&#8217;t see why this deployment process wouldn&#8217;t be applicable on any other platform or framework.</p>
<p>This tutorial assumes you already got your code hosted using either SVN or Git. You preferaly have setup <a href="http://www.linuxquestions.org/linux/answers/Networking/Public_key_authentication_with_ssh">public ssh keys</a> between your computer and the server you&#8217;re deploying to. You&#8217;re using the same directory structure as below for your applications on your server (feel free to change the Capfile in order to match your existing structure).</p>
<pre>/var/www/example.com
/var/www/example.com/www.example.com
/var/www/example.com/www.example.com/logs
/var/www/example.com/www.example.com/public</pre>
<p>Start of by installing Capistrano on your computer. Capistrano is distributed as a Ruby gem.</p>
<pre>$ sudo gem install capistrano</pre>
<p>Next up clone my default Capfile (Capistrano config file) using cURL. Or use the Gist below.</p>
<pre>$ curl "http://gist.github.com/raw/353124/ceda1eccacee7604d7180b23ff20cb618cb760af/capfile.rb" &gt; Capfile</pre>
<p><script src="http://gist.github.com/353124.js?file=capfile.rb"></script></p>
<p>There are some variabels you need to change in order to make this Capfile work with your setup. Basically look through all lines that begins with &#8220;<em>set</em>&#8221; and change the corresponding value. Also make sure to change the server domain on line 10.</p>
<p>A typical Capistrano deployment is loaded with different kind of tasks. Since Capistrano is awesome it allows you to setup own tasks and even overwrite existing tasks.</p>
<p>As mentioned earlier Capistrano was invented with Ruby on Rails in mind, therefor we need to overwrite a few Rails specific tasks (<em>migrate</em>, <em>restart</em>, <em>start</em>). These default tasks are probably not compatible with your application. But feel free to rewrite them if needed.</p>
<p>As you might noticed by now the task &#8220;<em>copy_config</em>&#8221; inside Capfile isn&#8217;t a default task. My Codeigniter applications usually include some setup specific config files that shouldn&#8217;t be included in the repository by obvious reasons. For instance a config file including all necessary MySQL credentials. Therefor these files needs to be setup and edited manually in order to get the application running. But there&#8217;s one problem using this method with Capistrano.</p>
<p>Everytime you deploy using Capistrano a fresh copy of your latest application is being cloned/checkout from the repository and stored inside a new folder on the server. Since Capistrano doesn&#8217;t proceed from the previous deployed release all files that isn&#8217;t included in the repository will <strong>not</strong> be moved to the new deployed release folder. But no worries! Since Capistrano allows us to hook up our own tasks to specific events during deployment we can solve this problem with ease.</p>
<p>The task namned &#8220;<em>copy_config</em>&#8221; is being executed right after the &#8220;<em>symlink</em>&#8221; task. Right after the new release directory has been created and linked to the current directory. Since all my necessary config files are included in the &#8220;<em>.gitignore</em>&#8221; file we can use that as a reference and simply check if the file exists in the previous release folder. If so simply move the file to the newly created release folder. Capistrano provides some nifty <a href="http://www.capify.org/index.php/Variables" target="_blank">variabels</a> such as &#8220;<em>previous_release</em>&#8221; and &#8220;<em>latest_release</em>&#8221; to make this operation easier.</p>
<p>Any other needed operation to get your application up and running should probably be executed after the &#8220;<em>symlink</em>&#8221; task.</p>
<p>Once your Capfile is done it&#8217;s time to run a initial setup deploy. Start of by running the following command.</p>
<pre>$ cap deploy:setup</pre>
<p>You should end up with a similar directory structure on your server.</p>
<pre>/var/www/example.com/www.example.com/public/releases
/var/www/example.com/www.example.com/public/shared
/var/www/example.com/www.example.com/public/shared/log
/var/www/example.com/www.example.com/public/shared/pids
/var/www/example.com/www.example.com/public/shared/system</pre>
<p>It&#8217;s finally time to perform a first initial (cold) deploy of your application to your server.</p>
<pre>$ cap deploy:cold</pre>
<p>Congratulations! You just performed your first deploy using Capistrano. For future deploys the cold task isn&#8217;t necessary. Simply execute the command below.</p>
<pre>$ cap deploy</pre>
<p>Easy enough don&#8217;t you think?</p>
<p>This post should give you a brief idea of the Capistrano workflow. And show how you can hook up your own tasks in order to get your application up and running. I can&#8217;t guarantee that this method can be applicable on your application. As the title states &#8220;<em>&#8230; almost anything</em>&#8220;.</p>
<p>Interested in learning more about Capistrano? Here&#8217;s a <a href="http://delicious.com/mptre/capistrano+blog" target="_blank">few posts</a> that I stumbled across and found interesting during research for this post.</p>
<p><em>Photo credit: </em><a href="http://www.flickr.com/people/heyskinny/" target="_blank"><em>heyskinny</em></a></p>
]]></content:encoded>
			<wfw:commentRss>http://qvister.se/2010/04/06/deploy-almost-anything-using-capistrano/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Server-side Google Analytics</title>
		<link>http://qvister.se/2010/02/02/server-side-google-analytics/</link>
		<comments>http://qvister.se/2010/02/02/server-side-google-analytics/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 11:49:14 +0000</pubDate>
		<dc:creator>Anton Lindqvist</dc:creator>
				<category><![CDATA[Blogg]]></category>
		<category><![CDATA[analytics]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[mobil]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://qvister.se/?p=624</guid>
		<description><![CDATA[In late 2009 Google announced a new Analytics SDK used for tracking events inside iPhone and Android applications. The same release also featured a new method for more accurate tracking running Analytics server-side instead of using JavaScript. This especially comes handy when developing mobile websites. Many older phones suffer from the lack of JavaScript support. [...]]]></description>
			<content:encoded><![CDATA[
<p>In late 2009 Google announced a new Analytics SDK used for tracking events inside iPhone and Android applications. The same release also featured a new method for more accurate tracking running Analytics server-side instead of using JavaScript. This especially comes handy when developing mobile websites.<span id="more-624"></span></p>
<p>Many older phones suffer from the lack of JavaScript support. Which in some cases makes it more complicated to track the user. But running the tracking service server-side will solve this problem easily.</p>
<p>As mentioned earlier Google does offer a server-side solution for Analytics. Sadly enough the documentation is almost non-existing and the only thing provided is some crappy PHP <a href="http://www.google.com/url?sa=D&amp;q=http://www.google.com/analytics/googleanalyticsformobile.zip&amp;usg=AFQjCNEzXGXLA9w0rSdNPKJT-BA0QfJ3MQ">example code</a> to get you started.</p>
<p>Therefor I wrote a simple class in PHP used for interacting with the server-side solution for Analytics. The logic and flow is provided by the existing example code. Below you&#8217;ll find a brief description of the &#8220;<em>flow</em>&#8220;.</p>
<p>A user comes to your site and the url function will generate an uri with all mandatory parameters included. This uri is will be included in the src attribute inside an img element. The browser will then request the uri believing that it&#8217;s an image. The uri will actually be pointing to a executable script. In this script the track function is called. A unique visitor id will be generated and stored inside a cookie. An HTTP-request will be sent to Analytics including all kind of parameters in order to track the user. When the request is done a 1&#215;1 GIF image will be severed in order to satisfy the browser.</p>
<p>The method described above is a quite common way of solving lack of JavaScript related problems.</p>
<p>In order to start using this tracking method you&#8217;ll need to create a new Analytics profile for your website.</p>
<ul>
<li>Create a new profile.</li>
<li>Select &#8220;tracking for a new domain&#8221; or new subdomain if applicable.</li>
<li>Click on the &#8220;Advanced&#8221; tab and choose the mobile option.</li>
<li>Copy your new Analytics ID from the textarea (MO-XXXXXX-XX).</li>
</ul>
<p>The code is available on <a href="http://github.com/mptre/php-ga">GitHub</a> so feel free to fork away! There&#8217;s also a demo included in the repository. Should be just enough to get you started.</p>
<p>To all CodeIgniter fanboys out there. The class works perfectly as a library in CodeIgniter. You just need to make sure to include the uri generated from the url function inside your view. And then point it towards a function in your controller which executes the track function. See the demo inside the repository for further reference.</p>
<p>Happy accurate tracking!</p>
<p><em>Photo credit: <a href="http://www.flickr.com/photos/manfrys/" target="_blank">Antonio Manfredonio</a>.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://qvister.se/2010/02/02/server-side-google-analytics/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

