<?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/"
	>

<channel>
	<title>centresource interactive agency blog &#187; Travis Roberts</title>
	<atom:link href="http://blog.centresource.com/author/troberts/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.centresource.com</link>
	<description>web development &#124; nashville, tn</description>
	<pubDate>Thu, 09 Sep 2010 17:23:18 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>New Features in Rails 3</title>
		<link>http://blog.centresource.com/2010/06/21/new-features-in-rails-3/</link>
		<comments>http://blog.centresource.com/2010/06/21/new-features-in-rails-3/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 15:52:54 +0000</pubDate>
		<dc:creator>Travis Roberts</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[ruby-on-rails]]></category>

		<guid isPermaLink="false">http://blog.centresource.com/?p=1900</guid>
		<description><![CDATA[Here at centresource, we're all about following the newest technology in web development. Rails 3 is coming soon, and it promises to be a significant upgrade.]]></description>
			<content:encoded><![CDATA[<p>Here at centresource, we&#8217;re all about following the newest technology in web development. Rails 3 is coming soon, and it promises to be a significant upgrade. With the 4th beta version pushed recently, and a release candidate right around the corner, I thought now would be a good time to go over my two favorite new features.</p>
<h3>All New Router</h3>
<p>The router has been completely re-written and borrows heavily from the Merb router, but has a more developed DSL.</p>
<p><strong>Regular Routes</strong></p>
<p>Regular routes are more concise, but I&#8217;m not sure how I feel about the &#8220;controller#action&#8221; syntax yet&#8230;</p>
<p><script src="http://gist.github.com/444263.js?file=gistfile1.builder"></script></p>
<p><strong>Named Routes</strong></p>
<p>Very similar to regular routes, just with an extra <code>:as</code> variable at the end.</p>
<p><script src="http://gist.github.com/444263.js?file=gistfile2.builder"></script></p>
<p><strong>Restful Routes</strong></p>
<p>I think restful routes get the biggest improvement. The new syntax is MUCH easier to read than in Rails 2.</p>
<p><script src="http://gist.github.com/444263.js?file=gistfile3.builder"></script></p>
<h3>ActiveRecord and ActiveRelation</h3>
<p>This is probably my favorite addition to Rails. The new ActiveRecord syntax is very similar to <a  href="http://www.doctrine-project.org/" target="_blank">Doctrine</a> (which we use with symfony). Instead of passing options as a hash to your <code>find()</code> method, they&#8217;ve created a bunch of new methods you can chain together.  <script src="http://gist.github.com/444263.js?file=gistfile4.builder"></script></p>
<p>The best part is that any of the query methods just return a relation instead of running the sql query. That way, you can chain more query methods on the relation later. The actual query doesn&#8217;t run until you try to access the object(s) (such as with an iterator). This makes fragment caching a lot easier, because you can keep your query call in your action. Even if the cache is hit, it will only create a relation and not actually query the database. You can also force the query to be run at any time by calling <code>all()</code>, <code>first()</code>, or <code>last()</code> on the relation.</p>
<p>I&#8217;m very excited for the final release of Rails 3 and can&#8217;t wait to actually work on a production project with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.centresource.com/2010/06/21/new-features-in-rails-3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Progressive Enhancements with CSS3</title>
		<link>http://blog.centresource.com/2010/06/14/progressive-enhancements-with-css3/</link>
		<comments>http://blog.centresource.com/2010/06/14/progressive-enhancements-with-css3/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 16:03:24 +0000</pubDate>
		<dc:creator>Travis Roberts</dc:creator>
		
		<category><![CDATA[Web Design]]></category>

		<category><![CDATA[css]]></category>

		<category><![CDATA[css3]]></category>

		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[opera]]></category>

		<category><![CDATA[safari]]></category>

		<guid isPermaLink="false">http://blog.centresource.com/?p=1878</guid>
		<description><![CDATA[CSS3 is great! The themers and designers here at centresource all love the improvements that are now available to (most) modern browsers. The best part of CSS3 is that the changes are subtle, and a site can still look fantastic without using any of the new styles.]]></description>
			<content:encoded><![CDATA[<p>CSS3 is great! The themers and designers here at centresource all love the improvements that are now available to (most) modern browsers. The best part of CSS3 is that the changes are subtle, and a site can still look fantastic without using any of the new styles.</p>
<p>The idea of &#8220;progressive enhancement&#8221; is to get a site looking the way to want in all of the current browsers, then add some enhancements that most of those browsers can understand. It&#8217;s kind of like a bonus for the users of the more progressive browsers. Since they are savvy enough to know what browsers are on top, they can reap the rewards of the polish that CSS3 allows for a website.</p>
<h3>Border Radius</h3>
<p><strong>Supported Browsers</strong>: Chrome, Firefox, Safari, IE9</p>
<p>Border-radius is probably the most useful of the CSS3 attributes. It allows you to add rounded corners to any box item. Using this new property saves a lot of time and divs from the old way of achieving rounded corners with background images. The great thing about border-radius is that it works in all of the major browsers (I&#8217;m not including Opera in this category) except IE8 and below. So, most likely, the majority of your site visitors will see your snazzy rounded corners.</p>
<p><img class="alignnone size-full wp-image-1889" title="border-radius" src="http://blog.centresource.com/wordpress/../wp-content/uploads/2010/06/border-radius.png" alt="border-radius" width="500" height="85" /></p>
<p>You can also target specific corners.</p>
<p><img class="alignnone size-full wp-image-1890" title="border-radius-top-left" src="http://blog.centresource.com/wp-content/uploads/2010/06/border-radius-top-left.png" alt="border-radius-top-left" width="500" height="84" /></p>
<p>Notice that we use the <kbd>border-radius</kbd> attribute (which will eventually be the standard, and which Chrome already understands), but we also include the proprietary attributes <kbd>-moz-border-radius</kbd> for Firefox and <kbd>-webkit-border-radius</kbd> for Safari.</p>
<h3>Text Shadow</h3>
<p><strong>Supported Browsers</strong>: Chrome, Firefox, Opera, Safari</p>
<p>By far my favorite method for adding that last little bit of polish to your site. It&#8217;s amazing how much better a heading or body text looks with a subtle text-shadow added to it. I think it adds a nice level of depth to the text.</p>
<p><img class="size-full wp-image-1888 alignnone" title="text-shadow" src="http://blog.centresource.com/wp-content/uploads/2010/06/text-shadow.png" alt="text shadow example" width="500" height="75" /></p>
<p>It&#8217;s as simple as adding the following line to your CSS:</p>
<p><code>text-shadow:1px 1px #ddd;</code></p>
<h3>RGBA</h3>
<p><strong>Supported Browsers</strong>: Chrome, Firefox, Opera, Safari, IE9</p>
<p>Another great example of a progressive enhancement that makes a site look great, but one that a user of an old browser won&#8217;t miss. RGBA just allows to you define a color with an opacity value (between 0.0 and 1.0) for any place you would normally use a regular RGB color (or hex color). It&#8217;s main uses are for making background or text colors semi-transparent.</p>
<p><img class="alignnone size-full wp-image-1892" title="rgba" src="http://blog.centresource.com/wp-content/uploads/2010/06/rgba.png" alt="rgba" width="500" height="102" /></p>
<h3>Closing Thoughts</h3>
<p>Using CSS3 to add subtle enhancements to your site is a great way to reward your forward-thinking users who are smart enough to run the latest web browsers.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.centresource.com/2010/06/14/progressive-enhancements-with-css3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Deploying symfony Applications with Capistrano</title>
		<link>http://blog.centresource.com/2010/06/02/deploying-symfony-applications-with-capistrano/</link>
		<comments>http://blog.centresource.com/2010/06/02/deploying-symfony-applications-with-capistrano/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 13:10:28 +0000</pubDate>
		<dc:creator>Travis Roberts</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Productivity]]></category>

		<category><![CDATA[Symfony]]></category>

		<category><![CDATA[Utilities]]></category>

		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[capistrano]]></category>

		<category><![CDATA[deployment]]></category>

		<guid isPermaLink="false">http://blog.centresource.com/?p=1727</guid>
		<description><![CDATA[Capistrano is an open source tool for running scripts on multiple servers. It's primary use is for easily deploying applications.]]></description>
			<content:encoded><![CDATA[<p><a  href="http://github.com/capistrano/capistrano" target="_blank">Capistrano</a> is an open source tool for running scripts on multiple servers. It&#8217;s primary use is for easily deploying applications. While it was built specifically for deploying Rails apps, it&#8217;s pretty simple to customize it to deploy other types of applications. We&#8217;ve been working on creating a deployment &#8220;recipe&#8221; to work with symfony applications to make our job a lot easier.</p>
<h3>Prerequisites</h3>
<ul>
<li>Must have SSH access to the server you are deploying to.</li>
<li>Must have Ruby and RubyGems installed on your machine (not required for deployment server)&#8217;</li>
</ul>
<h3>Installing Capistrano</h3>
<p style="padding-left: 30px;"><code>sudo gem install capistrano</code></p>
<h3>Setup your project to use Capistrano</h3>
<p style="padding-left: 30px;"><code>cd path/to/your/app</code><br />
<code>capify .</code></p>
<p>This will create a few files for you. It will create a <code>Capfile</code> in the root of your project. It will also create a directory named config (if it doesn&#8217;t exist already) and place a file named <code>deploy.rb</code> in the config folder. That&#8217;s where you will add/change any application-specific settings for your deployment recipe.</p>
<p>Here are the required settings (just replace with your app-specific variables):</p>
<p><script src="http://gist.github.com/417693.js?file=gistfile1.builder"></script></p>
<h3>Customize Capistrano for symfony</h3>
<p>Now, to get capistrano to play nice with symfony, we have to override some of the built-in functions. You&#8217;ll want to add this to your deploy.rb file:  <script src="http://gist.github.com/417720.js?file=gistfile1.builder"></script></p>
<p>Now, you can start the deployment process! To get your server setup with the file structure that Capistrano expects, you can run
</p>
<p style="padding-left: 30px;"><code>cap deploy:setup</code></p>
<p>This command will create the following folder structure on your server:</p>
<pre>|-- deploy_to_path
  |-- current (symlink)
  |-- releases
    |-- 20100512131539
    |-- 20100509150741
    |-- 20100509145325
  |-- shared
    |-- cached-copy
    |-- log
    |-- pids
    |-- system</pre>
<p>The folders in the releases directory will be the actual deployed code, timestamped. The pids folder in the shared directory is only used for Rails applications, so you can ignore it completely. Capistrano symlinks your log directory from your app to the log directory in the shared folder so that it doesn&#8217;t get erased when you deploy a new version of your code.</p>
<p><strong>This is an important step!</strong> Before you deploy the application for the first time, it&#8217;s really a good idea to scp your databases.yml file up to your server so you can set the proper credentials for your production server and keep it out of your repository. Make sure you put the databases.yml file into the shared/system directory, because we already have a task that will symlink it when each new code version is deployed.</p>
<p>Now, to deploy your application for the first time, you can run:</p>
<p style="padding-left: 30px;"><code>cap deploy:cold</code></p>
<p>This will deploy your application, create the db, models, forms, filters, and run all of your migrations.</p>
<p>Now, whenever you need to deploy a new version of your code, you can just run:</p>
<p style="padding-left: 30px;"><code>cap deploy</code></p>
<p>If you need to deploy and run your migrations you can call:</p>
<p style="padding-left: 30px;"><code>cap deploy:migrations</code></p>
<p>We&#8217;ve also added a custom task to run your test suite on the production server. You can invoke this by calling:</p>
<p style="padding-left: 30px;"><code>cap deploy:testall</code></p>
<p>This will deploy the application, rebuild the test database, then run all of the tests.</p>
<p>If you want to see all of the Capistrano tasks available, you can run:</p>
<p style="padding-left: 30px;"><code>cap -T</code></p>
<p>We&#8217;ve been using this setup for a little while now, and it&#8217;s saved us a ton of time when we need to push changes for a site to the production server.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.centresource.com/2010/06/02/deploying-symfony-applications-with-capistrano/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Tools That Make My Job Easier</title>
		<link>http://blog.centresource.com/2010/01/04/tools-that-make-my-job-easier/</link>
		<comments>http://blog.centresource.com/2010/01/04/tools-that-make-my-job-easier/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 14:00:53 +0000</pubDate>
		<dc:creator>Travis Roberts</dc:creator>
		
		<category><![CDATA[Doctrine]]></category>

		<category><![CDATA[Drupal]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Symfony]]></category>

		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[Mac]]></category>

		<category><![CDATA[orm]]></category>

		<category><![CDATA[vim]]></category>

		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://blog.centresource.com/?p=1255</guid>
		<description><![CDATA[There are a number of tools and tricks that I use to make my job easier. Here are a few of them.]]></description>
			<content:encoded><![CDATA[<h3>Bash Aliases</h3>
<p>Working on a Mac, I spend a lot of my time in Terminal (the command-line utility). This is where I do all of my interaction with my local databases, the central Subversion repository, and issue various system commands. Some of these commands can get quite long and are time consuming to type out. That&#8217;s where aliases come to the rescue!</p>
<p>On a Mac, you can simply edit a file in your home directory called either <tt>.bash_profile</tt> or <tt>.bash_login</tt> (this is a hidden file, so you&#8217;ll have to edit it from the command line). Adding an alias is simple. Let&#8217;s say you have a long command like <tt>php symfony doctrine:build &#8211;all &#8211;and-load=data/fixtures/</tt> (this is the command to build/rebuild the ORM components of a symfony site). That&#8217;s a long command, and one I don&#8217;t want to type out every time I have to run it. The solution, add the following alias:</p>
<p><tt>alias dbal=&#8221;php symfony doctrine:build &#8211;all &#8211;and-load=data/fixtures/&#8221;</tt></p>
<p>Now, instead of typing out that long statement, you only have to type <tt>dbal</tt> as it is now aliased to the command. </p>
<h3>Textmate Snippets</h3>
<p>I do all of my coding in Textmate, which is the absolute best text editor if you are on a Mac (apologies to the <tt>vim</tt> fanboys). Textmate snippets work much in the same way as the aliases I mentioned above. They are shortcuts for pasting in a block of code or performing some function, and there are a LOT of them. I&#8217;m constantly finding new shortcuts that I didn&#8217;t know about. </p>
<p>All snippets are kept in what Textmate refers to as &#8220;bundles&#8221;. You can get an HTML bundle, a Subversion bundle, even a Haskell bundle. The textmate Subversion repository houses all of these bundles, which you can peruse and download at your leisure at <a  href="http://svn.textmate.org/trunk/Bundles/">http://svn.textmate.org/trunk/Bundles/</a></p>
<h3>VMware Fusion</h3>
<p>Fusion is a Mac application that lets you run Microsoft Windows (or Linux) on your Mac. It&#8217;s great for cross-browser testing, because I can have multiple Windows instances. I have an instance for Internet Explorer 6 testing, and a separate instance for testing with Internet Explorer 7 and 8. This is a big time-saver over having to use a completely different computer or several computers to do cross-browser testing of Web sites. </p>
<h3>Apple Spaces</h3>
<p>Apple added the Spaces application for creating virtual desktops to the Leopard version of their Mac OS X operating system. It was one of the changes that I most looked forward to. Basically, this allows you to group application windows onto different virtual &#8220;desktops&#8221;. I have five desktops: one for chat windows (Adium, IRC, Yammer), one for browsing, one for coding, one for email, and one for Photoshop or VMware Fusion. Having only one or two windows on each desktop drastically cuts down on the clutter and helps me navigate between applications much easier. </p>
<h3>Google and Stack Overflow</h3>
<p>You may think Google is a no-brainer but I mentioned it because, while it is helpful for finding information, you really need to know HOW to search to get what you want. That might be a topic for a whole separate blog post, but it makes a big difference in the information that is returned. While keywords are important for the search. Also try searching for your entire question (like &#8220;how to add symfony form validation&#8221;). Chances are, someone has already asked that exact same question, and you can find the post where it was answered. </p>
<p>Stack Overflow (<a  href="http://stackoverflow.com">stackoverflow.com</a>) is another great resource for programming questions. It&#8217;s a forum for asking technical questions and getting answers from other members. If you can&#8217;t find an existing answer to you question, you can ask the masses and usually receive at least one answer within a few hours. I&#8217;ve used this site several times, and the quality of the answers I&#8217;ve received have always been very high.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.centresource.com/2010/01/04/tools-that-make-my-job-easier/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
