<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>Travis Berry</title>
 <link href="http://www.travisberry.com/atom.xml" rel="self"/>
 <link href="http://www.travisberry.com/"/>
 <updated>2013-03-16T20:25:05-06:00</updated>
 <id>http://www.travisberry.com/</id>
 <author>
   <name>Travis Berry</name>
   <email>contact@travisberry.com</email>
 </author>

 
 <entry>
   <title>Help A Scientist</title>
   <link href="http://www.travisberry.com/2013/02/help-a-scientist"/>
   <updated>2013-02-09T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2013/02/help-a-scientist</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Help A Scientist&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/jdhancock/5798526180/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://static-assets3.travisberry.com/post_images/mad_scientist.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: February 09, 2013&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;I try to keep this blog mostly relevant to tech but I'm reposting this from Hospitium to try and get a bigger response.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;Post taken from &lt;a href=&quot;https://hospitium.co/posts/19-help-a-scientist&quot;&gt;hospitium.co&lt;/a&gt; -&lt;/p&gt;

&lt;p&gt;Here at Hospitium we are big fans of people pursuing post-grad degrees, especially in the sciences. That's why we were super excited to help out Alison Kennedy-Benson who is doing her M.S. in Anthrozoology. She recently contacted us and asked if we could help spread a survey for her research. Her thesis is focused on selective intake shelter workers which fits nicely with the user base of Hospitium.&lt;/p&gt;

&lt;p&gt;If you would like to help out, please fill out the survey below.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.surveymonkey.com/s/shelterworkerperspectives&quot;&gt;https://www.surveymonkey.com/s/shelterworkerperspectives&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Simple Multi-File Uploads With Paperclip</title>
   <link href="http://www.travisberry.com/2013/02/simple-multi-file-uploads-with-paperclip"/>
   <updated>2013-02-01T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2013/02/simple-multi-file-uploads-with-paperclip</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Simple Multi-File Uploads With Paperclip&lt;/h3&gt;
  &lt;a href=&quot;http://pixabay.com/pt/paperclips-colorido-anexar-4479/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://static-assets3.travisberry.com/post_images/paperclip.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: February 1, 2013&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;I needed to add multi-file uploads to a rails application recently and was looking for a solution that didn't involve using &lt;a href=&quot;https://code.google.com/p/swfupload/&quot;&gt;swfupload&lt;/a&gt; or anything like that. I was already using &lt;a href=&quot;https://github.com/thoughtbot/paperclip&quot;&gt;paperclip&lt;/a&gt; and I wanted something that was super easy to get running so I went with HTML5 multi-uploads.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;&lt;em&gt;I use a dedicated Document model, depending on how paperclip is setup on your models, you may get different results, or this might not work for you.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;First add a new file form field.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/4695134.js?file=form.erb'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;  &amp;lt;%= form_for Document.new, :url =&amp;gt; documents_path, :remote =&amp;gt; true, :html =&amp;gt; {:multipart =&amp;gt; true} do |f| %&amp;gt;
        &amp;lt;%= f.file_field :filearrays, :multiple =&amp;gt;:true %&amp;gt;
        &amp;lt;%= f.submit &amp;quot;Submit&amp;quot; %&amp;gt;
    &amp;lt;% end %&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Then in the controller create action you can do.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/4695134.js?file=documents_controller.rb'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;params[:document][:filearrays].each do |file|
  @document = Document.new(:document =&amp;gt; file)
  @document.save
end&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;It will handle single files or multiples just fine.&lt;/p&gt;

&lt;p&gt;That should be pretty much all you need to get started. Of course you can improve it by adding some validation to allowed file types, setting a flash message to let the user know if the file was uploaded or not, or anything else you may need.&lt;/p&gt;

&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Moving From IndexTank To IndexDen</title>
   <link href="http://www.travisberry.com/2012/04/moving-from-indextank-to-indexden"/>
   <updated>2012-04-08T00:00:00-06:00</updated>
   <id>http://www.travisberry.com/2012/04/moving-from-indextank-to-indexden</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Moving From IndexTank To IndexDen&lt;/h3&gt;
  &lt;a href=&quot;http://s0.geograph.org.uk/geophotos/02/41/96/2419659_06c1d213.jpg&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://static-assets.travisberry.com/post_images/indexden.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: April 08, 2012&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;A while back I did a post on &lt;a href=&quot;http://www.travisberry.com/2011/02/fast-cakephp-search-with-indextank/&quot;&gt;using IndexTank with CakePHP&lt;/a&gt;. Since then IndexTank has been bought by LinkedIn and will be &lt;a href=&quot;https://indextank.com/documentation/faq2&quot;&gt;shutdown&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Luckily there is a drop in replacement in the form of &lt;a href=&quot;http://indexden.com/&quot;&gt;IndexDen&lt;/a&gt;. I was able to get &lt;a href=&quot;http://homkora.com&quot;&gt;Homkora&lt;/a&gt; switched over in about 30 minutes.&lt;/p&gt;

&lt;p&gt;First signup for an account with IndexDen. Then create the indexes that you need. I recommend calling them whatever you called them in IndexTank, that way there is no need to change the code.&lt;/p&gt;

&lt;p&gt;From the example in the original post&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177288.js?file=example1.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php
function createIndextankClient(){
    App::import('Vendor', 'indextank_client');
    $API_URL = 'YOUR API URL HERE';
    $client = new ApiClient($API_URL);
    return $client;
}
   
function addIndextank($indexType,$id,$data){
    //send project to indextank
    $client = $this-&amp;gt;createIndextankClient();
    $index = $client-&amp;gt;get_index($indexType);
    $doc_id = $id;
    $index-&amp;gt;add_document($doc_id, $data);
}
   
function deleteIndextank($indexType,$id){
    //delete indextank document
    $client = $this-&amp;gt;createIndextankClient();
    $index = $client-&amp;gt;get_index($indexType);
    $index-&amp;gt;delete_document($id);
}
   
function searchIndextank($indexType,$query){
    //search indextank
    $client = $this-&amp;gt;createIndextankClient();
    $index = $client-&amp;gt;get_index($indexType);
    $index-&amp;gt;add_function(2, &amp;quot;relevance&amp;quot;);
    $res = $index-&amp;gt;search($query);
    return $res;
}
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;All you have to change is &lt;code&gt;$API_URL = 'YOUR API URL HERE';&lt;/code&gt; from the IndexTank URL to the IndexDen one.&lt;/p&gt;

&lt;p&gt;That is technically all you need to do to start using IndexDen instead of IndexTank. However, you will notice that none of you records are in the new index.&lt;/p&gt;

&lt;p&gt;A quick way to add them back in is with a simple loop. Staying with the last posts example, here is how I added the projects from Homkora.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/2339198.js?file=projects_controller.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php

function add_to_index() {

    $projects = $this-&amp;gt;Project-&amp;gt;find('all');

    foreach($projects as $project){
        $indexData = array('text'=&amp;gt;$project['Project']['title'],'title'=&amp;gt;$project['Project']['title'],'description'=&amp;gt;$project['Project']['description'],'user_id'=&amp;gt;$project['Project']['user_id']);
        $id = $project['Project']['_id'];
        $this-&amp;gt;addIndextank(&amp;quot;HomkoraProjects&amp;quot;,$id,$indexData);
    }
}

?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;I just added in this simple function, hit the URL once, then removed it. All the old records are in, and any new records will be added thanks to the code from the first post.&lt;/p&gt;

&lt;p&gt;So if you need a quick fix for IndexTanks closure, give IndexDen a shot. I've been in contact with the CEO of the company and he seems like a really nice guy so if you have a more complex setup, contact them and I bet they can help you out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; Other services offering drop in replacements.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.searchify.com/&quot;&gt;http://www.searchify.com/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Real-Time In Place Editing For Rails</title>
   <link href="http://www.travisberry.com/2012/04/real-time-in-place-editing-for-rails"/>
   <updated>2012-04-07T00:00:00-06:00</updated>
   <id>http://www.travisberry.com/2012/04/real-time-in-place-editing-for-rails</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Real-Time In Place Editing For Rails&lt;/h3&gt;
  &lt;a href=&quot;http://marvel.wikia.com/File:Juggernaut_33.jpg&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://static-assets3.travisberry.com/post_images/juggernaut.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: April 07, 2012&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;In an effort to make &lt;a href=&quot;http://hospitium.co&quot;&gt;Hospitium's&lt;/a&gt; interface easier to use, I removed the extra step of editing data in a standard form. Instead opting to use an &lt;a href=&quot;https://www.ruby-toolbox.com/categories/rails_in_place_editing&quot;&gt;in place editing&lt;/a&gt; solution.&lt;/p&gt;

&lt;p&gt;Best in Place is the gem I used and it's pretty simple to set up. Instead of covering the details here, I'll let this &lt;a href=&quot;http://railscasts.com/episodes/302-in-place-editing&quot;&gt;railscast&lt;/a&gt; explain it. That episode is a little out of date so make sure to check out the &lt;a href=&quot;https://github.com/bernat/best_in_place&quot;&gt;gem's README&lt;/a&gt;, the main change being &lt;strong&gt;Controller response with respond_with_bip&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Best in Place is a jQuery based AJAX Inplace-Editor that takes profit of RESTful server-side controllers to allow users to edit stuff with no need of forms.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Getting in place editing working is easy, but one downside is multiple users can edit the same record without seeing each others changes. This could lead to confusion after a page reload and a users changes are completely wrong (at least different from what they expected). So the obvious solution is to push the changes to all users making the edits real-time.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;We could roll our own complete push state, but instead I'm going to offload the work to &lt;a href=&quot;https://github.com/maccman/juggernaut&quot;&gt;Juggernaut&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Juggernaut gives you a realtime connection between your servers and client browsers.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;You can run Juggernaut locally for development, but I recommend just throwing it up on Heroku to make your life easier.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;




&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1003748.js?file=juggernaut_heroku.md'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;Clone repo:

    git clone git://github.com/maccman/juggernaut.git
    cd juggernaut

Create Heroku app:

    heroku create myapp --stack cedar
    heroku addons:add redistogo:nano
    git push heroku master
    heroku ps:scale web=1
    heroku open

Find RedisToGo url

    heroku run node
    process.env.REDISTOGO_URL

And then publish from Juggernaut's Ruby gem:

    irb
    require &amp;quot;juggernaut&amp;quot;
    Juggernaut.url = &amp;quot;REDISTOGO_URL&amp;quot;
    Juggernaut.publish(&amp;quot;channel1&amp;quot;, &amp;quot;woo! it's working&amp;quot;)&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Once you have Juggernaut up and running it's time to start publishing events from rails to juggernaut. The easiest way to do this is with model observers. For the rest of this post we'll assume we are working with a pretty typical User model.&lt;/p&gt;

&lt;p&gt;First install the Juggernaut gem by including it in your gemfile.&lt;/p&gt;

&lt;p&gt;Create a new file &lt;em&gt;/app/models/user_observer.rb&lt;/em&gt;&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/2331242.js?file=user_observer.rb'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;require &amp;quot;juggernaut&amp;quot;
class UserObserver &amp;lt; ActiveRecord::Observer
  
  def after_update(user)
      publish(:update, user)
  end
  
  def publish(type, user)
    Juggernaut.url = ENV['JUGG_URL']
    Juggernaut.publish(&amp;quot;/observer/user/#{user.id}&amp;quot;, {
      :id     =&amp;gt; user.id, 
      :type   =&amp;gt; type, 
      :klass  =&amp;gt; user.class.name,
      :record =&amp;gt; user.changes
    })
  end
  
end&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;All this does is listen for update actions to the user model. Which conveniently is the action best in place uses to update the model. The changed data is then published to the Juggernaut instance.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;ENV['JUGG_URL']&lt;/code&gt; should be set to the &lt;code&gt;REDISTOGO_URL&lt;/code&gt; from the Heroku setup steps above.&lt;/p&gt;

&lt;p&gt;You will also need to initialize the observer by adding the following to &lt;em&gt;/config/application.rb&lt;/em&gt;&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/2331242.js?file=application.rb'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;config.active_record.observers = :user_observer&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Now that the changes are being published, we need need to make the view listen for the changes.&lt;/p&gt;

&lt;p&gt;In your application layout add&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/2331242.js?file=application.html.erb'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;script src=&amp;quot;http://your-juggernaut-app.herokuapp.com/application.js&amp;quot; type=&amp;quot;text/javascript&amp;quot; charset=&amp;quot;utf-8&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Then in your user view add&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/2331242.js?file=show.html.erb'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
    //setup juggernaut to handle real time updating page changes
    var jug = new Juggernaut({
        secure: false,
        host: 'your-juggernaut-app.herokuapp.com',
        port: 80,
        transports: ['xhr-polling','jsonp-polling']
    });

    //subscribe to the url for the specific user, this is the same url we published to from the model observer
    jug.subscribe(&amp;quot;/observer/user/&amp;lt;%= @user.id %&amp;gt;&amp;quot;, function(data){
        //set the updated_text with an error message first - will override if a better result
        var updated_text = &amp;quot;There was an update, but a problem displaying. Please refresh.&amp;quot;;
        jQuery.each(data.record, function(i, val) {
            //the updated_at of the record is always returned, we just skip it here since it's not important
            if (i != &amp;quot;updated_at&amp;quot;){
                //set the updated_text to the update vaule - this is for simple text areas and fields
                updated_text = val[1];
                //if we updated a collection via dropdown, we need to do some more work
                if ($(&amp;quot;#best_in_place_user_&amp;lt;%= @user.id %&amp;gt;_&amp;quot;+i).attr(&amp;quot;data-collection&amp;quot;) !== undefined) {
                    //grab the data values from the best in place dropdown
                    var brand = $('#best_in_place_user_&amp;lt;%= @user.id %&amp;gt;_'+i).attr(&amp;quot;data-collection&amp;quot;);
                    var test = $.parseJSON(brand);
                    $.each(test, function(index, value) {
                        //loop on the json looking for a match
                        if(value[0] == val[1]){
                            //update the text from the dropdown value
                            updated_text = value[1];
                        }
                    });
                }
                //highlight the changed field and update the text with the value from juggernaut - all users viewing the page will see this
                $('#best_in_place_user_&amp;lt;%= @user.id %&amp;gt;_'+i).css(&amp;quot;background-color&amp;quot;,&amp;quot;#c7f464&amp;quot;).html(updated_text).delay(1500).animate({backgroundColor: &amp;quot;#f5f5f5&amp;quot;}, 1000 );
            }
        });
    });
&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Now anytime a user changes a field with best in place, other users viewing the same page will see the updates real-time.&lt;/p&gt;

&lt;p&gt;The real tricky part here is knowing the field ID to update with the changed value. Best In Place generates field IDs dynamically with no way to override them. Luckily they are fairly predictable and we can infer what field was updated by the field name and the model name/ID. That's what &lt;code&gt;$('#best_in_place_user_&amp;lt;%= @user.id %&amp;gt;_'+i)&lt;/code&gt; is doing. &lt;code&gt;i&lt;/code&gt; contains the model field name such as &lt;code&gt;username&lt;/code&gt; or &lt;code&gt;last_login&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;There are also a few problems with this. One being any special formatting done to things like dates won't be formatted by the javascript. This can be worked around by formatting the value as needed though. The other problem is the way I passed the user info into the javascript is ugly. Here is a &lt;a href=&quot;http://railscasts.com/episodes/324-passing-data-to-javascript&quot;&gt;railscast&lt;/a&gt; with some ideas on how you could clean that up.&lt;/p&gt;

&lt;p&gt;To see real-time editing in action, sign up for an account at &lt;a href=&quot;http://hospitium.co/users/sign_up&quot;&gt;Hospitium&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Hubot Deploy</title>
   <link href="http://www.travisberry.com/2012/02/hubot-deploy"/>
   <updated>2012-02-16T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2012/02/hubot-deploy</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Hubot Deploy&lt;/h3&gt;
  &lt;a href=&quot;#&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://static-assets3.travisberry.com/post_images/hubot-capistrano.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: February 16, 2012&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://hubot.github.com/&quot;&gt;Hubot&lt;/a&gt; is super badass. So is &lt;a href=&quot;https://github.com/capistrano/capistrano&quot;&gt;Capistrano&lt;/a&gt;. Getting them working together is like syrup and bacon. So good.&lt;/p&gt;

&lt;p&gt;I won't cover getting Hubot setup as there are plenty of &lt;a href=&quot;http://joeloughton.com/blog/uncategorized/installing-hubot-on-mac-os-x-10-7/&quot;&gt;posts available&lt;/a&gt; and it's not too terribly difficult. Just pick what service you want to hook into and fire it up. (We use hipchat)&lt;/p&gt;

&lt;p&gt;I'm also not going to cover creating deploy scripts with Capistrano as again there are plenty of &lt;a href=&quot;https://github.com/capistrano/capistrano/wiki/2.x-Getting-Started&quot;&gt;other posts&lt;/a&gt; that can help.&lt;/p&gt;

&lt;p&gt;We're going to jump in and assume you have Hubot running on a local machine and have at least one app setup to deploy. (Make sure the Hubot machine has access to run deploys)&lt;/p&gt;

&lt;p&gt;To get Hubot to talk to the repos and deploy them we are using a simple Sinatra app as a middle layer.&lt;/p&gt;

&lt;p&gt;Before that though, let's start with a quick overview of how the whole thing is going to work.&lt;/p&gt;

&lt;p&gt;User tells Hubot &quot;deploy &lt;em&gt;application&lt;/em&gt;&quot; -&gt; Hubot passes the &lt;em&gt;application&lt;/em&gt; to a Sinatra API endpoint -&gt; Sinatra runs the deploy script for the repo -&gt; Hubot tells the user the app is deployed&lt;/p&gt;

&lt;p&gt;So let's start with the Hubot script.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1847866.js?file=deploy.coffee'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;# Deploy with capistrano
#
# Usage:
# deploy &amp;lt;repo&amp;gt;
# what can you deploy?
#
hackers = [
  &amp;quot;http://hubot-assets.s3.amazonaws.com/hackers/1.gif&amp;quot;,
  &amp;quot;http://hubot-assets.s3.amazonaws.com/hackers/2.gif&amp;quot;,
  &amp;quot;http://hubot-assets.s3.amazonaws.com/hackers/3.gif&amp;quot;,
  &amp;quot;http://hubot-assets.s3.amazonaws.com/hackers/4.gif&amp;quot;,
  &amp;quot;http://hubot-assets.s3.amazonaws.com/hackers/5.gif&amp;quot;,
  &amp;quot;http://hubot-assets.s3.amazonaws.com/hackers/6.gif&amp;quot;,
  &amp;quot;http://hubot-assets.s3.amazonaws.com/hackers/7.gif&amp;quot;,
]

#array of the repo names to match and deploy
repos = [
  &amp;quot;example_app_1&amp;quot;,
  &amp;quot;example_app_2&amp;quot;,
  &amp;quot;example_app_3&amp;quot;
]

module.exports = (robot) -&amp;gt;
  robot.respond /deploy (.+)/i, (msg) -&amp;gt;
    if msg.match[1] in repos
      #send waiting messages
      msg.send 'Attempting deploy. Please hold.'
      msg.send msg.random hackers

      #hit the sinatra app to do the deploy
      msg.http(&amp;quot;http://localhost:9393/deploy/#{msg.match[1]}&amp;quot;)
      .get() (err, res, body) -&amp;gt;
        if res.statusCode == 404
          msg.send 'Something went horribly wrong'
        else
          msg.send 'Deployed like a boss'
          msg.send 'http://hubot-assets.s3.amazonaws.com/fuck-yeah/3.gif'
    else
      msg.send 'Nope. I dont know what that is. Try deploying one of these: ' + repos.join(&amp;quot;, &amp;quot;)


  robot.respond /(what can you deploy?)/i, (msg) -&amp;gt;
    msg.send 'I can deploy the shit out of ' + repos.join(&amp;quot;, &amp;quot;)&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;This is a pretty simple Hubot script. Hubot checks if the &lt;em&gt;application&lt;/em&gt; is one he knows and if so, hit the Sinatra API. There's also some fluff in there that tells the user something is happening and to be patient and a few gifs for added fun.&lt;/p&gt;

&lt;p&gt;Add your &lt;em&gt;applications&lt;/em&gt; to the &lt;em&gt;repos&lt;/em&gt; array. One thing to note is the Sinatra URL, depending on your setup, this url may change for you.&lt;/p&gt;

&lt;p&gt;Now that Hubot is listening for deploys, we can create the simple Sinatra app.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1847866.js?file=deploy.rb'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;require 'rubygems'
require 'sinatra'

get '/' do
  &amp;quot;Leave this place&amp;quot;
end


#pass in the repo name and deploy that shit
get '/deploy/:name' do
    bb = IO.popen(&amp;quot;cd ~/Desktop/deploy_repos/&amp;quot;+params[:name]+&amp;quot;; git pull origin master; cap deploy&amp;quot;)
    b = bb.readlines
    puts b.join
end&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Again, really really simple.&lt;/p&gt;

&lt;p&gt;All the app does it take the name of the &lt;em&gt;application&lt;/em&gt; as a URL parameter and deploys that app. This is also where a little hackery comes in.&lt;/p&gt;

&lt;p&gt;The key to this working correctly is the &lt;strong&gt;names in the Hubot script need to be exactly the same as the repo folder names&lt;/strong&gt;. You must also keep a copy of the repos on the same machine that is running the Sinatra app and Hubot.&lt;/p&gt;

&lt;blockquote&gt;
names in the Hubot script need to be exactly the same as the repo folder names
&lt;/blockquote&gt;


&lt;p&gt;This allows the Sinatra app to cd into the repo, update the repo, then run Capistrano deploy. This example uses a deploy_repo folder on the Desktop to store all the repos. Change this as needed.&lt;/p&gt;

&lt;p&gt;If everything is setup correctly you should now be able to tell Hubot &quot;deploy &lt;em&gt;application&lt;/em&gt;&quot; and watch as Hubot does all the work.&lt;/p&gt;

&lt;p&gt;There's a lot a room for expansion here too. Follow the same basic setup and you can add the ability to have Hubot rollback code incase of a problem.&lt;/p&gt;

&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>So Long And Thanks For The Elephant</title>
   <link href="http://www.travisberry.com/2011/12/so-long-and-thanks-for-the-elephant"/>
   <updated>2011-12-24T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2011/12/so-long-and-thanks-for-the-elephant</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;So Long And Thanks For The Elephant&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/29704226@N07/5681748116/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://static-assets2.travisberry.com/post_images/elephant.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: December 24, 2011&lt;/h6&gt;
This domain as well as any other domain I own has just been moved to &lt;a href=&quot;http://name.com&quot;&gt;name.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Godaddy has a pretty crappy past of &lt;a href=&quot;http://mashable.com/2011/03/31/godaddy-ceo-elephant/&quot;&gt;elephant murder&lt;/a&gt; and &lt;a href=&quot;http://vimeo.com/31100268&quot;&gt;SOPA&lt;/a&gt; support so I decided it was time to no longer support such a company.&lt;/p&gt;

&lt;p&gt;Name.com on the other hand is a local Denver company that seems to be on the up and up. So far they have been super awesome to work with.&lt;/p&gt;

&lt;p&gt;If you are looking to transfer you can see how to do so &lt;a href=&quot;http://blog.name.com/2011/12/getting-on-our-sopa-box-and-saving-you-money/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Hospitium - New Open Source Project</title>
   <link href="http://www.travisberry.com/2011/09/hospitium-new-open-source-project"/>
   <updated>2011-09-05T00:00:00-06:00</updated>
   <id>http://www.travisberry.com/2011/09/hospitium-new-open-source-project</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Hospitium - New Open Source Project&lt;/h3&gt;
  &lt;a href=&quot;http://hospitium.co&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://static-assets1.travisberry.com/post_images/hospitium.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: September 05, 2011&lt;/h6&gt;
I just launched a new open source project &lt;a href=&quot;http://hospitium.co&quot;&gt;Hospitium&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Hospitium is a tool for animal rescues and shelters to track and manage their animals.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;Hospitium is the brain child of Apple Wood Rescue, a small animal rescue in Denver Colorado. Developed to fit the needs of the rescue, it has since been open sourced for anyone to use.&lt;/p&gt;

&lt;p&gt;This program is completely free. You can modify it all you want and you can share it with anyone.&lt;/p&gt;

&lt;p&gt;A free hosted solution is coming soon.&lt;/p&gt;

&lt;p&gt;You can support the project by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Donating to &lt;a href=&quot;http://www.appplewoodrescue.org/donate/&quot;&gt;Apple Wood Rescue&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Contributing to the development of Hospitium on &lt;a href=&quot;https://github.com/ninetwentyfour/Hospitium&quot;&gt;github&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Goodbye WordPress - Hello Jekyll</title>
   <link href="http://www.travisberry.com/2011/09/goodbye-wordpress-hello-jekyll"/>
   <updated>2011-09-04T00:00:00-06:00</updated>
   <id>http://www.travisberry.com/2011/09/goodbye-wordpress-hello-jekyll</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Goodbye WordPress - Hello Jekyll&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/oldeyankee/2698654569/sizes/o/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://static-assets.travisberry.com/post_images/jekyll.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: September 04, 2011&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;I ran WordPress for a couple years. There's nothing particularly wrong with it. It is still a powerful CMS with a huge community behind it. So why did I leave?&lt;/p&gt;

&lt;p&gt;Really I was just looking for something else to do. That and running this site on a cheap little host wasn't cutting it anymore. Even with all the WordPress performance tweaks my site was still running slow and running out of memory.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;I bounced around a bit on what to replace it with. I looked real hard at &lt;a href=&quot;http://www.locomotivecms.com/&quot;&gt;Locomotive CMS&lt;/a&gt; and I still really like it, but in the end I figured I would get the best performance out of an entirely static site. And with s3 offering support for static sites, I could run without a server.&lt;/p&gt;

&lt;p&gt;Once I decided on a static site, my options got a lot smaller. The big ones I looked at were &lt;a href=&quot;http://stasis.me/&quot;&gt;Stasis&lt;/a&gt;, &lt;a href=&quot;http://jekyllrb.com/&quot;&gt;Jekyll&lt;/a&gt;, and &lt;a href=&quot;https://github.com/koenbok/Cactus&quot;&gt;Cactus&lt;/a&gt;. All have their strengths but in the end I chose Jekyll since it's ruby based and has a fairly large community. Stasis does some cool things with a controller, but it's a little too new for me.&lt;/p&gt;

&lt;p&gt;I'm not going to walk through everything I did to set this up. There are several good tutorials on the web already and you can always check out the source of this site on &lt;a href=&quot;https://github.com/ninetwentyfour/travisberry_com_static&quot;&gt;github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;These are a few of the sites that helped me get Jekyll up and running.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://tom.preston-werner.com/2008/11/17/blogging-like-a-hacker.html&quot;&gt;Blogging Like A Hacker&lt;/a&gt; - Article from the creator of Jekyll.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://brandontilley.com/2011/01/30/gist-tag-for-jekyll.html&quot;&gt;Gist Tag For Jekyll&lt;/a&gt; - Use gists for code blocks with noscript fallback.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/kinnetica/jekyll-plugins&quot;&gt;Jekyll Plugins&lt;/a&gt; - List of plugins to extend Jekyll&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://paulstamatiou.com/how-to-wordpress-to-jekyll&quot;&gt;How To WordPress To Jekyll&lt;/a&gt; - Good article on moving from WordPress&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://vitobotta.com/how-to-migrate-from-wordpress-to-jekyll/#installing-and-using-jekyll&quot;&gt;Installing and Using Jekyll&lt;/a&gt; - Covers a lot of little things that are easy to miss during setup.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Overall I like the new setup. The simple interface and speed of the finished site are two big bonuses. However, Jekyll is far from the simple to use software the WordPress is. If you don't feel like messing with the internals of your blog software, I would recommend you stick with WordPress. If you like tinkering and love fast sites, then give Jekyll a test run.&lt;/p&gt;

&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Create GitHub Gist With Ruby</title>
   <link href="http://www.travisberry.com/2011/05/create-github-gist-with-ruby"/>
   <updated>2011-05-30T00:00:00-06:00</updated>
   <id>http://www.travisberry.com/2011/05/create-github-gist-with-ruby</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Create GitHub Gist With Ruby&lt;/h3&gt;
  &lt;a href=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2011/05/gists.jpg&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic2.travisberry.com/wp-content/uploads/2011/05/gists.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: May 30, 2011&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;If you didn't know already, &lt;a href=&quot;https://github.com/&quot;&gt;GitHub&lt;/a&gt; is freaking awesome. One of my favorite features is gists. Gists are a simple code pasting and sharing service. Also perfect for displaying code in blog posts.&lt;/p&gt;

&lt;p&gt;I've grown tired of dealing with libraries to make my code examples look good. Some don't work that well, changes aren't revisioned, and they all around kind of suck to mess with. So in an effort to fix all that, I have decided to start using gists for my code examples.&lt;/p&gt;

&lt;p&gt;I'm in the process of converting my site over to running &lt;a href=&quot;http://www.locomotivecms.com&quot;&gt;Locomotive CMS&lt;/a&gt; instead of WordPress, so I needed to create a way to add gists through the admin interface and simply return the embed code.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/998389.js?file=gist_helper.rb'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;  require 'net/http'
  require 'uri'
  require 'json'
  
  def get_gist(fileName,content)
    res = Net::HTTP.post_form(URI.parse('http://gist.github.com/api/v1/json/new'),
      { 'files[#{fileName}]' =&amp;gt; content,
        'login' =&amp;gt; 'USER NAME HERE',
        'token' =&amp;gt; 'API TOKEN HERE',
        'description' =&amp;gt; 'This is a test description'
        })
    parsed_json = JSON(res.body)
    parsed_json['gists'].each do |key, val|
      key.each do |k, v|
        if &amp;quot;#{k}&amp;quot; == 'repo'
          repo = &amp;quot;#{v}&amp;quot;
        end
      end
    end
    return &amp;quot;&amp;lt;script src=\&amp;quot;https://gist.github.com/#{repo}.js\&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;quot;
    
  end&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;It's pretty simple and works like a champ for me. Obviously I had to write a lot more stuff to integrate with Locomotive CMS, but that is for another post.&lt;/p&gt;

&lt;p&gt;If you have questions or a better example, let me know in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Write Text Anywhere With HTML5 Canvas</title>
   <link href="http://www.travisberry.com/2011/05/write-text-anywhere-with-html5-canvas"/>
   <updated>2011-05-26T00:00:00-06:00</updated>
   <id>http://www.travisberry.com/2011/05/write-text-anywhere-with-html5-canvas</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Write Text Anywhere With HTML5 Canvas&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/paurian/3683348208/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic1.travisberry.com/wp-content/uploads/2011/05/canvas.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: May 26, 2011&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;When working on a project recently I came across the need to be able to add some text to a canvas element. This by itself wasn't particularly hard, as there are several examples of creating text editor apps with canvas, but those all forced the text into a row style grid like a text editor. What I needed was a little more freeform in that I wanted the user to click and the text to show at that point.&lt;/p&gt;

&lt;p&gt;After a little hacking around I came up with something that handled my needs and hopefully may help someone else in the future.&lt;/p&gt;

&lt;p&gt;(This doesn't look the best in the end, but you can easily add some css styles to make it look better)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://oldstatic.travisberry.com/demos/canvas-text-demo/index.html&quot;&gt;Click Here To See Demo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So first we need to create a canvas element&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177318.js?file=example1.html'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
    &amp;lt;head&amp;gt;
    &amp;lt;/head&amp;gt;
    &amp;lt;body&amp;gt;
        &amp;lt;div id=&amp;quot;main&amp;quot;&amp;gt;
            &amp;lt;canvas id=&amp;quot;c&amp;quot;&amp;gt;&amp;lt;/canvas&amp;gt;&amp;lt;!-- the canvas --&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;script src=&amp;quot;//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Now we have the canvas element all set up we can start having some fun.&lt;/p&gt;

&lt;p&gt;Well not quite. First we need to set some dimensions for the canvas element. Without them, it doesn't have any way to know where to place our &quot;drawings&quot;.&lt;/p&gt;

&lt;p&gt;Add this into a css file&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177318.js?file=example2.css'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;#c {
    width: 640px;
    height: 360px;
}&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Now we can start adding drawings. One thing we are going to need for this is a text entry box. I debated trying to &quot;type&quot; directly into the canvas but decided against it. (for complexity reasons)&lt;/p&gt;

&lt;p&gt;The method I chose was to add a textarea to the position of the click in the canvas. The user will enter their text into the textarea popup and hit save. This will then draw the text to the screen.&lt;/p&gt;

&lt;p&gt;Let's go ahead and create a javascript function to handle the click and add the textarea and save button.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177318.js?file=example3.js'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;//steal the mousedown event for the canvas for one time - you can use a regular click if you want - this was to interact with some other code in my project
$('#c').mousedown(function(e){
    if ($('#textAreaPopUp').length == 0) {
        var mouseX = e.pageX - this.offsetLeft + $(&amp;quot;#c&amp;quot;).position().left;
        var mouseY = e.pageY - this.offsetTop;
        //append a text area box to the canvas where the user clicked to enter in a comment
        var textArea = &amp;quot;&amp;lt;div id='textAreaPopUp' style='position:absolute;top:&amp;quot;+mouseY+&amp;quot;px;left:&amp;quot;+mouseX+&amp;quot;px;z-index:30;'&amp;gt;&amp;lt;textarea id='textareaTest' style='width:100px;height:50px;'&amp;gt;&amp;lt;/textarea&amp;gt;&amp;quot;;
        var saveButton = &amp;quot;&amp;lt;input type='button' value='save' id='saveText' onclick='saveTextFromArea(&amp;quot;+mouseY+&amp;quot;,&amp;quot;+mouseX+&amp;quot;);'&amp;gt;&amp;lt;/div&amp;gt;&amp;quot;;
        var appendString = textArea + saveButton;
        $(&amp;quot;#main&amp;quot;).append(appendString);
    } else {
        $('textarea#textareaTest').remove();
        $('#saveText').remove();
        $('#textAreaPopUp').remove();
        var mouseX = e.pageX - this.offsetLeft + $(&amp;quot;#c&amp;quot;).position().left;
        var mouseY = e.pageY - this.offsetTop;
        //append a text area box to the canvas where the user clicked to enter in a comment
        var textArea = &amp;quot;&amp;lt;div id='textAreaPopUp' style='position:absolute;top:&amp;quot;+mouseY+&amp;quot;px;left:&amp;quot;+mouseX+&amp;quot;px;z-index:30;'&amp;gt;&amp;lt;textarea id='textareaTest' style='width:100px;height:50px;'&amp;gt;&amp;lt;/textarea&amp;gt;&amp;quot;;
        var saveButton = &amp;quot;&amp;lt;input type='button' value='save' id='saveText' onclick='saveTextFromArea(&amp;quot;+mouseY+&amp;quot;,&amp;quot;+mouseX+&amp;quot;);'&amp;gt;&amp;lt;/div&amp;gt;&amp;quot;;
        var appendString = textArea + saveButton;
        $(&amp;quot;#main&amp;quot;).append(appendString);
    }
});&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;There’s nothing too crazy in here. It does do a check and destroy the textarea if one is already displayed while the user clicks the canvas again.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177318.js?file=example4.js'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;var mouseX = e.pageX - this.offsetLeft + $(&amp;quot;#c&amp;quot;).position().left;
var mouseY = e.pageY - this.offsetTop;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;These are setting the position of the mouse click so we can use them to set the position to display the textarea at. It takes into account any offsets the canvas element may have as well.&lt;/p&gt;

&lt;p&gt;The rest is just appending the textarea to the main element in the page. The save button has an onclick event that we will deal with in a bit.&lt;/p&gt;

&lt;p&gt;Now we have to actually draw the entered text to the screen.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177318.js?file=example5.js'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;function saveTextFromArea(y,x){
    //get the value of the textarea then destroy it and the save button
    var text = $('textarea#textareaTest').val();
    $('textarea#textareaTest').remove();
    $('#saveText').remove();
    //get the canvas and add the text functions
    var canvas = document.getElementById('c');
    var ctx = canvas.getContext('2d');
    var cw = canvas.clientWidth;
    var ch = canvas.clientHeight;
    canvas.width = cw;
    canvas.height = ch;
    //break the text into arrays based on a text width of 100px
    var phraseArray = getLines(ctx,text,100);
    // this adds the text functions to the ctx
    CanvasTextFunctions.enable(ctx);
    var counter = 0;
    //set the font styles
    var font = &amp;quot;sans&amp;quot;;
    var fontsize = 16;
    ctx.strokeStyle = &amp;quot;rgba(237,229,0,1)&amp;quot;;
    ctx.shadowOffsetX = 2;
    ctx.shadowOffsetY = 2;
    ctx.shadowBlur = 1;
    ctx.shadowColor = &amp;quot;rgba(0,0,0,1)&amp;quot;;
    //draw each phrase to the screen, making the top position 20px more each time so it appears there are line breaks
    $.each(phraseArray, function() {
        //set the placement in the canvas
        var lineheight = fontsize * 1.5;
        var newline = ++counter;
        newline = newline * lineheight;
        var topPlacement = y - $(&amp;quot;#c&amp;quot;).position().top + newline;
        var leftPlacement = x - $(&amp;quot;#c&amp;quot;).position().left;
        text = this;
        //draw the text
        ctx.drawText(font, fontsize, leftPlacement, topPlacement, text);
        ctx.save();
        ctx.restore();
    });
    //reset the drop shadow so any other drawing don't have them
    ctx.shadowOffsetX = 0;
    ctx.shadowOffsetY = 0;
    ctx.shadowBlur = 0;
    ctx.shadowColor = &amp;quot;rgba(0,0,0,0)&amp;quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;So this is fairly intense. It also uses a little library file from Jim Studt that you can find &lt;a href=&quot;http://www.federated.com/~jim/canvastext/&quot;&gt;here&lt;/a&gt;. Though I have modified mine a bit because of some conflicts it was causing me. You can grab my copy at &lt;a href=&quot;https://github.com/ninetwentyfour/Video-Canvas/blob/master/js/text.js&quot;&gt;https://github.com/ninetwentyfour/Video-Canvas/blob/master/js/text.js&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A few important parts in that code are&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177318.js?file=example6.js'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;//break the text into arrays based on a text width of 100px
var phraseArray = getLines(ctx,text,100);&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;This is going to another function that we will write in a minute. Basically it is solving the problem of canvas text not having any idea how to word wrap. It will blow right off the page without this.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177318.js?file=example7.js'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;// this adds the text functions to the ctx
CanvasTextFunctions.enable(ctx);&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;This intializes the text library file.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177318.js?file=example8.js'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;//draw each phrase to the screen, making the top position 20px more each time so it appears there are line breaks
$.each(phraseArray, function() {
    //set the placement in the canvas
    var lineheight = fontsize * 1.5;
    var newline = ++counter;
    newline = newline * lineheight;
    var topPlacement = y - $(&amp;quot;#c&amp;quot;).position().top + newline;
    var leftPlacement = x - $(&amp;quot;#c&amp;quot;).position().left;
    text = this;
    //draw the text
    ctx.drawText(font, fontsize, leftPlacement, topPlacement, text);
    ctx.save();
    ctx.restore();
});&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;This is the block that actually draws the text to the screen. It takes each entry in the phraseArray and draws it to the screen moving it down by a line each time.&lt;/p&gt;

&lt;p&gt;The code to control the width of the text looks like this&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177318.js?file=example9.js'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;function getLines(ctx,phrase,maxPxLength) {
    //break the text area text into lines based on &amp;quot;box&amp;quot; width
    var wa=phrase.split(&amp;quot; &amp;quot;),
    phraseArray=[],
    lastPhrase=&amp;quot;&amp;quot;,
    l=maxPxLength,
    measure=0;
    ctx.font = &amp;quot;16px sans-serif&amp;quot;;
    for (var i=0;i&amp;lt;wa.length;i++) {
        var w=wa[i];
        measure=ctx.measureText(lastPhrase+w).width;
        if (measure&amp;lt;l) {
            lastPhrase+=(&amp;quot; &amp;quot;+w);
        }else {
            phraseArray.push(lastPhrase);
            lastPhrase=w;
        }
        if (i===wa.length-1) {
            phraseArray.push(lastPhrase);
            break;
    }
    }
    return phraseArray;
}&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;This takes the canvas variable the original text and the width you want to limit it to then returns an array of pharses limited to the length you pass.&lt;/p&gt;

&lt;p&gt;Once you have all this done you should have a working example. My final code looks like this.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177318.js?file=example10.html'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
    &amp;lt;head&amp;gt;
        &amp;lt;style&amp;gt;
            body {
                background: #111;
                color:#eee;
            }
            #c {
                width: 640px;
                height: 360px;
                border:1px solid #111;
                float:left;
                background:#eee;
            }
            #main{
                width:650px;
                margin:auto;
            }
        &amp;lt;/style&amp;gt;
    &amp;lt;/head&amp;gt;
    &amp;lt;body&amp;gt;
        &amp;lt;div id=&amp;quot;main&amp;quot;&amp;gt;
            &amp;lt;canvas id=&amp;quot;c&amp;quot;&amp;gt;&amp;lt;/canvas&amp;gt;&amp;lt;!-- the canvas --&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;script src=&amp;quot;http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
        &amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;text.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;!-- Library to help text --&amp;gt;
        &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
            $('#c').mousedown(function(e){
                if ($('#textAreaPopUp').length == 0) {
                    var mouseX = e.pageX - this.offsetLeft + $(&amp;quot;#c&amp;quot;).position().left;
                    var mouseY = e.pageY - this.offsetTop;

                    //append a text area box to the canvas where the user clicked to enter in a comment
                    var textArea = &amp;quot;&amp;lt;div id='textAreaPopUp' style='position:absolute;top:&amp;quot;+mouseY+&amp;quot;px;left:&amp;quot;+mouseX+&amp;quot;px;z-index:30;'&amp;gt;&amp;lt;textarea id='textareaTest' style='width:100px;height:50px;'&amp;gt;&amp;lt;/textarea&amp;gt;&amp;quot;;
                    var saveButton = &amp;quot;&amp;lt;input type='button' value='save' id='saveText' onclick='saveTextFromArea(&amp;quot;+mouseY+&amp;quot;,&amp;quot;+mouseX+&amp;quot;);'&amp;gt;&amp;lt;/div&amp;gt;&amp;quot;;
                    var appendString = textArea + saveButton;
                    $(&amp;quot;#main&amp;quot;).append(appendString);
                } else {
                    $('textarea#textareaTest').remove();
                    $('#saveText').remove();
                    $('#textAreaPopUp').remove();
                    var mouseX = e.pageX - this.offsetLeft + $(&amp;quot;#c&amp;quot;).position().left;
                    var mouseY = e.pageY - this.offsetTop;
                    //append a text area box to the canvas where the user clicked to enter in a comment
                    var textArea = &amp;quot;&amp;lt;div id='textAreaPopUp' style='position:absolute;top:&amp;quot;+mouseY+&amp;quot;px;left:&amp;quot;+mouseX+&amp;quot;px;z-index:30;'&amp;gt;&amp;lt;textarea id='textareaTest' style='width:100px;height:50px;'&amp;gt;&amp;lt;/textarea&amp;gt;&amp;quot;;
                    var saveButton = &amp;quot;&amp;lt;input type='button' value='save' id='saveText' onclick='saveTextFromArea(&amp;quot;+mouseY+&amp;quot;,&amp;quot;+mouseX+&amp;quot;);'&amp;gt;&amp;lt;/div&amp;gt;&amp;quot;;
                    var appendString = textArea + saveButton;
                    $(&amp;quot;#main&amp;quot;).append(appendString);
                }
            });
           
            function saveTextFromArea(y,x){
                //get the value of the textarea then destroy it and the save button
                var text = $('textarea#textareaTest').val();
                $('textarea#textareaTest').remove();
                $('#saveText').remove();
                $('#textAreaPopUp').remove();
                //get the canvas and add the text functions
                var canvas = document.getElementById('c');
                var ctx = canvas.getContext('2d');
                var cw = canvas.clientWidth;
                var ch = canvas.clientHeight;
                canvas.width = cw;
                canvas.height = ch;
                //break the text into arrays based on a text width of 100px
                var phraseArray = getLines(ctx,text,100);
                // this adds the text functions to the ctx
                CanvasTextFunctions.enable(ctx);
                var counter = 0;
                //set the font styles
                var font = &amp;quot;sans&amp;quot;;
                var fontsize = 16;
                ctx.strokeStyle = &amp;quot;rgba(237,229,0,1)&amp;quot;;
                ctx.shadowOffsetX = 2;
                ctx.shadowOffsetY = 2;
                ctx.shadowBlur = 1;
                ctx.shadowColor = &amp;quot;rgba(0,0,0,1)&amp;quot;;
                //draw each phrase to the screen, making the top position 20px more each time so it appears there are line breaks
                $.each(phraseArray, function() {
                    //set the placement in the canvas
                    var lineheight = fontsize * 1.5;
                    var newline = ++counter;
                    newline = newline * lineheight;
                    var topPlacement = y - $(&amp;quot;#c&amp;quot;).position().top + newline;
                    var leftPlacement = x - $(&amp;quot;#c&amp;quot;).position().left;
                    text = this;
                    //draw the text
                    ctx.drawText(font, fontsize, leftPlacement, topPlacement, text);
                    ctx.save();
                    ctx.restore();
                });
                //reset the drop shadow so any other drawing don't have them
                ctx.shadowOffsetX = 0;
                ctx.shadowOffsetY = 0;
                ctx.shadowBlur = 0;
                ctx.shadowColor = &amp;quot;rgba(0,0,0,0)&amp;quot;;
            }
           
            function getLines(ctx,phrase,maxPxLength) {
                //break the text area text into lines based on &amp;quot;box&amp;quot; width
                var wa=phrase.split(&amp;quot; &amp;quot;),
                phraseArray=[],
                lastPhrase=&amp;quot;&amp;quot;,
                l=maxPxLength,
                measure=0;
                ctx.font = &amp;quot;16px sans-serif&amp;quot;;
                for (var i=0;i&amp;lt;wa.length;i++) {
                    var w=wa[i];
                    measure=ctx.measureText(lastPhrase+w).width;
                    if (measure&amp;lt;l) {
                        lastPhrase+=(&amp;quot; &amp;quot;+w);
                    }else {
                        phraseArray.push(lastPhrase);
                        lastPhrase=w;
                    }
                    if (i===wa.length-1) {
                        phraseArray.push(lastPhrase);
                        break;
                    }
                }
                return phraseArray;
            }
        &amp;lt;/script&amp;gt;
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;This is a pretty basic and is missing a few things that would make it more helpful but it should give you a good start. Please feel free to leave questions or advice on better ways to do this in the comments.&lt;/p&gt;

&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>A Day In The Life Of Me</title>
   <link href="http://www.travisberry.com/2011/03/a-day-in-the-life-of-me"/>
   <updated>2011-03-04T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2011/03/a-day-in-the-life-of-me</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;A Day In The Life Of Me&lt;/h3&gt;
  &lt;h6&gt;Published: March 03, 2011&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;Super awesome timelapse at the office.&lt;/p&gt;

&lt;p&gt;&lt;video width=&quot;640&quot; height=&quot;480&quot; id=&quot;video&quot; controls=&quot;true&quot;&gt;&lt;source src=&quot;http://oldstatic.travisberry.com/html5video/videos/timelapseWork/timelapse3-4-11.mp4&quot; type='video/mp4; codecs=&quot;avc1.64001E, mp4a.40.2&quot;' /&gt;&lt;source src=&quot;http://oldstatic.travisberry.com/html5video/videos/timelapseWork/timelapse3-4-11.ogv&quot; type='video/ogg; codecs=&quot;theora, vorbis&quot;' /&gt;&lt;object width=&quot;480&quot; height=&quot;480&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/jqccnLh_Dhs?fs=1&amp;amp;hl=en_US&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/jqccnLh_Dhs?fs=1&amp;amp;hl=en_US&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;480&quot; height=&quot;480&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/video&gt;
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Fast CakePHP Search With IndexTank</title>
   <link href="http://www.travisberry.com/2011/02/fast-cakephp-search-with-indextank"/>
   <updated>2011-02-16T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2011/02/fast-cakephp-search-with-indextank</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Fast CakePHP Search With IndexTank&lt;/h3&gt;
  &lt;a href=&quot;http://commons.wikimedia.org/wiki/File:Marines-tank-Korea-19530705.JPEG&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2011/02/indextank.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: February 16, 2011&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update April 08, 2012:&lt;/strong&gt; IndexTank is shutting down. Use IndexDen instead. &lt;a href=&quot;http://www.travisberry.com/2012/04/moving-from-indextank-to-indexden&quot;&gt;Instructions here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I've previously posted my &lt;a href=&quot;http://www.travisberry.com/2010/06/create-a-ghetto-but-functional-search-function-for-cakephp/&quot;&gt;ghetto CakePHP search function&lt;/a&gt;. This time I'm going to show you a much better method, mainly by offloading the work to people who really know how to do search. That's where &lt;a href=&quot;http://indextank.com/&quot;&gt;IndexTank&lt;/a&gt; comes in - they know how to do search. They power the search for Reddit, WordPress.com, and many others.&lt;/p&gt;

&lt;p&gt;You simply hand them the documents you want indexed and the give you back the ability to query against it.&lt;/p&gt;

&lt;p&gt;I'm not going to spend anytime explaining how IndexTank works, mainly because I barely understand it. Instead I will show you a simple way to get it to work with CakePHP.&lt;/p&gt;

&lt;p&gt;The code in this example is built around the code for &lt;a href=&quot;http://homkora.com&quot;&gt;Homkora&lt;/a&gt; in which the main two Objects are Projects and Timers. So to start grab the IndexTank library from &lt;a href=&quot;https://indextank.com/documentation/php-client&quot;&gt;https://indextank.com/documentation/php-client&lt;/a&gt; this would be a good page to read as well just to get an idea of what's going on.&lt;/p&gt;

&lt;p&gt;Take the file you downloaded (indextank_client.php in my case) and place it in app/vendors of your CakePHP application.&lt;/p&gt;

&lt;p&gt;Now open up your app_controller.php and add these four functions&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177288.js?file=example1.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php
function createIndextankClient(){
    App::import('Vendor', 'indextank_client');
    $API_URL = 'YOUR API URL HERE';
    $client = new ApiClient($API_URL);
    return $client;
}
   
function addIndextank($indexType,$id,$data){
    //send project to indextank
    $client = $this-&amp;gt;createIndextankClient();
    $index = $client-&amp;gt;get_index($indexType);
    $doc_id = $id;
    $index-&amp;gt;add_document($doc_id, $data);
}
   
function deleteIndextank($indexType,$id){
    //delete indextank document
    $client = $this-&amp;gt;createIndextankClient();
    $index = $client-&amp;gt;get_index($indexType);
    $index-&amp;gt;delete_document($id);
}
   
function searchIndextank($indexType,$query){
    //search indextank
    $client = $this-&amp;gt;createIndextankClient();
    $index = $client-&amp;gt;get_index($indexType);
    $index-&amp;gt;add_function(2, &amp;quot;relevance&amp;quot;);
    $res = $index-&amp;gt;search($query);
    return $res;
}
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;These are the three functions that call to IndexTank directly and the one that creates the IndexTank client object. It imports the library and create a new $client object.&lt;/p&gt;

&lt;p&gt;Each one is built to be passed the variables it needs to make a connection to IndexTank.&lt;/p&gt;

&lt;p&gt;All the functions accept the $indexType variable which is where you set which index to perform actions against. In my case I have one for Projects and one for Timers.&lt;/p&gt;

&lt;p&gt;So now lets add some documents to our index.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177288.js?file=example2.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php
if ($this-&amp;gt;Project-&amp;gt;save($this-&amp;gt;data)) {
    $this-&amp;gt;Session-&amp;gt;setFlash('The project has been saved', 'default', array('class' =&amp;gt; 'flash_good'));
    $this-&amp;gt;redirect(array('action' =&amp;gt; 'index'));
}
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;I'm going to assume you having something similar in your controller. In this case it's in my add() function in the projects controller.&lt;/p&gt;

&lt;p&gt;Let's add the code to call our addIndextank() function in the app controller.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177288.js?file=example3.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php
if ($this-&amp;gt;Project-&amp;gt;save($this-&amp;gt;data)) {
    //send project to index tank
    $indexData = array('text'=&amp;gt;$this-&amp;gt;data['Project']['title'],'title'=&amp;gt;$this-&amp;gt;data['Project']['title'],'description'=&amp;gt;$this-&amp;gt;data['Project']['description'],'user_id'=&amp;gt;$_SESSION['Auth']['User']['_id']);
    $id = $this-&amp;gt;Project-&amp;gt;id;
    $this-&amp;gt;addIndextank(&amp;quot;HomkoraProjects&amp;quot;,$id,$indexData);
    $this-&amp;gt;Session-&amp;gt;setFlash('The project has been saved', 'default', array('class' =&amp;gt; 'flash_good'));
    $this-&amp;gt;redirect(array('action' =&amp;gt; 'index'));
}
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Let go over what's going on here.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177288.js?file=example4.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php
$indexData = array('text'=&amp;gt;$this-&amp;gt;data['Project']['title'],'title'=&amp;gt;$this-&amp;gt;data['Project']['title'],'description'=&amp;gt;$this-&amp;gt;data['Project']['description'],'user_id'=&amp;gt;$_SESSION['Auth']['User']['_id']);
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;This line is setting the data that will be indexed. The 'text' field is one used by IndexTank by default and I recommend setting it to the type of query that will be preformed the most.&lt;/p&gt;

&lt;p&gt;The key value pairs after 'text' can be whatever other data you would like to save and be able to query against.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177288.js?file=example5.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php $id = $this-&amp;gt;Project-&amp;gt;id; ?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Simply sets the ID that is going to be used for the document ID in IndexTank. I figured it best to keep them the same as in the application database so this sets it as the last saved Project ID.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177288.js?file=example6.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php $this-&amp;gt;addIndextank(&amp;quot;HomkoraProjects&amp;quot;,$id,$indexData); ?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;This line is the call to the addIndextank function. The &quot;HomkoraProjects&quot; is what is passed as $indexType in the app_controller and is basically the name of the index. We then pass the ID and the data to be indexed too.&lt;/p&gt;

&lt;p&gt;Now when you add a new Project you should also be adding a new document to IndexTank.&lt;/p&gt;

&lt;p&gt;Now if you delete the Project it's best to delete to document in the index as well. So let's add some code to our projects controller delete() function.&lt;/p&gt;

&lt;p&gt;Starting with&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177288.js?file=example7.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php
if ($this-&amp;gt;Project-&amp;gt;delete($id)) {
    $this-&amp;gt;Session-&amp;gt;setFlash('Project deleted', 'default', array('class' =&amp;gt; 'flash_good'));
    $this-&amp;gt;redirect(array('action'=&amp;gt;'index'));
}
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;We can add a simple call like&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177288.js?file=example8.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php 
if ($this-&amp;gt;Project-&amp;gt;delete($id)) {
    $this-&amp;gt;deleteIndextank(&amp;quot;HomkoraProjects&amp;quot;,$id);
    $this-&amp;gt;Session-&amp;gt;setFlash('Project deleted', 'default', array('class' =&amp;gt; 'flash_good'));
    $this-&amp;gt;redirect(array('action'=&amp;gt;'index'));
}
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Deleting documents requires a lot less information so we just have to pass it the $indexType and the ID (which should match between your app and IndexTank if you add documents using the above example)&lt;/p&gt;

&lt;p&gt;Alright, now you can add and remove documents from your index, but what good are they without being able to search against them.&lt;/p&gt;

&lt;p&gt;In my projects controller I added the following function&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177288.js?file=example9.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php
function search(){
    $query = $this-&amp;gt;data['Project']['search'];
    $res = $this-&amp;gt;searchIndextank(&amp;quot;HomkoraProjects&amp;quot;,$query);
    $i = 0;
    foreach($res-&amp;gt;results as $doc_id){
    $params = array(
        'conditions' =&amp;gt; array('_id' =&amp;gt; $doc_id-&amp;gt;docid)
    );
        $projects[$i++] = $this-&amp;gt;Project-&amp;gt;find('first',$params);
    }
    $this-&amp;gt;set('projects', $projects);
}
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;




&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177293.js?file=example10.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php $query = $this-&amp;gt;data['Project']['search']; ?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;I pass the search term through a form and set it as the $query variable.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177293.js?file=example11.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php $res = $this-&amp;gt;searchIndextank(&amp;quot;HomkoraProjects&amp;quot;,$query); ?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Here I call our searchIndextank() function and pass it the $indexType again and the query to perform.&lt;/p&gt;

&lt;p&gt;You'll notice in the searchIndextank() I return the data $res and in the search() function I set it to $res.&lt;/p&gt;

&lt;p&gt;Once I get the results from IndexTank I can use them to search for the Projects in my database. Here I set them all the the $projects array and prepare them for display in the view.&lt;/p&gt;

&lt;p&gt;I know you're thinking, if you are getting the data from the database anyway - why use IndexTank?&lt;/p&gt;

&lt;p&gt;Well with only a few records, you aren't going to get a much faster result, but with lots of records, IndexTank will return the results faster plus it allows you to cut down on your database calls. Their ability to rank results and search based on numerous factors is pretty good and better than what the average person can write in most cases.&lt;/p&gt;

&lt;p&gt;I'm using a pretty bare bones searchIndextank() function but this should get you started. I'm quite impressed with the results so far and I'm continuing to find better ways to work with their index.&lt;/p&gt;

&lt;p&gt;If you know a better way to set this up, or have questions, let me know in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Haml, Sass, Markdown, and CakePHP - Oh My!</title>
   <link href="http://www.travisberry.com/2011/01/haml-sass-markdown-and-cakephp-oh-my"/>
   <updated>2011-01-11T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2011/01/haml-sass-markdown-and-cakephp-oh-my</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Haml, Sass, Markdown, and CakePHP - Oh My!&lt;/h3&gt;
  &lt;a href=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2011/01/haml-sass.jpg&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic3.travisberry.com/wp-content/uploads/2011/01/haml-sass.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: January 11, 2011&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;I've recently begun using &lt;a href=&quot;http://haml-lang.com/&quot;&gt;Haml&lt;/a&gt; and &lt;a href=&quot;http://sass-lang.com/&quot;&gt;Sass&lt;/a&gt; instead of good ol' HTML and CSS. If you haven't heard of them, &quot;Haml is a refreshing take that is meant to free us from the shitty templating languages we have gotten used to&quot;, and &quot;Sass makes CSS fun again&quot;. The conciseness and power of Haml and Sass are what really made me make the switch. There was just one downside, both are designed for use with Ruby.&lt;/p&gt;

&lt;p&gt;While I don't have anything against Ruby, it's not my language of choice. I use PHP for just about everything backend and most of my apps and sites are built upon CakePHP, my favorite framework.&lt;/p&gt;

&lt;p&gt;Luckily there are ports of Haml and Sass for use with PHP. There are several out there, but I went with PHamlP mainly because it has a CakePHP plugin available for download.&lt;/p&gt;

&lt;p&gt;The install instructions for the plugin are greatly lacking, or at least I couldn't get them to work out of the box, so I decided to document how I went about getting it working and rocking out.&lt;/p&gt;

&lt;p&gt;Oh, and as a bonus, we are going to setup &lt;a href=&quot;http://daringfireball.net/projects/markdown/&quot;&gt;Markdown&lt;/a&gt; too.&lt;/p&gt;

&lt;p&gt;So to start &lt;a href=&quot;http://code.google.com/p/phamlp/downloads/list&quot;&gt;grab a copy of PHamlP&lt;/a&gt; and find a CakePHP project you would like to add it to. Unzip the file and you should be looking at a Installation.txt, license.txt, vendors, views, and webroot folders.&lt;/p&gt;

&lt;p&gt;Copy the files in each folder to their corresponding folders in /app in your Cake project. (e.g. vendors =&gt; vendors | views =&gt; views | webroot =&gt; webroot)&lt;/p&gt;

&lt;p&gt;Now for all the wonderful configuring.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HAML&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's start with getting just Haml working for the time being.&lt;/p&gt;

&lt;p&gt;Open up your app_controller.php and add the following line&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177229.js?file=example1.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;var $view = 'Haml';&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Now open up /config/core.php and scroll to the bottom. Add&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177229.js?file=example2.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;Configure::write('Haml.format', 'html5');
Configure::write('Haml.filterDir', VIEWS.'filters');&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;The first option is telling Haml which HTML or XHTML version to compile into. I use HTML5 for everything these days so that's what I picked. The second option tells the app where to find the Haml filter that starts the process of compiling Haml to HTML. If you put the filters folder inside your views folder, this is the path you need.&lt;/p&gt;

&lt;p&gt;Now open up the haml.php file you added to views. Find the line that says&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177229.js?file=example3.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;App::import('Vendor', 'HamlParser', array('file'=&amp;gt;'phamlp'.DS.'haml'.DS.'HamlParser.php'));&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;and change it to&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177229.js?file=example4.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;App::import('Vendor', 'HamlParser', array('file'=&amp;gt;'haml'.DS.'HamlParser.php'));&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;This assumes you copied the vendors contents to vendors in CakePHP.&lt;/p&gt;

&lt;p&gt;After that, you should have Haml up and running. I find the best way to test without changing all you layouts and views is to test with a page, then move on to replacing the rest of your views.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SASS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's tackle the Sass.&lt;/p&gt;

&lt;p&gt;One important decision to make right off the bat is if you want to use the older .sass format or the newer .scss version. Now according to the docs, it shouldn't matter, you just create whatever type you want and it handles the rest. Well I didn't find this to work, and I had to change some code to support .scss files. So for the purpose of this tutorial I will show how to get those to work, but I'll flag the step to skip if you want to use the older .sass&lt;/p&gt;

&lt;p&gt;With that out of the way, time to start the config.&lt;/p&gt;

&lt;p&gt;Open the core.php file back up and go to the Haml code we added earlier. Under that add&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177229.js?file=example5.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;Configure::write('Sass.style', 'compressed');
Configure::write('Asset.filter.css', 'sass.php');&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;The first line sets the output style of the css. I use compressed as it saves a little filesize, you can pick whatever you would like though. The second line tells Cake to filter the files with the sass.php you put in webroot.&lt;/p&gt;

&lt;p&gt;Now open up sass.php and find the line that looks like&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177229.js?file=example6.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;App::import('Vendor', 'SassParser', array('file'=&amp;gt;'phamlp'.DS.'sass'.DS.'SassParser.php'));&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Replace it with&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177229.js?file=example7.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;App::import('Vendor', 'SassParser', array('file'=&amp;gt;'sass'.DS.'SassParser.php'));&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;After that you should be able to start putting .sass files into your css directory and they will compile to css.&lt;/p&gt;

&lt;p&gt;However, at least in my case, I lost my gzip on the css files. To add it back, replace the section that sets the headers, looks like&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177229.js?file=example8.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;header(&amp;quot;Content-Type: text/css&amp;quot;);
header(&amp;quot;Expires: &amp;quot; . gmdate(&amp;quot;D, j M Y H:i:s&amp;quot;, time() + DAY) . &amp;quot; GMT&amp;quot;);
header(&amp;quot;Cache-Control: cache&amp;quot;); // HTTP/1.1
header(&amp;quot;Pragma: cache&amp;quot;);        // HTTP/1.0&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;with&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177229.js?file=example9.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;ob_start (&amp;quot;ob_gzhandler&amp;quot;);
header(&amp;quot;Content-Type: text/css&amp;quot;);
$seconds_to_cache = 31556926;
$ts = gmdate(&amp;quot;D, d M Y H:i:s&amp;quot;, time() + $seconds_to_cache) . &amp;quot; GMT&amp;quot;;
header(&amp;quot;Expires: $ts&amp;quot;);
header(&amp;quot;Pragma: cache&amp;quot;);
header(&amp;quot;Cache-Control: maxage=$seconds_to_cache&amp;quot;);&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Then add a line to the bottom of the file with this&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177233.js?file=example10.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;ob_end_flush();&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Your compiled css files should now transfer gzipped.&lt;/p&gt;

&lt;p&gt;Now lets add support for the newer .scss file. If you want to use .sass you can skip this part.&lt;/p&gt;

&lt;p&gt;Find the line&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177233.js?file=example11.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;$sassFile = str_replace('.css', '.sass', $cssFile);&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;and replace it with&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177233.js?file=example12.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;$sassFile = str_replace('.css', '.scss', $cssFile);&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;You can now use .scss files instead of .sass&lt;/p&gt;

&lt;p&gt;Haml and Sass should be up and running now.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MARKDOWN&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;However, some people make the argument that you shouldn't use Haml to style the content of your page. By content, they are referring to the main text of the page. The &quot;meat&quot; so to speak. For a good read on the subject, check out this post. http://chriseppstein.github.com/blog/2010/02/08/haml-sucks-for-content/&lt;/p&gt;

&lt;p&gt;Well one great alternative to using HTML to markup you text, is to use Markdown. To use Markdown with Haml you use something similar to&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177233.js?file=example13.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;:markdown
    Here is some markdown
    ===&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;inside your Haml files. To get support for this, you need to download the latest Markdown PHP port from http://michelf.com/projects/php-markdown/&lt;/p&gt;

&lt;p&gt;Make sure to grab the EXTRA's version.&lt;/p&gt;

&lt;p&gt;Add a folder to vendors called markdown. Place the download files into it.&lt;/p&gt;

&lt;p&gt;Now open up the HamlMarkdownFilter.php inside the views/filters folder.&lt;/p&gt;

&lt;p&gt;Change&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177233.js?file=example14.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;App::import('Vendor', 'HamlMarkdownFilter', array('file'=&amp;gt;'phamlp'.DS.'haml'.DS.'filters'.DS.'_HamlMarkdownFilter.php'));&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;To&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177233.js?file=example15.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;App::import('Vendor', 'HamlMarkdownFilter', array('file'=&amp;gt;'haml'.DS.'filters'.DS.'_HamlMarkdownFilter.php'));&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Now open up the _HamlMarkdownFilter.php file inside /vendors/haml/filters&lt;/p&gt;

&lt;p&gt;Change&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177233.js?file=example16.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;protected $vendorClass = 'MarkdownExtra_Parser';&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;To&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177233.js?file=example17.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;protected $vendorClass = 'Markdown_Parser';&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;also change&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177233.js?file=example18.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;return '&amp;lt;?php   '.(!empty($this-&amp;gt;vendorPath)?'require_once &amp;quot;'.$this-&amp;gt;vendorPath.'&amp;quot;;':'').'$markdown___=new '.$this-&amp;gt;vendorClass.'();echo  $markdown___-&amp;gt;safeTransform(&amp;quot;'.preg_replace(HamlParser::MATCH_INTERPOLATION, '&amp;quot;.\1.&amp;quot;', $text).'&amp;quot;);?&amp;gt;';&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;To&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177233.js?file=example19.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;return '&amp;lt;?php   '.(!empty($this-&amp;gt;vendorPath)?'require_once &amp;quot;'.$this-&amp;gt;vendorPath.'&amp;quot;;':'').'$markdown___=new '.$this-&amp;gt;vendorClass.'();echo  $markdown___-&amp;gt;transform(&amp;quot;'.preg_replace(HamlParser::MATCH_INTERPOLATION, '&amp;quot;.\1.&amp;quot;', $text).'&amp;quot;);?&amp;gt;';&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Now throw some Markdown into you Haml files and prepare to be amazed.&lt;/p&gt;

&lt;p&gt;I'm not sure why I had to change so much to get this setup to work. If you compare the Installation.txt to this post, you will see mine takes much more work. Don't take that as a dig on the developers though, there could be many reasons their instructions didn't work for me. I just figured if I had this hard of a time, someone else may run into similar issues and I could save them some time with this write up.&lt;/p&gt;

&lt;p&gt;If I am an idiot and there is a way simpler way to get this working, let me know in the comments. You can also view a project I've set this up with on &lt;a href=&quot;https://github.com/ninetwentyfour/Homkora&quot;&gt;github&lt;/a&gt;.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>New Time Tracking Web App - Homkora</title>
   <link href="http://www.travisberry.com/2011/01/new-time-tracking-web-app-homkora"/>
   <updated>2011-01-01T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2011/01/new-time-tracking-web-app-homkora</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;New Time Tracking Web App - Homkora&lt;/h3&gt;
  &lt;a href=&quot;http://homkora.com&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic2.travisberry.com/wp-content/uploads/2011/01/homkora-cap.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: January 01, 2011&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;I have recently launched the beta my new side project Homkora.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;Homkora is a &lt;a href=&quot;http://homkora.com&quot;&gt;time tracking web app&lt;/a&gt; that aims to be as simple as possible. I was not happy with any of the offerings I found so I made my own. It let's you make projects and timers. That's it. You can check the code out at &lt;a href=&quot;https://github.com/ninetwentyfour/Homkora&quot;&gt;github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Sign up for the beta &lt;a href=&quot;http://homkora.com/sign-up&quot;&gt;here&lt;/a&gt;. Try it out and let me know what you think in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Free Single Page HTML/CSS Template</title>
   <link href="http://www.travisberry.com/2010/12/free-single-page-htmlcss-template"/>
   <updated>2010-12-19T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2010/12/free-single-page-htmlcss-template</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Free Single Page HTML/CSS Template&lt;/h3&gt;
  &lt;a href=&quot;http://oldstatic.travisberry.com/simple-dark-html-template/index.html&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic1.travisberry.com/wp-content/uploads/2010/12/simple-dark-screencap.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: December 12, 2010&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;I have just completed a new HTML CSS template for you to download. The site is made for those who need a simple single page web presence. The site is easy to modify and get setup. &lt;a href=&quot;http://oldstatic.travisberry.com/simple-dark-html-template/index.html&quot;&gt;Check out the demo.&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;You can visit the github page &lt;a href=&quot;https://github.com/ninetwentyfour/Simple-Dark-HTML-Template&quot;&gt;here&lt;/a&gt;, or you can grab the zip direct &lt;a href=&quot;http://github.com/ninetwentyfour/Simple-Dark-HTML-Template/zipball/master&quot;&gt;here&lt;/a&gt;.If you like it, or use it somewhere, let me know in the comments.&lt;/p&gt;

&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Clean URL's in Nginx</title>
   <link href="http://www.travisberry.com/2010/11/clean-urls-in-nginx"/>
   <updated>2010-11-07T00:00:00-06:00</updated>
   <id>http://www.travisberry.com/2010/11/clean-urls-in-nginx</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Clean URL's in Nginx&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/wwworks/612350664 /&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/soap.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: November 07, 2010&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;Quick post to let everyone know of a good trick I just figured out. Most clean URL's are created through a rewrite and query page that does all the work. Sometimes though you just want to have a couple php scripts that you can link to like http://oldstatic.travisberry.com/example&lt;/p&gt;

&lt;p&gt;In Apache this is trivial. In Nginx, you can spend a couple days trying to get right.&lt;/p&gt;

&lt;p&gt;Turns out the solution is simple. If you use a block of code like this&lt;/p&gt;

&lt;script src='https://gist.github.com/1177191.js?file=example1.txt'&gt;&lt;/script&gt;


&lt;p&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;## Parse all .php file in the /var/www directory
location ~ .php$&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;   location ~ \.php$ {
   fastcgi_split_path_info ^(.+\.php)(.*)$;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  /var/www$fastcgi_script_name;
    include fastcgi_params;
    fastcgi_param  QUERY_STRING     $query_string;
    fastcgi_param  REQUEST_METHOD   $request_method;
    fastcgi_param  CONTENT_TYPE     $content_type;
    fastcgi_param  CONTENT_LENGTH   $content_length;
    fastcgi_intercept_errors        on;
    fastcgi_ignore_client_abort     off;
    fastcgi_connect_timeout 60;
    fastcgi_send_timeout 180;
    fastcgi_read_timeout 180;
    fastcgi_buffer_size 128k;
    fastcgi_buffers 4 256k;
    fastcgi_busy_buffers_size 256k;
    fastcgi_temp_file_write_size 256k;
}&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/noscript&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;to turn on PHP, just replace the location with&lt;/p&gt;

&lt;script src='https://gist.github.com/1177191.js?file=example2.txt'&gt;&lt;/script&gt;


&lt;p&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;location ~ $&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;&lt;/p&gt;

&lt;p&gt;and comment out&lt;/p&gt;

&lt;script src='https://gist.github.com/1177191.js?file=example3.txt'&gt;&lt;/script&gt;


&lt;p&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;##fastcgi_split_path_info ^(.+.php)(.*)$;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;&lt;/p&gt;

&lt;p&gt;Your code block should now look like&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/1177191.js?file=example4.txt&quot;&gt;&lt;/script&gt;


&lt;p&gt;Now instead of linking to /example.php, you can save the file with no extension, put it on your server, and link to /example&lt;/p&gt;

&lt;p&gt;Nginx will now handle files without and extension as PHP files. This is a solution that will only fit a limited number of use cases, but compared to writing a rewrite wrapper, this is quick and easy.&lt;/p&gt;

&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Lightning Fast PHP Server With Nginx, eAccelerator, and Varnish</title>
   <link href="http://www.travisberry.com/2010/10/lightning-fast-php-server-with-nginx-eaccelerator-and-varnish"/>
   <updated>2010-10-17T00:00:00-06:00</updated>
   <id>http://www.travisberry.com/2010/10/lightning-fast-php-server-with-nginx-eaccelerator-and-varnish</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Lightning Fast PHP Server With Nginx, eAccelerator, and Varnish&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/jurvetson/10438860/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic3.travisberry.com/wp-content/uploads/2010/10/nginx_server.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-10-17&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;In the word of servers, Apache is still the undisputed king. It’s extendability and ability to run anything you can throw at it has led to it being the number one most used server in the world. Just because it has large numbers though, doesn’t mean it’s the best in terms of performance.&lt;/p&gt;

&lt;p&gt;When running a site with lots of traffic, Apache can quickly grow into a large beast. This can be overcome by throwing more machines (and money) at the problem, but for many companies and people, that simply isn’t an option. Instead why not squeeze every piece of performance that you can out of your existing tech.&lt;/p&gt;

&lt;p&gt;Enter Nginx. &quot;Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&quot; In other words, it will run faster and more efficiently than Apache.&lt;/p&gt;

&lt;p&gt;Installing Nginx on Ubuntu is fairly simple.&lt;/p&gt;

&lt;p&gt;A simple&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177105.js?file=example1.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo apt-get install nginx&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;will get you started.&lt;/p&gt;

&lt;p&gt;Now edit the file in &lt;em&gt;/etc/nginx/sites-available/default&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;change it to&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177105.js?file=example2.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;# You may add here your
# server {
#       ...
# }
# statements for each of your virtual hosts

server {
    listen   8080;
    server_name  localhost;
    access_log  /var/log/nginx/localhost.access.log;
## Default location
    location / {
        root   /var/www;
        index  index.php;
    }

## Images and static content is treated different
    location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
      access_log        off;
      expires           30d;
      root /var/www;
    }
## Parse all .php file in the /var/www directory
        location ~ .php$ {
        fastcgi_split_path_info ^(.+\.php)(.*)$;
        fastcgi_pass   backend;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /var/www$fastcgi_script_name;  
        include fastcgi_params;
        fastcgi_param  QUERY_STRING     $query_string;
        fastcgi_param  REQUEST_METHOD   $request_method;
        fastcgi_param  CONTENT_TYPE     $content_type;
        fastcgi_param  CONTENT_LENGTH   $content_length;
        fastcgi_intercept_errors        on;
        fastcgi_ignore_client_abort     off;
        fastcgi_connect_timeout 60;
        fastcgi_send_timeout 180;
        fastcgi_read_timeout 180;
        fastcgi_buffer_size 128k;
        fastcgi_buffers 4 256k;
        fastcgi_busy_buffers_size 256k;
        fastcgi_temp_file_write_size 256k;
    }

## Disable viewing .htaccess &amp;amp; .htpassword
   location ~ /\.ht {
       deny  all;
    }
}
upstream backend {
        server 127.0.0.1:9000;
}

        #error_page  404  /404.html;

        # redirect server error pages to the static page /50x.html
        #
        #error_page   500 502 503 504  /50x.html;
        #location = /50x.html {
        #       root   /var/www/nginx-default;
        #}

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
                #proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
                #fastcgi_pass   127.0.0.1:9000;
                #fastcgi_index  index.php;
                #fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
                #includefastcgi_params;



# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
#listen   8000;
#listen   somename:8080;
#server_name  somename  alias  another.alias;

#location / {
#root   html;
#index  index.html index.htm;
#}
#}


# HTTPS server
#
#server {
#listen   443;
#server_name  localhost;
#ssl  on;
#ssl_certificate  cert.pem;
#ssl_certificate_key  cert.key;

#ssl_session_timeout  5m;

#ssl_protocols  SSLv3 TLSv1;
#ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
#ssl_prefer_server_ciphers   on;

#location / {
#root   html;
#index  index.html index.htm;
#}
#}&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;This assumes your root web folder is &lt;em&gt;/var/www&lt;/em&gt;. You’ll also notice I have it set to listen on port 8080 and not the normal 80. This comes into play later when we setup of Varnish, so just go with me for now.&lt;/p&gt;

&lt;p&gt;Now we need to get PHP installed so we can actually serve PHP files.&lt;/p&gt;

&lt;p&gt;As usual start with&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177105.js?file=example3.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo apt-get install php5-cli php5-common php5-suhosin&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;then&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177105.js?file=example4.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo apt-get install php5-fpm php5-cgi&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;You may have to add &lt;em&gt;deb http://php53.dotdeb.org stable all&lt;/em&gt; to your packages list for php5-fpm and php5-cgi to show up.&lt;/p&gt;

&lt;p&gt;Before configuring PHP let’s install eAccelerator. &quot;eAccelerator is a free open-source PHP accelerator &amp;amp; optimizer. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases the speed of your PHP code by 1-10 times.&quot;&lt;/p&gt;

&lt;p&gt;First&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177105.js?file=example6.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo apt-get install php5-dev&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;then&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177105.js?file=example7.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo apt-get install make&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Now cd into &lt;em&gt;/tmp/&lt;/em&gt;&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177105.js?file=example8.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;wget http://bart.eaccelerator.net/source/0.9.6.1/eaccelerator-0.9.6.1.tar.bz2

tar xvjf eaccelerator-0.9.6.1.tar.bz2

cd eaccelerator-0.9.6.1/

sudo phpize

sudo ./configure –enable-eaccelerator=shared

sudo make

sudo make install&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Now edit &lt;em&gt;/etc/php5/fpm/php.ini&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;and right under the [PHP] block add&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177105.js?file=example9.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;; eAccelerator configuration
; Note that eAccelerator may also be installed as a PHP extension or as a zend_$
; If you are using a thread safe build of PHP you must use
; zend_extension_ts instead of zend_extension
;extension                       = &amp;quot;/usr/lib/php5/20090626+lfs/eaccelerator.so&amp;quot;
zend_extension                  = &amp;quot;/usr/lib/php5/20090626+lfs/eaccelerator.so&amp;quot;
eaccelerator.shm_size           = &amp;quot;16&amp;quot;
eaccelerator.cache_dir          = &amp;quot;/var/cache/eaccelerator&amp;quot;
eaccelerator.enable             = &amp;quot;1&amp;quot;
eaccelerator.optimizer          = &amp;quot;1&amp;quot;
eaccelerator.check_mtime        = &amp;quot;1&amp;quot;
eaccelerator.debug              = &amp;quot;0&amp;quot;
eaccelerator.filter             = &amp;quot;&amp;quot;
eaccelerator.shm_max            = &amp;quot;0&amp;quot;
eaccelerator.shm_ttl            = &amp;quot;0&amp;quot;
eaccelerator.shm_prune_period   = &amp;quot;0&amp;quot;
eaccelerator.shm_only           = &amp;quot;0&amp;quot;
eaccelerator.compress           = &amp;quot;1&amp;quot;
eaccelerator.compress_level     = &amp;quot;9&amp;quot;
eaccelerator.allowed_admin_path = &amp;quot;/var/www/eaccelerator&amp;quot;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Now restart PHP&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177110.js?file=example10.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo /etc/init.d/php5-fpm restart&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Then restart Nginx&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177110.js?file=example11.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo /etc/init.d/nginx restart&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Now if you hit http://localhost:8080/index.php you should see your site.&lt;/p&gt;

&lt;p&gt;The only thing left to setup at this point is Varnish.&lt;/p&gt;

&lt;p&gt;&quot;Varnish store web pages in memory so the web servers don’t have to create the same web page over and over again. The web server only recreate a page when it is changed. Additionally Varnish can serve web pages much faster then any application server is capable of – giving the website a significant speed up.&quot;&lt;/p&gt;

&lt;p&gt;Install with&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177110.js?file=example12.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo apt-get install varnish&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;After install run&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177110.js?file=example13.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;pkill varnishd&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;to make sure it’s not running while we configure it.&lt;/p&gt;

&lt;p&gt;Now run&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177110.js?file=example14.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo varnishd -f /etc/varnish/default.vcl -s malloc,1G -T 127.0.0.1:2000&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Varnish should now be running. Check by typing&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177110.js?file=example15.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;varnishlog&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;If you see a series of lines then Varnish should be working.&lt;/p&gt;

&lt;p&gt;You can run one more test by going to your browser and reloading the page.&lt;/p&gt;

&lt;p&gt;If you see results like&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177110.js?file=example16.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;12 SessionOpen  c 192.168.10.101 51732 :80
   12 ReqStart     c 192.168.10.101 51732 1440203205
   12 RxRequest    c GET
   12 RxURL        c /favicon.ico
   12 RxProtocol   c HTTP/1.1
   12 RxHeader     c Host: www.ironyogistudios.com
   12 RxHeader     c User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10
   12 RxHeader     c Accept: image/png,image/*;q=0.8,*/*;q=0.5
   12 RxHeader     c Accept-Language: en-us,en;q=0.5
   12 RxHeader     c Accept-Encoding: gzip,deflate
   12 RxHeader     c Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
   12 RxHeader     c Keep-Alive: 115
   12 RxHeader     c Connection: keep-alive&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Then Varnish is correctly intercepting your requests. Varnish is getting the requests on port 80 forwarding them to Nginx if needed through port 8080, which is why we set it to 8080 earlier. You can set the port to foward in /etc/varnish/default.vcl. You can learn more about the setup and optimization of Varnish here.&lt;/p&gt;

&lt;p&gt;You should now have a lighting fast PHP server. This setup is a pretty basic configuration so I’m sure by tweaking each individual component to your needs would get even more performance out of it. Compared to a base Apache config, though, this is fantastic.&lt;/p&gt;

&lt;p&gt;If you have some optimization techniques, or have any questions, let me know in the comments.&lt;/p&gt;

&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Remove WordPress' NoFollow Without A Plugin</title>
   <link href="http://www.travisberry.com/2010/10/remove-wordpress-nofollow-without-a-plugin"/>
   <updated>2010-10-03T00:00:00-06:00</updated>
   <id>http://www.travisberry.com/2010/10/remove-wordpress-nofollow-without-a-plugin</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Remove WordPress' NoFollow Without A Plugin&lt;/h3&gt;
  &lt;a href=&quot;http://www.siliakatung.com/exhibition.htm&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic2.travisberry.com/do_follow.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-10-03&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;And even better, do so without modifying the WordPress core files. It's really quite simple.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;In your templates functions.php file add&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177082.js?file=example1.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php
function comment_author_link_mine( $comment_ID = 0 ) {
    echo get_comment_author_link_mine( $comment_ID );
}

function get_comment_author_link_mine( $comment_ID = 0 ) {
    /** @todo Only call these functions when they are needed. Include in if... else blocks */
    $url    = get_comment_author_url( $comment_ID );
    $author = get_comment_author( $comment_ID );

    if ( empty( $url ) || 'http://' == $url )
        $return = $author;
    else
        $return = &amp;quot;&amp;lt;a href='$url' class='comment_url'&amp;gt;$author&amp;lt;/a&amp;gt;&amp;quot;;
    return apply_filters('get_comment_author_link', $return);
}
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Then in your comments.php file, find and replace any mention of&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177082.js?file=example2.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php comment_author_link(); ?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;With&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177082.js?file=example3.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php comment_author_link_mine(); ?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;This simply replaces the core files &quot;comment_author_link()&quot; function with one of our own. The original has&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177082.js?file=example4.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;$return = &amp;quot;&amp;lt;a href='$url' rel='external nofollow' class='url'&amp;gt;$author&amp;lt;/a&amp;gt;&amp;quot;;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;as the link. We simply remove the rel attribute and change it to&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177082.js?file=example5.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;$return = &amp;quot;&amp;lt;a href='$url' class='comment_url'&amp;gt;$author&amp;lt;/a&amp;gt;&amp;quot;;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;and it removes the nofollow attribute from your comments. No modifying of the core files, and one less plugin to deal with.&lt;/p&gt;

&lt;p&gt;If you have tips for removing other plugins and using your own solution, let me know in the comments.&lt;/p&gt;

&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>If is_page() With Regular PHP</title>
   <link href="http://www.travisberry.com/2010/10/if-is_page-with-regular-php"/>
   <updated>2010-10-02T00:00:00-06:00</updated>
   <id>http://www.travisberry.com/2010/10/if-is_page-with-regular-php</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;If is_page() With Regular PHP&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/14277117@N03/3865517102&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic1.travisberry.com/wp-content/uploads/2010/10/paper_machine.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-10-02&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;My article on &lt;a href=&quot;http://www.travisberry.com/2010/01/use-wordpress-is_page-to-display-custom-content/&quot;&gt;WordPress' is_page()&lt;/a&gt; is one of the most popular articles on my site. One thing I receive questions about on a regular basis, is how to use is_page() in regular PHP.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;Well the downside is, you can't. The upside is that you can still perform a similar check&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177074.js?file=example1.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php
    $baseurl = 'http://www.example.com'; //set the base url of the site
    $pageYouWant = $baseurl.&amp;quot;/the-rest-of-the-url&amp;quot;; //add the rest of the url you want to check against
    $currentPage = $baseurl.$_SERVER['REQUEST_URI'];// this gets the current page url
    if($pageYouWant==$currentPage) {
        //do something
    }
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Not as smooth as is_page() but still a fairly simple way to check the page you are currently on. You can easily check if it is &quot;==&quot;/&quot;!=&quot;, and add in as many &quot;&amp;amp;&amp;amp;&quot;/&quot;||&quot; conditions as you want.&lt;/p&gt;

&lt;p&gt;As always, if you have a better way to do this, or use it in something cool, let me know in the comments.&lt;/p&gt;

&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Use PHP To Zip Folders For Download</title>
   <link href="http://www.travisberry.com/2010/09/use-php-to-zip-folders-for-download"/>
   <updated>2010-09-23T00:00:00-06:00</updated>
   <id>http://www.travisberry.com/2010/09/use-php-to-zip-folders-for-download</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Use PHP To Zip Folders For Download&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/striatic/443918201/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/zip_files.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-09-23&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;Uploading files with PHP is covered to death on the internet. The other side of that, downloading files, is not covered nearly as much.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;When a user uploads say, hundreds of images to a folder, and they want to download them all later, it can turn into a giant time sink making them download the files one at a time.&lt;/p&gt;

&lt;p&gt;A better alternative would be to offer the files individually and with a &quot;Download All As Zip&quot; link.&lt;/p&gt;

&lt;p&gt;I found a solution &lt;a href=&quot;http://www.trash.net/~ck/ontheflyzip/&quot;&gt;here&lt;/a&gt;, but it required putting the php file in every directory you would like to zip. Not exactly the best solution. So I tweaked it to be a bit more dynamic.&lt;/p&gt;

&lt;p&gt;This code is based on the assumption that there is a folder called something like &lt;em&gt;user_uploads&lt;/em&gt; with a sub-folder for each user, something like &lt;em&gt;Travis_Berry&lt;/em&gt;&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177068.js?file=example1.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php
    //Get the directory to zip
    $filename_no_ext= $_GET['directtozip'];

    // we deliver a zip file
    header(&amp;quot;Content-Type: archive/zip&amp;quot;);

    // filename for the browser to save the zip file
    header(&amp;quot;Content-Disposition: attachment; filename=$filename_no_ext&amp;quot;.&amp;quot;.zip&amp;quot;);

    // get a tmp name for the .zip
    $tmp_zip = tempnam (&amp;quot;tmp&amp;quot;, &amp;quot;tempname&amp;quot;) . &amp;quot;.zip&amp;quot;;

    //change directory so the zip file doesnt have a tree structure in it.
    chdir('user_uploads/'.$_GET['directtozip']);
   
    // zip the stuff (dir and all in there) into the tmp_zip file
    exec('zip '.$tmp_zip.' *');
   
    // calc the length of the zip. it is needed for the progress bar of the browser
    $filesize = filesize($tmp_zip);
    header(&amp;quot;Content-Length: $filesize&amp;quot;);

    // deliver the zip file
    $fp = fopen(&amp;quot;$tmp_zip&amp;quot;,&amp;quot;r&amp;quot;);
    echo fpassthru($fp);

    // clean up the tmp zip file
    unlink($tmp_zip);
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Save this code as zip_folders.php&lt;/p&gt;

&lt;p&gt;Then when you want to provide a link to download a users uploads as a zip file, you link to it like,&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177068.js?file=example2.html'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;a href=&amp;quot;zip_folders.php?directtozip=THE USERS DIRECTORY&amp;quot;&amp;gt;Download All As Zip&amp;lt;/a&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;That will cause a download prompt to appear for the user when clicking on the link.&lt;/p&gt;

&lt;p&gt;You'll notice I use the &lt;a href=&quot;http://linux.about.com/od/commands/l/blcmdl1_zip.htm&quot;&gt;system Zip command&lt;/a&gt; as opposed to the &lt;a href=&quot;http://www.php.net/manual/en/book.zip.php&quot;&gt;PHP Zip extension&lt;/a&gt;. For more complex Zipping needs, it looks like it would be a better alternative. For something simple like this, I find the system call sufficient.&lt;/p&gt;

&lt;p&gt;If you find this post useful, or have any PHP Zip tips, let me know in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Upload Videos To MediaSilo With PHP/FTP</title>
   <link href="http://www.travisberry.com/2010/09/upload-videos-to-mediasilo-with-phpftp"/>
   <updated>2010-09-18T00:00:00-06:00</updated>
   <id>http://www.travisberry.com/2010/09/upload-videos-to-mediasilo-with-phpftp</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Upload Videos To MediaSilo With PHP/FTP&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/spiesteleviv/3654728245/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic3.travisberry.com/wp-content/uploads/2010/09/media_silo_pic.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-09-18&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;In continuing with my last post on &lt;a href=&quot;http://www.travisberry.com/2010/09/upload-a-video-to-ooyala-with-php/&quot;&gt;how to upload videos to Ooyala with PHP&lt;/a&gt;, here is one for &lt;a href=&quot;http://www.mediasilo.com/&quot;&gt;MediaSilo&lt;/a&gt;. This ones a little different though in that it uses FTP as opposed to an API to upload the videos.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;Alright, so let's get to the code.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177059.js?file=example1.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php
    //MediaSilo Information
    $server = &amp;quot;upload.mediasilo.com&amp;quot;;
    $ftp_user_name = &amp;quot;YOUR MEDIASILO LOGIN NAME AND HOSTNAME(e.g NAMEHOSTNAME&amp;quot;;
    $ftp_user_pass = &amp;quot;YOUR MEDIASILO LOGIN PASSWORD&amp;quot;;
    $dest = &amp;quot;THE WORKSPACE YOU WANT TO UPLOAD TO&amp;quot;;
                               
    //Video Folder Information
    $source_folder = &amp;quot;FULL PATH TO FOLDER. NO TRAILING SLASH (e.g. /var/www/videofolder)&amp;quot;;
    //Grabs everything in the source folder. You may want to set a file type like, ($source_folder.&amp;quot;/*.flv&amp;quot;)
    $sources = glob($source_folder.&amp;quot;/*.*&amp;quot;);
               
    //Connect to FTP
    set_time_limit(0);
    $connection = ftp_connect($server);
    $login = ftp_login($connection, $ftp_user_name, $ftp_user_pass);

    //Check connection
    if (!$connection || !$login) {
        die('Connection attempt failed!');
    }
               
    //If there are no files, don't FTP to MediaSilo
    if (empty($sources)) {
        //Close the FTP connection
        ftp_close($connection);
        $fileUploadMessage = &amp;quot;No files selected for upload&amp;quot;;
        echo $fileUploadMessage;
    }else{
        //If there are files FTP them to MediaSilo
        foreach ($sources as $source){
            //Put each video file on FTP server
            $upload = ftp_put($connection, $dest.&amp;quot;/&amp;quot;.basename($source) , $source, FTP_BINARY);
            //Check upload status
            //Display message
            if (!$upload) {
                echo &amp;quot;Cannot upload: &amp;quot;.basename($source).&amp;quot; &amp;lt;br /&amp;gt;&amp;quot;;
            }else{
                echo &amp;quot;Upload complete: &amp;quot;.basename($source).&amp;quot; &amp;lt;br /&amp;gt;&amp;quot;;
            }
        }
        //Close the FTP connection
        ftp_close($connection);
    //Videos should now be uploaded to MediaSilo
    }
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;The above code should be fairly easy to understand. The code just globs a folder of all files and loops through them, uploading each one.&lt;/p&gt;

&lt;p&gt;If you have any ideas on how to make this code better, or expand upon it, let me know in the comments.&lt;/p&gt;

&lt;p&gt;(One caveat to using FTP to upload to MediaSilo is that you do need to have at least a “Hollywood” level account, which is going to set you back $100 a month)&lt;/p&gt;

&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Upload A Video To Ooyala With PHP</title>
   <link href="http://www.travisberry.com/2010/09/upload-a-video-to-ooyala-with-php"/>
   <updated>2010-09-11T00:00:00-06:00</updated>
   <id>http://www.travisberry.com/2010/09/upload-a-video-to-ooyala-with-php</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Upload A Video To Ooyala With PHP&lt;/h3&gt;
  &lt;a href=&quot;http://www.cl.cam.ac.uk/Relics/archive_photos.html&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic2.travisberry.com/ooyala_upload.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-09-11&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: &lt;a href=&quot;https://github.com/ninetwentyfour/Ooyala-Uploader&quot;&gt;You can find a better/updated Ooyala class here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.ooyala.com/&quot;&gt;Ooyala&lt;/a&gt; is a fairly popular video hosting platform. We have started using them where I work, and they seem to be doing a really good job so far. One of the advantages of Ooyala is their nice API. They have some &lt;a href=&quot;http://www.ooyala.com/support/docs/backlot_api#example&quot;&gt;example code&lt;/a&gt; for you to use, but one feature that was lacking was uploading. They also have a widget that does do uploading but it is handled through Flash, something I wanted to avoid.&lt;/p&gt;

&lt;p&gt;This example builds on top of their existing PHP code. Here is the final code. (You're really going to want to copy paste this into a real code editor, my code tag makes me really mess with my formatting. Apologies.)&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177051.js?file=example1.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php
/**
*Publish video to ooyala
*/
function publish(){// this kicks off the massive publish functions
    $labels = $_POST['label'];
    $file = $_POST['video_file'];
    $dir = $file;
    $name = explode(&amp;quot;/&amp;quot;, $dir );
    $name = array_reverse($name );//this get just the name of the file and not
    //the whole path for the name and title of the video
    $nameforshow = $name[0];
    $label = '/'.$labels;
    $filesize = filesize($dir);
    $expires = time() + 900;
    $upload = OrdersController::upload(array('expires' =&amp;gt; $expires,
                                             'file_size' =&amp;gt; $filesize,
                                             'file_name' =&amp;gt; $name[0],
                                             'title' =&amp;gt; $name[0]),$dir,$label);
                                            //send this to the upload function
}

function upload($params,$dir,$label){//this passes to the send request function
                                    //for the first time
    return OrdersController::send_request('create_video', $params,$dir,
                                          $label,'');
}

function upload_complete($params,$label2){//this gets hit after posting the
                                        //video to ooyala
    $label3 = $label2;
    $dir ='';
    $label = '';
    return OrdersController::send_request('upload_complete', $params,
                                          '','',$label3);
                            //goes back to send request for the second time
}

function assign_label($params){//this starts creating and assigning labels
    return OrdersController::send_request2('labels', $params);//this kicks off
                                                            //send request 2
}

function send_request($request_type, $params,$dir,$label,$label3){
    // first time through this hits the create video url and returns a url
    //to post the video to. second time through we hit the upload complete url
    $ooyala_pcode = 'PUT YOUR OOYALA PARTNER CODE HERE';
    $ooyala_scode = 'PUT YOUR OOYALA SECRET CODE HERE';
    if (!array_key_exists('expires', $params)) {
        $params['expires'] = time() + 900;
    }
    $string_to_sign = $ooyala_scode;
    $url = 'http://api.ooyala.com/ingestion/'.$request_type.'?pcode='.$ooyala_pcode;
    $keys = array_keys($params);
    sort($keys);
    foreach ($keys as $key) {
        $string_to_sign .= $key.'='.$params[$key];
        $url .= '&amp;amp;'.rawurlencode($key).'='.rawurlencode($params[$key]);
    }
    $digest = hash('sha256', $string_to_sign, true);
    $signature = ereg_replace('=+$', '', trim(base64_encode($digest)));
    $url .= '&amp;amp;signature='.rawurlencode($signature);
    if ($request_type == 'create_video') {// if type is create video then
                                    //parse the returned xml for the post url
        $xml = simplexml_load_file($url);
        foreach($xml-&amp;gt;children() as $child){
            if($child-&amp;gt;getName()=='embedCode'){
                $embed_code = $child;
            }
            if($child-&amp;gt;getname()=='urls'){
                $upload_url = $child-&amp;gt;children();
                $file= $dir;
                $label2 = $label;
                $ch = curl_init($upload_url);
                curl_setopt($ch, CURLOPT_POSTFIELDS, array('file'=&amp;gt;&amp;quot;@$file&amp;quot;));
                //post the file
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                $postResult = curl_exec($ch);
                curl_close($ch);
                if ($postResult != ''){
                    $upload_complete = OrdersController::upload_complete(array
                                        ('embed_code' =&amp;gt; $embed_code),$label2);
                    //after posting you have to hit the upload complete url
                    //to get ooyala to process the video.
                    //so kick this up to the upload complete function
                }
            }
        }
    }else{
        if ($request_type == 'upload_complete') {
            // hit the upload complete url
            $ch = curl_init($url);
            $postResult2 = curl_exec($ch);
            curl_close($ch);
            $add_label = OrdersController::assign_label(array(
            'embedCodes' =&amp;gt; $params['embed_code'], 'labels' =&amp;gt; $label3,
            'mode'=&amp;gt;'assignLabels'));
            // this kicks back up to assign label function to add a label
            //to the video
        }
    }
}

function send_request2($request_type, $params)
// this creates the url to hit to add a label to the last uploaded video
{
    $ooyala_pcode = 'PUT YOUR OOYALA PARTNER CODE HERE';
    $ooyala_scode = 'PUT YOUR OOYALA SECRET CODE HERE';
    //Add an expire time of 15 minutes unless otherwise specified
    if (!array_key_exists('expires', $params)) {
        $params['expires'] = time() + 900;
    }
    $string_to_sign = $ooyala_scode;
    $url = 'http://api.ooyala.com/partner/'.$request_type.'?pcode='.$ooyala_pcode;
    $keys = array_keys($params);
    sort($keys);
    foreach ($keys as $key) {
        $string_to_sign .= $key.'='.$params[$key];
        $url .= '&amp;amp;'.rawurlencode($key).'='.rawurlencode($params[$key]);
    }
    $digest = hash('sha256', $string_to_sign, true);
    $signature = ereg_replace('=+$', '', trim(base64_encode($digest)));
    $url .= '&amp;amp;signature='.rawurlencode($signature);
    $ch = curl_init($url);
    $postResult3 = curl_exec($ch);
    curl_close($ch);//now the video is done and uploaded to ooyala
}
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Essentially, you want to create an upload form, and post the values to the publish() function. From there you should be good to go.&lt;/p&gt;

&lt;p&gt;I’m sure there is an easier way to do this, so if you know how to improve this, please let me know in the comments.&lt;/p&gt;

&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Reasons And Tips For Automated Motion Workflow</title>
   <link href="http://www.travisberry.com/2010/08/reasons-and-tips-for-automated-motion-workflow"/>
   <updated>2010-08-07T00:00:00-06:00</updated>
   <id>http://www.travisberry.com/2010/08/reasons-and-tips-for-automated-motion-workflow</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Reasons And Tips For Automated Motion Workflow&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/whsimages/998243013/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic1.travisberry.com/wp-content/uploads/2010/08/assembly_line.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-08-07&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;In many video projects there is some style of graphic, lower third, or bumper that is used numerous time throughout the piece, only requiring a text change. Or you will have clients that sell templatized videos, who just need someone to change the default text overlays inside the base video.&lt;/p&gt;

&lt;p&gt;Both of these problems can be done by hand, wasting hours upon hours copy and pasting information. The better way would be to reduce the people down to some data entry and auto generate the rest.&lt;/p&gt;

&lt;p&gt;Well we tried to do just that at work recently. Our job was to make a automated solution that would allow someone to upload a CSV to a web app and have a folder of videos at the end.&lt;/p&gt;

&lt;p&gt;At first we came up with a solution that was way too complicated. We were going to create image files for the slates dynamically, then stitch them onto a base video. The system would have worked, but it was unwieldy and unnecessarily complex. Next we decided to use a solution using After Effects. We did get this one working, but like the previous idea, the system for using it was shoddy at best. One thing I did really like about this method was it taught me a whole lot about the .jsx format. Namely that it's just a wrapper for javascript. :)&lt;/p&gt;

&lt;p&gt;Finally we realized Motion would be the perfect solution for our task. Not only is the rest of our workflow done through FCP and FCS, but it's ability to work without needing a bunch of hacked together parts was fantastic. The render speed was much greater than the other solutions thanks to the fact that we could use our already existing Qmaster cluster.&lt;/p&gt;

&lt;p&gt;A quick overview of our system is&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Editors create Motion template files and upload them to our system.&lt;/li&gt;
&lt;li&gt;User hits a web app developed in CakePHP.&lt;/li&gt;
&lt;li&gt;The user hits generate videos and uploads a CSV.&lt;/li&gt;
&lt;li&gt;Our system parses the information in the CSV and matches it to the correct template Motion file.&lt;/li&gt;
&lt;li&gt;The system takes a template Motion file and duplicates it to a new folder with the slate text replaced with information from the CSV&lt;/li&gt;
&lt;li&gt;The output folder of the new Motion files is a watch folder for Compressor.&lt;/li&gt;
&lt;li&gt;Compressor grabs the Motion files and renders them out to a specified folder with encoding settings defaulted for the job.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;After this you can continue on with your normal delivery process. If that involves uploading to a video platform, this should easily be automated as well.&lt;/p&gt;

&lt;p&gt;Unfortunately I can't post any of the code we wrote for the project but I can point you to a few places we went for help.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.kenstone.net/fcp_homepage/xml_hodgetts.html&quot;&gt;What is XML and what does it mean for Final Cut Studio users? &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://developer.apple.com/mac/library/documentation/AppleApplications/Conceptual/motion_XML_guide/About/About.html&quot;&gt;Motion XML Documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://book.cakephp.org/view/624/Xml-parsing&quot;&gt;CakePHP XML Parsing&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://mrphp.com.au/code/importing-data-csv-cakephp&quot;&gt;Import CSV to CakePHP&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.macworld.com/article/54083/2006/11/compressor_watch_folder_tip.html&quot;&gt;Creating a Watch Folder for Compressor 2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One thing we came across and spent many hours trouble shooting was the crashing of our outputted Motion files. Once they tried to run the compressor droplet, it would crash. No matter how we would diff the files we couldn't find any difference between the original and the output, apart from the replaced text.&lt;/p&gt;

&lt;p&gt;We finally discovered the solution.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177036.js?file=example1.xml'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;styleRun style=&amp;quot;10178&amp;quot; offset=&amp;quot;0&amp;quot; length=&amp;quot;1&amp;quot;/&amp;gt;
&amp;lt;text&amp;gt;Website&amp;lt;/text&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;This is part of the Motion XML file. &lt;em&gt;Website&lt;/em&gt; is the text being replaced. Above that is a length set in styleRun. This is normally set to the length of the placeholder text. In this case it would be 7. If you replace the word with one that is longer you have no problem. The Motion file will render like a champ. If it's shorter all hell breaks loose. So the fix is as simple as changing them all to 1. No more crashing.&lt;/p&gt;

&lt;p&gt;Other than that, the rest of the process was really straight forward. It has reduced the amount of time the editors need to spend on this client dramatically, leaving them open for other work.&lt;/p&gt;

&lt;p&gt;Motion's packaging of XML makes automating it surprisingly simple. We plan to explore its capabilities and look for even more places where we can automate the workflow.&lt;/p&gt;

&lt;p&gt;If you have tips, tricks, or stories of Motion automation, let me know in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Create A Ghetto, But Functional, Search Function For CakePHP</title>
   <link href="http://www.travisberry.com/2010/06/create-a-ghetto-but-functional-search-function-for-cakephp"/>
   <updated>2010-06-21T00:00:00-06:00</updated>
   <id>http://www.travisberry.com/2010/06/create-a-ghetto-but-functional-search-function-for-cakephp</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Create A Ghetto, But Functional, Search Function For CakePHP&lt;/h3&gt;
  &lt;a href=&quot;http://store.steampowered.com/app/400/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/portalcake2.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-06-21&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;Recently I needed to add a search function for a &lt;a href=&quot;http://cakephp.org/&quot;&gt;CakePHP&lt;/a&gt; application I am building. After googling the bejeezus out of it, I never found a solution that worked. Some required the use of a search table, which then needed to index all of your content, other's just didn't work at all.&lt;/p&gt;

&lt;p&gt;After much hacking around I came up with a solution that works for me. This may or may not solve your particular problem, but it may help get you started in the right direction.&lt;/p&gt;

&lt;p&gt;I'll be using a fairly standard User MVC for this demo.&lt;/p&gt;

&lt;p&gt;First, I started in the view. Instead of using the built in cakephp form helpers, I hand coded my inputs. You could easily use the form helpers though. Just make sure to set the value on certain inputs.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177028.js?file=example1.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;div id=&amp;quot;search&amp;quot;&amp;gt;
    &amp;lt;form id=&amp;quot;orderform&amp;quot; action=&amp;quot;&amp;lt;?php echo $html-&amp;gt;url('/users/search'); ?&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot; enctype=&amp;quot;multipart/form-data&amp;quot;&amp;gt;
    &amp;lt;label for=&amp;quot;searchuser&amp;quot;&amp;gt;Search Users:&amp;lt;/label&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;searchuser&amp;quot; /&amp;gt;
    Search By:
    &amp;lt;input type=&amp;quot;radio&amp;quot; name=&amp;quot;searchtype&amp;quot; value=&amp;quot;User.id&amp;quot;  checked&amp;gt; User ID
    &amp;lt;input type=&amp;quot;radio&amp;quot; name=&amp;quot;searchtype&amp;quot; value=&amp;quot;User.email&amp;quot;  checked&amp;gt; User Email
    &amp;lt;input type=&amp;quot;radio&amp;quot; name=&amp;quot;searchtype&amp;quot; value=&amp;quot;Entity.name&amp;quot;&amp;gt; Entity Name
    &amp;lt;?php
        echo $form-&amp;gt;end('Search');
    ?&amp;gt;
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;The code is fairly straight forward. In the form tag I declared which action in the controller to use. The input tags are really straight forward. The only thing to note is in the search type radio buttons, the value is set to the Model.fieldname. This is important later on. But make sure to set them to the models you intend to search.&lt;/p&gt;

&lt;p&gt;Now in the controller, it's time to add the search action.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177028.js?file=example2.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php
function search() {
    $searchtype = $_POST['searchtype'];
    $value = $_POST['searchuser'];
    $results = $this-&amp;gt;User-&amp;gt;find('all', array('fields' =&amp;gt; array(
                                                                'User.id',
                                                                'User.email',
                                                                'Entity.name',
                                                                'User.created',
                                                                'User.modified'
                                                                ),
                                                'order' =&amp;gt; 'User.id ASC',
                                                'conditions' =&amp;gt; array($searchtype . ' ' . 'LIKE' =&amp;gt; '%'.$value.'%')
                                            ));
    $this-&amp;gt;set('results', $results);
}
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;It's really a pretty standard find all but the key lies in the conditions. They are set to variables that are posted through the form. So if you selected Order ID as the type and entered 1 in the search box. Your condition would be array('Order.id' =&gt; %1%) One last thing is to create the search.ctp&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1177028.js?file=example3.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;div id=&amp;quot;search&amp;quot;&amp;gt;
    &amp;lt;form id=&amp;quot;orderform&amp;quot; action=&amp;quot;&amp;lt;?php echo $html-&amp;gt;url('/users/search'); ?&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot; enctype=&amp;quot;multipart/form-data&amp;quot;&amp;gt;
    &amp;lt;label for=&amp;quot;searchuser&amp;quot;&amp;gt;Search Users:&amp;lt;/label&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;searchuser&amp;quot; /&amp;gt;
    Search By:
    &amp;lt;input type=&amp;quot;radio&amp;quot; name=&amp;quot;searchtype&amp;quot; value=&amp;quot;User.id&amp;quot;  checked&amp;gt; User ID
    &amp;lt;input type=&amp;quot;radio&amp;quot; name=&amp;quot;searchtype&amp;quot; value=&amp;quot;User.email&amp;quot;  checked&amp;gt; User Email
    &amp;lt;input type=&amp;quot;radio&amp;quot; name=&amp;quot;searchtype&amp;quot; value=&amp;quot;Entity.name&amp;quot;&amp;gt; Entity Name
    &amp;lt;?php echo $form-&amp;gt;end('Search'); ?&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div id=&amp;quot;contentbox&amp;quot;&amp;gt;
    &amp;lt;h2&amp;gt;Manage Users&amp;lt;/h2&amp;gt;
    &amp;lt;table&amp;gt;
        &amp;lt;thead&amp;gt;
            &amp;lt;th&amp;gt;ID&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Email&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Entity Name&amp;lt;/th&amp;gt;
        &amp;lt;/thead&amp;gt;
        &amp;lt;?php foreach($results as $user) : ?&amp;gt;  
            &amp;lt;tr&amp;gt;
                &amp;lt;td&amp;gt;&amp;lt;?php echo $user['User']['id'] ?&amp;gt;&amp;lt;/td&amp;gt;
                &amp;lt;td&amp;gt;&amp;lt;?php echo $user['User']['email'] ?&amp;gt;&amp;lt;/td&amp;gt;
                &amp;lt;td&amp;gt;&amp;lt;?php echo $user['Entity']['name'] ?&amp;gt;&amp;lt;/td&amp;gt;
            &amp;lt;/tr&amp;gt;
        &amp;lt;?php endforeach; ?&amp;gt;
    &amp;lt;/table&amp;gt;
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;It's just a simple loop through the results. I also added the search box to the top of this page, so the user can run another search if they want.&lt;/p&gt;

&lt;p&gt;So it may not be the cleanest solution in the world, but it works well, and is flexible enough so you can tweak it to many different situations. If you have a better way to search with CakePHP, please let me know in the comments. Or feel free to ask any questions.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>How To Setup A LAMP Virtual Machine</title>
   <link href="http://www.travisberry.com/2010/05/comprehensive-guide-to-creating-a-lamp-virtual-machine"/>
   <updated>2010-05-09T00:00:00-06:00</updated>
   <id>http://www.travisberry.com/2010/05/comprehensive-guide-to-creating-a-lamp-virtual-machine</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;How To Setup A LAMP Virtual Machine&lt;/h3&gt;
  &lt;a href=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2010/05/oldcomp.jpg&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic3.travisberry.com/wp-content/uploads/2010/05/oldcomp.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-05-09&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;In an effort to develop in an environment closer to many production servers, many people have begun developing in virtual machines running on their host os. This article is a comprehensive guide to creating a LAMP virtual machine (plus a few other goodies).&lt;/p&gt;

&lt;p&gt;First you need the virtual machine software. Download &lt;a href=&quot;http://www.virtualbox.org/wiki/Downloads&quot;&gt;VirtualBox&lt;/a&gt; and install it on your host os. Once installed go download the latest version of &lt;a href=&quot;http://www.ubuntu.com/GetUbuntu/download&quot;&gt;Ubuntu&lt;/a&gt;. You want the desktop version, not the server. Save the .iso file to your desktop.&lt;/p&gt;

&lt;h2&gt;VirtualBox Setup &amp;amp; Ubuntu Installation&lt;/h2&gt;

&lt;p&gt;Launch VirtualBox and create a new machine by clicking the button in the top left corner. Click next on the screen the comes up. Create a name for your new machine, and select Linux as your Operating System, and Ubuntu as you Version. Select a base amount of memory for the virtual machine to use. Use at least the default settings, but use as much as your system can spare. I recommend setting it to no more than 50% of your total RAM, unless you have lots to spare. Hit next. On the next screen select the option to create a new hard disk. This will launch the Create New Virtual Disk Wizard. Hit next. Select dynamically expanding storage and hit next. Select the size of the hard disk you want the virtual machine to have. This does take up real space on you computer. The default of 8 gigs should be sufficient for most. On the next screen hit finish. Then finish again.&lt;/p&gt;

&lt;p&gt;Now with your new machine highlighted, click the start button. This will launch two new windows, one of them being the First Run Wizard. Hit next on the first screen. Select CD/DVD ROM Device. Then click the little folder next to the drop down list. Hit add and select the Ubuntu .iso file you save to your desktop. Highlight it and hit select. Hit next on the Select Installation Media page. Finish.&lt;/p&gt;

&lt;p&gt;The Ubuntu .iso file will now start to run in the other window. When the install screen comes up select your language and hit the Install button, not the try button. On the next page select your time zone. Then pick your keyboard on the next screen. On the Prepare disk space page select the option to erase and use the entire disk then hit forward. Next fill out your user information. Make sure to set a password. On the next page hit install.&lt;/p&gt;

&lt;p&gt;If you find you cant get your mouse back out of the virtual machine, look in the bottom right corner of the window. It should give you a short cut or a ket on your keyboard that when pressed will return your mouse to the host os.&lt;/p&gt;

&lt;p&gt;When the installation is complete you will need to restart the computer. When it says, Please remove the disc and close the tray (if any) then press enter:, pull your mouse back out of the virtual machine and look at the bottom of the window. There should be an icon that looks like a CD. Click it and select unmount CD/DVD Device. Now click back in the Ubuntu window and hit enter. When the computer finishes restarting you will now have a working Ubuntu copy installed on your host os.&lt;/p&gt;

&lt;p&gt;You may or may not be able to connect to the internet through your virtual machine by default. Check by launching Firefox and seeing if you have a connection. If you do not. Close the virtual machine. You can select shutdown from the system options or just close the window and choose power down. In the virtual box window select your virtual machine from the list on the left hand side and select Settings. Select Network from the top menu. Under Adapter 1 make sure Enable Network Adapter is checked, but change the Attached To drop down list from NAT to bridged adapter. Hit OK and restart the machine. You should now be able to connect to the internet.&lt;/p&gt;

&lt;p&gt;Now that Ubuntu is installed and working it's time to start installing the LAMP stack. For those who don't know, LAMP stands for &lt;a href=&quot;http://www.linux.org/&quot;&gt;Linux&lt;/a&gt;, &lt;a href=&quot;http://www.apache.org/&quot;&gt;Apache&lt;/a&gt;, &lt;a href=&quot;http://www.mysql.com/&quot;&gt;MySQL&lt;/a&gt;, and &lt;a href=&quot;http://php.net/index.php&quot;&gt;PHP&lt;/a&gt;. This is a common setup among web developers, but you could also install Ruby or any other language. This one will focus just on the LAMP stack. (which is what you want if you use, wordpress, joomla, drupal, cakephp, or any of the other fine php packages)&lt;/p&gt;

&lt;h2&gt;Install Apache 2&lt;/h2&gt;

&lt;p&gt;Now open up Terminal (Applications &gt; accessories &gt; Terminal). Type in the following,&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176993.js?file=example1.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo apt-get install apache2&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Terminal will prompt for your password. Enter it in.(Terminal does not show your password as you type, so just type it in and hit enter).&lt;/p&gt;

&lt;h2&gt;Install PHP 5&lt;/h2&gt;

&lt;p&gt;Apache should now be installed on your system. Now it's time to install PHP 5. In terminal type,&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176993.js?file=example2.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo apt-get install php5 libapache2-mod-php5&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


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

&lt;p&gt;Now you have PHP 5 installed. To install MySQL type,&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176993.js?file=example3.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo apt-get install mysql-server&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Enter in a password when the install prompts you to.&lt;/p&gt;

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

&lt;p&gt;Now install &lt;a href=&quot;http://www.phpmyadmin.net/home_page/index.php&quot;&gt;phpMyAdmin&lt;/a&gt; by typing&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176993.js?file=example4.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;When phpmyadmin asks which server to use select apache. It will then ask to create a database. Tell it to do so and enter in the password you set when installing MySQL.&lt;/p&gt;

&lt;p&gt;After installing all this you need to restart apache. To do so type&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176993.js?file=example5.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo /etc/init.d/apache2 restart&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;h2&gt;Test Installation&lt;/h2&gt;

&lt;p&gt;You should now have a working LAMP stack installed. To test everything is working, type in Terminal&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176993.js?file=example6.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;gksudo gedit /var/www/info.php&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;When the new window opens add&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176993.js?file=example7.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php phpinfo(); ?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Save and close the window. Now open Firefox and go to http://localhost/&lt;/p&gt;

&lt;p&gt;You should see &quot;It Works!&quot;, if you do, apache is working, then go to http://localhost/info.php&lt;/p&gt;

&lt;p&gt;If you see a long list of information about PHP 5 then it works as well.&lt;/p&gt;

&lt;p&gt;Now everything is working as it should, but the default setup isn't the best thing. We're going to do a little bit more to make it a development dream come true.&lt;/p&gt;

&lt;h2&gt;Fix Domain Name Error&lt;/h2&gt;

&lt;p&gt;First you may have noticed when we restarted apache that it gave an error about not being able to determine the fully qualified domain name. To fix this error open the terminal and type,&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176993.js?file=example8.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;gksudo gedit /etc/apache2/httpd.conf&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Add to the file&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176993.js?file=example9.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;ServerName localhost&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Save and exit. Now restart again. You should no longer see an error.&lt;/p&gt;

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

&lt;p&gt;Now lets add an important PHP 5 module. mod_rewrite. Many systems use this to turn ugly urls like,&lt;/p&gt;

&lt;p&gt;example.com/?dkjfodocas223&lt;/p&gt;

&lt;p&gt;into&lt;/p&gt;

&lt;p&gt;example.com/about/&lt;/p&gt;

&lt;p&gt;You can enable the module by typing in the Terminal&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176993.js?file=example10.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo a2enmod rewrite&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;h2&gt;Enable PHP 5 Error Displaying&lt;/h2&gt;

&lt;p&gt;Another helpful feature not enabled by default is error displaying in PHP. Now on a production server it is good to turn these off, but when developing, they can be handy to have on. To enable type&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176996.js?file=example11.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;gksudo gedit /etc/php5/apache2/php.ini&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Make sure the following lines read as follows&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176996.js?file=example12.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;display_errors = On

display_startup_errors = On

log_errors = On

error_log = /pickadirectorytostoreerrors/phperror.log

error_reporting = E_ALL &amp;amp; E_STRICT&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;h2&gt;Setup Virtual Hosts&lt;/h2&gt;

&lt;p&gt;After errors are turned on, let's setup an example virtual host. Virtual hosts are what allow you to host multiple websites on one server. This will allow example.com and test.com to point to two different sites.&lt;/p&gt;

&lt;p&gt;To begin setting this up create two separate folders in /var/www/. Name one example.com and the other test.com. Create a simple index.html file in each, creating content that makes them easy to tell apart. Now cd to /etc/apache2/sites-enabled. Once there, type the following in Terminal&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176996.js?file=example13.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;gksudo gedit example.com&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Inside the file paste the following,&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176996.js?file=example14.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;VirtualHost *:80&amp;gt;
ServerAdmin your@email.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com
        &amp;lt;Directory /&amp;gt;
                Options FollowSymLinks
                AllowOverride All
        &amp;lt;/Directory&amp;gt;
        &amp;lt;Directory /var/www/example.com/&amp;gt;
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        &amp;lt;/Directory&amp;gt;
        ErrorLog /var/www/example.com/logs/example-error.log
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
 CustomLog /var/www/example.com/logs/example-access.log combined
&amp;lt;/VirtualHost&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Now create a link to the file in sites-available.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176996.js?file=example15.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo ln -s /etc/apache2/sites-available/example.com&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Next let's create one for test.com&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176996.js?file=example16.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;gksudo gedit test.com&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Inside the file paste the following,&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176996.js?file=example17.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;VirtualHost *:80&amp;gt;
ServerAdmin your@email.com
ServerAlias www.test.com
DocumentRoot /var/www/test.com
        &amp;lt;Directory /&amp;gt;
                Options FollowSymLinks
                AllowOverride All
        &amp;lt;/Directory&amp;gt;
        &amp;lt;Directory /var/www/test.com/&amp;gt;
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        &amp;lt;/Directory&amp;gt;
        ErrorLog /var/www/test.com/logs/example-error.log
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
 CustomLog /var/www/test.com/logs/example-access.log combined
&amp;lt;/VirtualHost&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Now create a link to the file in sites-available.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176996.js?file=example18.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo ln -s /etc/apache2/sites-available/test.com&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Now your virtual hosts are ready to go, but first we need to tell the computer to listen for the addresses. To do that type the following,&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176996.js?file=example19.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;cd /etc/&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Then&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176998.js?file=example20.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;gksudo gedit hosts&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Create a new line under the first. In it add&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176998.js?file=example21.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;127.0.0.1  localhost www.example.com&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Create another line and this time add&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176998.js?file=example22.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;127.0.0.1  localhost www.test.com&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Save and close the file. Restart apache&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176998.js?file=example23.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo /etc/init.d/apache2 restart&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Now open Firefox and go to www.example.com. You should see your example.com index.html file. Now try www.test.com. If you see your test.com index.html file everything works as it should. Just repeat this process for any additional domains you would like to add.&lt;/p&gt;

&lt;p&gt;If you want to be able to view your virtual machine sites in a browser on your host os you need to do a similar thing as the last step. First find the local IP address of the virtual machine. You can find this by going to System &gt; Administration &gt; Network Tools. Select your Network Device from the drop down and look for the Ipv4 IP Address. Let's say mine is 192.168.10.4&lt;/p&gt;

&lt;p&gt;Now move back to your host os. Open a terminal session in it. Find your hosts file. In OSX it is /etc/ just like Linux. Now add lines like so,&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176998.js?file=example24.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;192.168.10.4 www.example.com
192.168.10.4 www.test.com&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;You should now be able to view your example sites in a browser on your host os.&lt;/p&gt;

&lt;h2&gt;Change Webroot Permissions&lt;/h2&gt;

&lt;p&gt;Everything is starting to work quite well for development but there are still a few extras worth setting up. The first is changing permissions of your web root. To make you the owner of the /var/www directory type this in Terminal&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176998.js?file=example25.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo chown youruser:youruser /var/www&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


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

&lt;p&gt;This will now allow your user to easily create new folders and files. Next lets install my favorite version control system &lt;a href=&quot;http://git-scm.com/&quot;&gt;Git&lt;/a&gt;. To install type this into Terminal&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176998.js?file=example26.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo apt-get install git-core&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


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

&lt;p&gt;You can now use git to control the code you develop on the machine. Next let's add ftp support to make moving files between your host and guest operating systems a little easier. To install ftp support type,&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176998.js?file=example27.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;sudo apt-get install proftpd&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;You can now open your favorite ftp application in your host os and connect to your virtual machine. Just use the IP (mine in this example is 192.168.10.4) and enter in your user name and password. Ta-da!&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;There you go. You now have a complete and awesome new development virtual machine. If there are any questions, or if you know a better way to do something, please let me know in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Best Ogg Theora Video Compressor</title>
   <link href="http://www.travisberry.com/2010/04/best-ogg-theora-video-compressor"/>
   <updated>2010-04-25T00:00:00-06:00</updated>
   <id>http://www.travisberry.com/2010/04/best-ogg-theora-video-compressor</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Best Ogg Theora Video Compressor&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/lancesh/2162074087/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic2.travisberry.com/oggpixels.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-04-25&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;A while back I did a &lt;a href=&quot;http://www.travisberry.com/2010/03/video-compression-show-down/&quot;&gt;comparison of the popular mp4 compressors&lt;/a&gt;. Specifically ones used to convert videos for HTML5 playback. Well here is a follow up, this time around though, we're comparing compressors for Ogg Theora.&lt;/p&gt;

&lt;p&gt;I try to make my content cross browser compatible, but for this one I have no choice. &lt;strong&gt;You must use Firefox or Chrome to fully view this post.&lt;/strong&gt; The newer the version the better.&lt;/p&gt;

&lt;p&gt;Anyway, back to the post. I started with a small clip from the 720p version of &lt;a href=&quot;http://orange.blender.org/&quot;&gt;Elephants Dream&lt;/a&gt;. It's a cool little short and I suggest going and watching it if you haven't already.&lt;/p&gt;

&lt;p&gt;So with this clip in hand I ran it through 6 different compressors.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://v2v.cc/~j/ffmpeg2theora/&quot;&gt;ffmpeg2theora&lt;/a&gt; (6.10 MB)- lots of settings&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;smallest file&lt;/li&gt;
&lt;li&gt;moderate quality&lt;/li&gt;
&lt;li&gt;moderate ease of use&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;video width=&quot;640&quot; height=&quot;360&quot; controls=&quot;true&quot; id=&quot;video&quot; tabindex=&quot;0&quot;&gt;&lt;source type=&quot;video/ogg; codecs=&amp;quot;theora, vorbis&amp;quot;&quot; src=&quot;http://oldstatic.travisberry.com/uploads/oggoutputs/2theora.ogv&quot;&gt;&lt;/source&gt;&lt;/video&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.ffmpeg.org/&quot;&gt;FFmpeg&lt;/a&gt; (6.19 MB)- same as ffmpeg2theora&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;no sound (can have sound if you encode separately and then combine)&lt;/li&gt;
&lt;li&gt;has to be a size divisible by 16&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;video width=&quot;640&quot; height=&quot;360&quot; controls=&quot;true&quot; id=&quot;video&quot; tabindex=&quot;0&quot;&gt;&lt;source type=&quot;video/ogg; codecs=&amp;quot;theora, vorbis&amp;quot;&quot; src=&quot;http://oldstatic.travisberry.com/html5video/oggoutputs/ffmpeg.ogg&quot;&gt;&lt;/source&gt;&lt;/video&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://firefogg.org/&quot;&gt;FireFogg&lt;/a&gt; (18.87 MB)- decent settings&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;fairly easy to use&lt;/li&gt;
&lt;li&gt;good quality at large size&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;video width=&quot;640&quot; height=&quot;360&quot; controls=&quot;true&quot; id=&quot;video&quot; tabindex=&quot;0&quot;&gt;&lt;source type=&quot;video/ogg; codecs=&amp;quot;theora, vorbis&amp;quot;&quot; src=&quot;http://oldstatic.travisberry.com/uploads/oggoutputs/firefogg.ogv&quot;&gt;&lt;/source&gt;&lt;/video&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.mirovideoconverter.com/&quot;&gt;Miro Video Converter&lt;/a&gt; (22.20 MB)- largest size&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;best quality&lt;/li&gt;
&lt;li&gt;easy to use&lt;/li&gt;
&lt;li&gt;can't resize&lt;/li&gt;
&lt;li&gt;no settings for anything&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;video width=&quot;640&quot; height=&quot;360&quot; controls=&quot;true&quot; id=&quot;video&quot; tabindex=&quot;0&quot;&gt;&lt;source type=&quot;video/ogg; codecs=&amp;quot;theora, vorbis&amp;quot;&quot; src=&quot;http://oldstatic.travisberry.com/html5video/oggoutputs/miro.ogv&quot;&gt;&lt;/source&gt;&lt;/video&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://xiph.org/quicktime/&quot;&gt;QuickTime&lt;/a&gt; (17.37 MB)- good quality large size&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;same export as any other qt&lt;/li&gt;
&lt;li&gt;moderate amounts of video settings, no audio settings&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;video width=&quot;640&quot; height=&quot;360&quot; controls=&quot;true&quot; id=&quot;video&quot; tabindex=&quot;0&quot;&gt;&lt;source type=&quot;video/ogg; codecs=&amp;quot;theora, vorbis&amp;quot;&quot; src=&quot;http://oldstatic.travisberry.com/uploads/oggoutputs/qt.ogg&quot;&gt;&lt;/source&gt;&lt;/video&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.videolan.org/vlc/&quot;&gt;VLC&lt;/a&gt; (21.94 MB)- large size&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;serious streaming issues&lt;/li&gt;
&lt;li&gt;small amount of settings&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;video width=&quot;640&quot; height=&quot;360&quot; controls=&quot;true&quot; id=&quot;video&quot; tabindex=&quot;0&quot;&gt;&lt;source type=&quot;video/ogg; codecs=&amp;quot;theora, vorbis&amp;quot;&quot; src=&quot;http://oldstatic.travisberry.com/html5video/oggoutputs/vlc.ogg&quot;&gt;&lt;/source&gt;&lt;/video&gt;&lt;/p&gt;

&lt;p&gt;and for comparison&lt;/p&gt;

&lt;p&gt;h264 (6.22 MB)&lt;/p&gt;

&lt;object classid=&quot;clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B&quot; codebase=&quot;http://www.apple.com/qtactivex/qtplugin.cab&quot; height=&quot;376&quot; width=&quot;640&quot;&gt;&lt;param name=&quot;src&quot; value=&quot;http://oldstatic.travisberry.com/html5video/oggoutputs/h264.mov&quot; /&gt;&lt;param name=&quot;autoplay&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;type&quot; value=&quot;video/quicktime&quot; height=&quot;376&quot; width=&quot;640&quot; /&gt;&lt;embed src=&quot;http://oldstatic.travisberry.com/html5video/oggoutputs/h264.mov&quot; height=&quot;376&quot; width=&quot;640&quot; autoplay=&quot;false&quot; type=&quot;video/quicktime&quot; pluginspage=&quot;http://www.apple.com/quicktime/download/&quot;&gt;&lt;/embed&gt;&lt;/object&gt;


&lt;p&gt;In the end I would recommend ffmpeg2theora. If you're comfortable with the command line that is. Otherwise, everything except VLC would work for you. For the curious here are the commands I used.&lt;/p&gt;

&lt;p&gt;FFmpeg&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176975.js?file=example1.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;ffmpeg -i Elephants_Dream.mov -vcodec libtheora -b 700k -s 512x288 -acodec libvorbis -ab 96k -threads 6 test.ogg&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;ffmpeg2theora&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176975.js?file=example2.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;ffmpeg2theora -V 700 -A 96 -H 44100 -K 24 -x 640 -y 360 --two-pass --optimize --speedlevel 0 --seek-index --soft-target --pp vdeblock:10/hdeblock:10 Elephants_Dream.mov&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;If you have any suggestions for improving these please let me know in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Adding Internet Streaming To FFmpeg Outputs</title>
   <link href="http://www.travisberry.com/2010/04/adding-internet-streaming-to-ffmpeg-outputs"/>
   <updated>2010-04-17T00:00:00-06:00</updated>
   <id>http://www.travisberry.com/2010/04/adding-internet-streaming-to-ffmpeg-outputs</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Adding Internet Streaming To FFmpeg Outputs&lt;/h3&gt;
  &lt;a href=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2010/04/qtindexswapper.jpg&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic1.travisberry.com/wp-content/uploads/2010/04/qtindexswapper.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-04-17&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;Just a quick post. After deciding that FFmpeg was my video compressor of choice, I ran into a small problem. The videos that are outputted don't begin playing immediately when embedded in a web page. This is a pretty big setback.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;Luckily there is a small AIR application that can solve the problem for us.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://renaun.com/blog/2008/08/14/262/&quot;&gt;QTIndexSwapper&lt;/a&gt; is a small application that prepares .h264 encoded video for internet streaming. It does this by rearranging the index file. It's simple and fast, and from what I've seen so far, adds no quality loss to your video.&lt;/p&gt;

&lt;p&gt;So if you've tried the code I posted for compressing video with FFmpeg, but have had trouble streaming them on the web, try this application.
&lt;/articles&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Video Compression Show Down</title>
   <link href="http://www.travisberry.com/2010/03/video-compression-show-down"/>
   <updated>2010-03-11T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2010/03/video-compression-show-down</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Video Compression Show Down&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/reckon/3262118500/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/uploads/2010/03/videopixels.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-03-11&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;Video compression is an absolutely critical component that has allowed online video to take off in recent years. Advancing from super pixelated 320x240 video, to rich and vibrant 1080p has required massive improvements in compression technology.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Video_compression&quot;&gt;Wikipedia&lt;/a&gt;: &quot;Video compression refers to reducing the quantity of data used to represent digital video images, and is a combination of spatial image compression and temporal motion compensation. Most video compression is lossy - it operates on the premise that much of the data present before compression is not necessary for achieving good perceptual quality. For example, DVDs use a video coding standard called MPEG-2 that can compress around two hours of video data by 15 to 30 times, while still producing a picture quality that is generally considered high-quality for standard-definition video. Video compression is a tradeoff between disk space, video quality, and the cost of hardware required to decompress the video in a reasonable time. However, if the video is overcompressed in a lossy manner, visible (and sometimes distracting) artifacts can appear.&quot;&lt;/p&gt;

&lt;p&gt;Uncompressed video, especially HD versions, can require gigabytes per minute of recording. These kinds of files require way too much bandwidth to be considered reasonable for the web. The best way to solve this problem is with compression.&lt;/p&gt;

&lt;p&gt;There are numerous video compression softwares out there. They range in price from free, to thousands of dollars. Each one has strengths and weaknesses. I'm going to compare a couple of the more popular options.&lt;/p&gt;

&lt;p&gt;These are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.apple.com/finalcutstudio/compressor/&quot;&gt;Compressor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.roxio.com/enu/products/toast/titanium/overview.html&quot;&gt;Toast&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.apple.com/quicktime/tutorials/h264.html&quot;&gt;Regular QuickTime export&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://ffmpeg.org/&quot;&gt;FFmpeg&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Some of these use the same basic underlying compression technology, but the options they allow to to set, or the way they use them does differ.&lt;/p&gt;

&lt;p&gt;For the test, I ran a 1280x720 .mov with Animation compression. For those who don't know, Animation is a lossless codec, resulting in quite large files. For example, the source video at only 1 minute in length came out to 3.26 gigabytes. Ouch.&lt;/p&gt;

&lt;p&gt;I compressed this massive file down to size, by setting the bit rate to only 400k and reducing the audio quality to 96k at 44.1 KHz. I also resized it to 640x360. I'm doing this quality test with the ever so excellent &lt;a href=&quot;http://en.wikipedia.org/wiki/H.264&quot;&gt;H264&lt;/a&gt; codec.&lt;/p&gt;

&lt;p&gt;Ugh, there's no real great place to interject this so I'll just do it now. For &quot;best&quot; results, you should resize video to sizes that are evenly divisible by 16. I didn't do that, I don't seem to notice a difference when you do. I tried both but at the end of the day, on my site, My videos need to be 640px wide. For the curious these are a few sizes that are divisible by 16. The reason for this is pretty technical and could warrant a giant post by itself, so just take my word that for &quot;best&quot; results, use one of these sizes.&lt;/p&gt;

&lt;p&gt;256 x 144&lt;/p&gt;

&lt;p&gt;512 x 288&lt;/p&gt;

&lt;p&gt;768 x 432&lt;/p&gt;

&lt;p&gt;1024 x 576&lt;/p&gt;

&lt;p&gt;So anyway, here are the results.&lt;/p&gt;

&lt;p&gt;Compressor: Size - 4.8 MB&lt;/p&gt;

&lt;object classid=&quot;clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B&quot; codebase=&quot;http://www.apple.com/qtactivex/qtplugin.cab&quot; height=&quot;376&quot; width=&quot;640&quot;&gt;&lt;param name=&quot;src&quot; value=&quot;http://oldstatic.travisberry.com/videocompressiontests/demoforweb33fromcompressor.mov&quot; /&gt;&lt;param name=&quot;autoplay&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;type&quot; value=&quot;video/quicktime&quot; height=&quot;376&quot; width=&quot;640&quot; /&gt;&lt;embed src=&quot;http://oldstatic.travisberry.com/videocompressiontests/demoforweb33fromcompressor.mov&quot; height=&quot;376&quot; width=&quot;640&quot; autoplay=&quot;false&quot; type=&quot;video/quicktime&quot; pluginspage=&quot;http://www.apple.com/quicktime/download/&quot;&gt;&lt;/embed&gt;&lt;/object&gt;


&lt;p&gt;Toast: Size - 4.7 MB&lt;/p&gt;

&lt;object classid=&quot;clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B&quot; codebase=&quot;http://www.apple.com/qtactivex/qtplugin.cab&quot; height=&quot;376&quot; width=&quot;640&quot;&gt;&lt;param name=&quot;src&quot; value=&quot;http://oldstatic.travisberry.com/videocompressiontests/demoforweb3fromtoast.mov&quot; /&gt;&lt;param name=&quot;autoplay&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;type&quot; value=&quot;video/quicktime&quot; height=&quot;376&quot; width=&quot;640&quot; /&gt;&lt;embed src=&quot;http://oldstatic.travisberry.com/videocompressiontests/demoforweb3fromtoast.mov&quot; height=&quot;376&quot; width=&quot;640&quot; autoplay=&quot;false&quot; type=&quot;video/quicktime&quot; pluginspage=&quot;http://www.apple.com/quicktime/download/&quot;&gt;&lt;/embed&gt;&lt;/object&gt;


&lt;p&gt;Regular QuickTime export: Size - 4.5 MB&lt;/p&gt;

&lt;object classid=&quot;clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B&quot; codebase=&quot;http://www.apple.com/qtactivex/qtplugin.cab&quot; height=&quot;376&quot; width=&quot;640&quot;&gt;&lt;param name=&quot;src&quot; value=&quot;http://oldstatic.travisberry.com/videocompressiontests/demoforweb32fromqt.mov&quot; /&gt;&lt;param name=&quot;autoplay&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;type&quot; value=&quot;video/quicktime&quot; height=&quot;376&quot; width=&quot;640&quot; /&gt;&lt;embed src=&quot;http://oldstatic.travisberry.com/videocompressiontests/demoforweb32fromqt.mov&quot; height=&quot;376&quot; width=&quot;640&quot; autoplay=&quot;false&quot; type=&quot;video/quicktime&quot; pluginspage=&quot;http://www.apple.com/quicktime/download/&quot;&gt;&lt;/embed&gt;&lt;/object&gt;


&lt;p&gt;FFmpeg: Size - 3.7 MB&lt;/p&gt;

&lt;object classid=&quot;clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B&quot; codebase=&quot;http://www.apple.com/qtactivex/qtplugin.cab&quot; height=&quot;376&quot; width=&quot;640&quot;&gt;&lt;param name=&quot;src&quot; value=&quot;http://oldstatic.travisberry.com/videocompressiontests/test11.mov&quot; /&gt;&lt;param name=&quot;autoplay&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;type&quot; value=&quot;video/quicktime&quot; height=&quot;376&quot; width=&quot;640&quot; /&gt;&lt;embed src=&quot;http://oldstatic.travisberry.com/videocompressiontests/test11.mov&quot; height=&quot;376&quot; width=&quot;640&quot; autoplay=&quot;false&quot; type=&quot;video/quicktime&quot; pluginspage=&quot;http://www.apple.com/quicktime/download/&quot;&gt;&lt;/embed&gt;&lt;/object&gt;


&lt;p&gt;The clear and obvious winner is &lt;a href=&quot;http://ffmpeg.org/&quot;&gt;FFmpeg&lt;/a&gt;. Notice that is the smallest file size as well. The other compressors do decent jobs, don't get me wrong, but you need to double or triple the file size to reach the same quality.&lt;/p&gt;

&lt;p&gt;The even better news, FFmpeg is free and open source. Wait did you catch that? It's &lt;strong&gt;FREE&lt;/strong&gt;! One giant downside, it's command line based. This isn't huge to me, as I know how to use the command line, but for many, touching the command line is the last thing they are comfortable doing. However, it's not too hard to install if you go the &lt;a href=&quot;http://www.macports.org/&quot;&gt;macports&lt;/a&gt; route. Using it to it's best capabilities is nothing easy either.&lt;/p&gt;

&lt;p&gt;So for simplicities sake I present to you my super awesome FFmpeg compression commands.&lt;/p&gt;

&lt;p&gt;For a single pass render:&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176952.js?file=example1.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;ffmpeg -i sourcemovie.mov -vcodec libx264 -vpre hq -b 400k -g 250 -keyint_min 24 -bf 16 -coder 1 -refs 6 -flags +loop -deblockalpha -6 -deblockbeta -6 -partitions +parti4x4+parti8x8+partp8x8+partb8x8 -flags2 +dct8x8+mixed_refs+wpred+bpyramid -me_method umh -subq 8 -s 640x360 -acodec libfaac -ar 44100 -ab 96k -threads 6 -f mp4 outputmovie.mp4&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;For a two pass render:&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176952.js?file=example2.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;ffmpeg -i sourcemovie.mov -vcodec libx264 -vpre hq -b 400k -g 250 -keyint_min 24 -bf 16 -coder 1 -refs 6 -flags +loop -deblockalpha -6 -deblockbeta -6 -partitions +parti4x4+parti8x8+partp8x8+partb8x8 -flags2 +dct8x8+mixed_refs+wpred+bpyramid -me_method umh -subq 8 -s 640x360 -an -threads 6 -f mp4 -pass 1 /dev/null&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;




&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176952.js?file=example3.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;ffmpeg -i sourcemovie.mov -vcodec libx264 -vpre hq -b 400k -g 250 -keyint_min 24 -bf 16 -coder 1 -refs 6 -flags +loop -deblockalpha -6 -deblockbeta -6 -partitions +parti4x4+parti8x8+partp8x8+partb8x8 -flags2 +dct8x8+mixed_refs+wpred+bpyramid -me_method umh -subq 8 -s 640x360 -acodec libfaac -ar 44100 -ab 96k -threads 6 -f mp4 -pass 2 outputmovie.mp4&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Run the first command, then run the second for a two pass render. I used a two pass render in the test above.To better understand what all those setting mean, I recommend taking a look at this site&lt;a href=&quot;http://sites.google.com/site/linuxencoding/x264-ffmpeg-mapping&quot;&gt;http://sites.google.com/site/linuxencoding/x264-ffmpeg-mapping&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or the FFmpeg documentation at &lt;a href=&quot;http://ffmpeg.org/ffmpeg-doc.html&quot;&gt;http://ffmpeg.org/ffmpeg-doc.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For lots of other examples on compressing to and from different formats, I recommend reading&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs&quot;&gt;http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So there you go. If you're looking for a way to reduce your bandwidth costs, or just want to save time in uploading them, consider checking out FFmpeg. Honestly though, if you're just dumping your videos on youtube, you may consider just bumping up the quality on another compressor and using that. Ease of use is definitely in the favor of the other options.&lt;/p&gt;

&lt;p&gt;If you use FFmpeg and have some great command to share, let me know in the comments. Or if you use a compressor not listed and want to share results, let me know as well.&lt;/p&gt;

&lt;p&gt;Oh, and if you noticed this conveniently compresses out to a HTML5 friendly format, good for you. You sharp cookie you. Well check back in the next week or so where I'll do the same thing for Ogg video. How exciting!
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>On HTML5 Video</title>
   <link href="http://www.travisberry.com/2010/02/on-html5-video"/>
   <updated>2010-02-25T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2010/02/on-html5-video</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;On HTML5 Video&lt;/h3&gt;
  &lt;a href=&quot;http://commons.wikimedia.org/wiki/File:Train_Wreck_1922.jpg#file&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic3.travisberry.com/wp-content/uploads/2010/02/Train_Wreck.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-02-25&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;Hey! Have you heard? &lt;a href=&quot;http://en.wikipedia.org/wiki/HTML5_video&quot;&gt;HTML5 video&lt;/a&gt; is going to revolutionize the way we use video on the web. No more dealing with Flash or Quicktime embeds. Video will now be as simple as adding an image. Ummm, no. It's not. It's not even close. That's not to say it's all bad, but boy howdy does it have a long way to go.&lt;/p&gt;

&lt;p&gt;Before I get to the bashing let's talk about what is good about HTML5 video.&lt;/p&gt;

&lt;p&gt;Well first off, it is in theory as easy as adding an image.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176926.js?file=example1.html'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;video src=&amp;quot;movie.ogg&amp;quot; controls=&amp;quot;controls&amp;quot;&amp;gt;&amp;lt;/video&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Holy crap that is simple. Unfortunately your code will not end up looking like that. More on it in a bit.&lt;/p&gt;

&lt;p&gt;Another HUGE benefit is not having to use Flash. Anyone who has experience with Flash video knows how horrible it is. The embed codes are a nightmare and of course you're dealing with plugins that the user may or may not have.&lt;/p&gt;

&lt;p&gt;All around, HTML5 video should be a big improvement. Only problem is, it could be worse than the methods used today. Here's why.&lt;/p&gt;

&lt;p&gt;Codecs, codecs, codecs...&lt;/p&gt;

&lt;p&gt;Ugh, this is one of the biggest pains to deal with. Guess what, different browsers use different video codecs for HTML5 video. Firefox uses &lt;a href=&quot;http://en.wikipedia.org/wiki/Theora&quot;&gt;Ogg Theora&lt;/a&gt; and Safari uses &lt;a href=&quot;http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC&quot;&gt;H.264 MP4&lt;/a&gt;. So in order for you to have a video play in multiple browsers &lt;strong&gt;you need to make at least two versions&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That simple code above now turns into&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176926.js?file=example2.html'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;video width=&amp;quot;320&amp;quot; height=&amp;quot;240&amp;quot; controls&amp;gt;
  &amp;lt;source src=&amp;quot;NewOrleans2006.ogv&amp;quot; type='video/ogg; codecs=&amp;quot;theora, vorbis&amp;quot;'&amp;gt;
  &amp;lt;source src=&amp;quot;NewOrleans2006.mp4&amp;quot; type='video/mp4; codecs=&amp;quot;avc1.42E01E, mp4a.40.2&amp;quot;'&amp;gt;
&amp;lt;/video&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Not so simple anymore is it? Not horrible but not the elegant solution we were promised.&lt;/p&gt;

&lt;p&gt;This battle of the codecs has got to end. The argument boils down to the fact that H.264 and MP4 are proprietary of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Moving_Picture_Experts_Group&quot;&gt;MPEG&lt;/a&gt; consortium and Ogg Theora are open source.&lt;/p&gt;

&lt;p&gt;I get Mozilla's argument that they only support open standards, thus the use of Ogg in FireFox, but there is a giant elephant in the room that nobody is mentioning.&lt;/p&gt;

&lt;p&gt;It's that Ogg Theora as a codec is in it's infancy compared to H.264 and really kind of sucks in comparison. You can compare the two on my page, &lt;a href=&quot;http://oldstatic.travisberry.com/copyright-and-the-internet/&quot;&gt;travisberry.com/copyright-and-the-internet/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;View it in FireFox and then in Safari. Notice the WAY smoother video in the Safari version. Yeah, me too.&lt;/p&gt;

&lt;p&gt;The solution I would really like to see (but I'm not holding my breath) is for MPEG to step up and realize that they have the opportunity to seize the online video market and release H.264 into the open source community. &lt;strong&gt;Drop all the dumb-ass licensing arrangements and give H.264 away.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That is the first main issue with HTML5 video. The other huge issue is legacy browsers. Unless you are using the newest versions of FireFox, Chrome, or Safari, you probably can't see HTML5 video. So this causes us to have to add more code to make sure people can still see our content. This involves some kind of fallback to Flash video. The thing we were trying to avoid in the first place.&lt;/p&gt;

&lt;p&gt;I'll write this again for importance. &lt;strong&gt;You still have to include Flash video&lt;/strong&gt; if you want your video to play across all browsers. Damn it!&lt;/p&gt;

&lt;p&gt;So now that super simple code to embed videos now looks like this to make sure it handles all browsers nicely. Note, this still won't show anything in FireFox 2 but it will show in IE. Most FF users tend to update on a regular basis so it's no huge deal.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176926.js?file=example3.html'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;video width=&amp;quot;640&amp;quot; height=&amp;quot;360&amp;quot; id=&amp;quot;video&amp;quot; poster=&amp;quot;http://www.travisberry.com/html5video/videos/copyright/copyright-poster.jpg&amp;quot; controls=&amp;quot;true&amp;quot;&amp;gt;
    &amp;lt;source src=&amp;quot;http://www.travisberry.com/html5video/videos/copyright/copyright-desktop.mp4&amp;quot; type='video/mp4; codecs=&amp;quot;avc1.64001E, mp4a.40.2&amp;quot;' /&amp;gt;
    &amp;lt;source src=&amp;quot;http://www.travisberry.com/html5video/videos/copyright/copyright-iPhone-cell.3gp&amp;quot; type='video/3gpp; codecs=&amp;quot;mp4v.20.8, samr&amp;quot;' /&amp;gt;
    &amp;lt;source src=&amp;quot;http://www.travisberry.com/html5video/videos/copyright/copyright-desktop3.ogv&amp;quot; type='video/ogg; codecs=&amp;quot;theora, vorbis&amp;quot;' /&amp;gt;
    &amp;lt;object width=&amp;quot;640&amp;quot; height=&amp;quot;385&amp;quot;&amp;gt;
        &amp;lt;param name=&amp;quot;movie&amp;quot; value=&amp;quot;http://www.youtube.com/v/lFeI5SqGYJ8&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;
        &amp;lt;param name=&amp;quot;allowFullScreen&amp;quot; value=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;
        &amp;lt;param name=&amp;quot;allowscriptaccess&amp;quot; value=&amp;quot;always&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;
        &amp;lt;embed src=&amp;quot;http://www.youtube.com/v/lFeI5SqGYJ8&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;&amp;quot; type=&amp;quot;application/x-shockwave-flash&amp;quot; allowscriptaccess=&amp;quot;always&amp;quot; allowfullscreen=&amp;quot;true&amp;quot; width=&amp;quot;640&amp;quot; height=&amp;quot;385&amp;quot;&amp;gt;&amp;lt;/embed&amp;gt;
    &amp;lt;/object&amp;gt;
&amp;lt;/video&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Notice instead of adding a flash video I added a youtube embed. I was tired of crunching out different codecs by this point so I said screw it and let youtube handle some of the work. (I also added an iPhone version so the code is a little longer than necessary, but not by much)&lt;/p&gt;

&lt;p&gt;Ok, so my super simple code has grown kind of large and unwieldy but no biggie, it works so I could live with this.&lt;/p&gt;

&lt;p&gt;Time to watch this bad boy in some browsers. Wait, WTF is going on? Why are my videos autobuffering in Chrome and Safari. This is bad. Real bad. What if I have 4 or 5 videos on one page? It's going to buffer all of them at once!?&lt;/p&gt;

&lt;p&gt;Yes it will. For reasons unknown, Chrome and Safari have decided to ignore the autobuffer attribute. &lt;strong&gt;They will autobuffer your video come hell or high water.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Again, we can work around this using a javascript method. Daring Fireball has a &lt;a href=&quot;http://daringfireball.net/misc/2009/12/user_guide_demos&quot;&gt;good example&lt;/a&gt; (view source to see how it works). Only problem with it is that in FireFox I was experiencing double audio when using the javascript solution. So that didn't work for me.&lt;/p&gt;

&lt;p&gt;The half-assed solution I came up with was to go ahead and let the video autobuffer. I used to have all of my example videos on one page. That was not cool with autobuffering. Now I have a navigation menu linking to each video on it's own page. Now when it autobuffers, it's not such a huge deal. (I figure if they clicked through to the video, at this point they are trying to watch)&lt;/p&gt;

&lt;p&gt;So in the end I was able to implement HTML5 video. It isn't pretty and far from perfect but it is possible. For now, I am going to continue to recommend most people go with a Flash video solution. It's just not worth the hassle for the average user. Let's hope the people in charge can save the &amp;lt;video&amp;gt; tag, it could be great, it's just not there yet.&lt;/p&gt;

&lt;p&gt;Have you tried to use HTML5 video? Let me know how it went in the comments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;After some tweaking of the encode settings, I managed to get a decent output in Ogg. So I recant a bit on it being horrible, but it's still not quite as good as H.264&lt;/p&gt;

&lt;p&gt;Here are several other good resources that explore the use of HTML5 video.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://hardwarebug.org/2010/03/03/ogg-objections/&quot;&gt;Ogg objections&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hardwarebug.org/2008/11/17/ogg-timestamps-explored/&quot;&gt;Ogg timestamps explored&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://code.google.com/p/html5media/&quot;&gt;HTML5 video for everyone!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#video&quot;&gt;The video element&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.niallkennedy.com/blog/2010/02/html5-video-markup.html&quot;&gt;HTML5 video markup, compatibility and playback&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://diveintohtml5.org/video.html&quot;&gt;Video on the Web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://daringfireball.net/2009/12/html5_video_unusable&quot;&gt;Why the HTML5 &quot;Video&quot; Element Is Effectively Unusable, Even in Browsers Which Support It&lt;/a&gt;
&lt;/article&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
 </entry>
 
 <entry>
   <title>Create Simple A/B Tests In WordPress</title>
   <link href="http://www.travisberry.com/2010/02/how-to-create-simple-ab-tests-in-wordpress"/>
   <updated>2010-02-19T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2010/02/how-to-create-simple-ab-tests-in-wordpress</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Create Simple A/B Tests In WordPress&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/jurvetson/133261764/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic2.travisberry.com/uploads/2010/02/abtest1.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-02-19&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;One of the best things you can implement in your site right now is A/B testing. According to good old &lt;a href=&quot;http://en.wikipedia.org/wiki/A/B_testing&quot;&gt;Wikipedia&lt;/a&gt;, A/B testing is;&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;blockquote&gt;&quot;A/B testing, split testing, or bucket testing is a method of marketing testing by which a baseline control sample is compared to a variety of single-variable test samples in order to improve response rates&quot;&lt;/blockquote&gt;


&lt;p&gt;It's a method to test different versions of things and compare their effectiveness against others.&lt;/p&gt;

&lt;p&gt;In web design they are often used to test the effectiveness of converting users in some way. Whether it is selling them something, getting them to sign up for something, or just getting them to go to another page. As with all design there are a million ways to say or lay something out. A/B testing allows you to try multiple versions and find the one that works best for your goals.&lt;/p&gt;

&lt;p&gt;So, setting up an A/B test isn't all that hard. First thing to do is come up with your test materials. I would recommend starting with simple text changes to get the hang of A/B testing. For this example I'm going to create an author box that goes at the end of my posts.&lt;/p&gt;

&lt;p&gt;Next figure out what your goal is. The easiest to use are pages you want the client to reach. These can be landing pages after someone fills out a form, or it can be the form page itself. I want people to end up on my contact page.&lt;/p&gt;

&lt;p&gt;Now write several versions of your author text, with wording that encourages people clicking through to your contact page. Go a head and do it now, I'll wait.&lt;/p&gt;

&lt;p&gt;Ok, with all your text ready to go we can now start setting up the experiment. Go to &lt;a href=&quot;http://www.google.com/websiteoptimizer&quot;&gt;www.google.com/websiteoptimizer&lt;/a&gt; and sign up for an account. I used my gmail account with all my other services attached to it to make things a little easier.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2010/02/Website-Optimizer_1266539675736.jpg&quot; title=&quot;Website-Optimizer_1266539675736&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Once your all signed up you'll end up at a page like this,&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2010/02/Website-Optimizer_1266536670466.jpg&quot; title=&quot;Website-Optimizer_1266536670466&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Here click the &lt;strong&gt;Create another experiment&lt;/strong&gt; link near the top left. Yours may say &lt;strong&gt;Create a new experiment&lt;/strong&gt; depending if you've ever done this before or not. As you can see in the pics, I've done this a few times already.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2010/02/Website-Optimizer_1266536889392.jpg&quot; title=&quot;Website-Optimizer_1266536889392&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;On the next page you can choose between an â€œ&lt;strong&gt;A/B Experiment - The simplest way to start testing fast&lt;/strong&gt;&quot; or a &lt;strong&gt;Multivariate Experiment - The most robust way to test lots of ideas&lt;/strong&gt;&quot;.&lt;/p&gt;

&lt;p&gt;Choose &lt;strong&gt;Multivariate Experiment - The most robust way to test lots of ideas&lt;/strong&gt;&quot;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2010/02/Website-Optimizer_1266536999518.jpg&quot; title=&quot;Website-Optimizer_1266536999518&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Check the box on the next page and click &lt;strong&gt;create&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2010/02/Website-Optimizer_1266537040200.jpg&quot; title=&quot;Website-Optimizer_1266537040200&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Now we're getting somewhere. Here name your experiment in the first text box. Name it something easy to remember and understand. I'm calling mine &quot;contactbox&quot;&lt;/p&gt;

&lt;p&gt;In the next box put the url of the page that the author box is going to be one. Mine is &quot;http://oldstatic.travisberry.com/2010/02/10-easy-solutions-for-contact-forms/&quot;&lt;/p&gt;

&lt;p&gt;The box below is the url of the goal page. Mine is &quot;http://oldstatic.travisberry.com/contact/&quot;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2010/02/Website-Optimizer-contactbox2_1266537264751.jpg&quot; title=&quot;Website-Optimizer---contactbox2_1266537264751&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;You will install and validate the JavaScript tags&lt;/strong&gt; on the next page.&lt;/p&gt;

&lt;p&gt;The next page will look like this&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2010/02/Website-Optimizer-contactbox2_1266537309676.jpg&quot; title=&quot;Website-Optimizer---contactbox2_1266537309676&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;You can leave it alone for a second and instead open up a new tab. Download the &lt;strong&gt;Google Website Optimizer&lt;/strong&gt; plugin from &lt;a href=&quot;http://wordpress.org/extend/plugins/google-website-optimizer-for-wordpress/&quot;&gt;http://wordpress.org/extend/plugins/google-website-optimizer-for-wordpress/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Install and activate it in your WordPress install.&lt;/p&gt;

&lt;p&gt;Hang in there, we're getting closer.&lt;/p&gt;

&lt;p&gt;Now, go and edit the post or page you listed as your starting point.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2010/02/BerryWordPress_1266537527627.jpg&quot; title=&quot;BerryWordPress_1266537527627&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Notice there is now a new section added below the wysiwyg editor. Switch back to your google tab and copy the &lt;strong&gt;Control Script&lt;/strong&gt;. Move back to your WordPress admin area and paste the code in the &lt;strong&gt;Control Script&lt;/strong&gt; box. Repeat for the &lt;strong&gt;Tracking Script&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;DO NOT put the &quot;Conversion Script&quot; on this page. Instead go to your goal page, contact in my case, and paste the &lt;strong&gt;Conversion Script&lt;/strong&gt; code there. You don't need to bother with the &quot;Control&quot;or &quot;Tracking Script&quot; on this page.&lt;/p&gt;

&lt;p&gt;Now go back and edit your post again. Scroll to where you want your author box to be in your post. Once there paste the code&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176915.js?file=example1.html'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;script&amp;gt;utmx_section(&amp;quot;Insert your section name here&amp;quot;)&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Followed by the text you want to use in you author box. Only put one version in at this point.&lt;/p&gt;

&lt;p&gt;At the end of the text paste this&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176915.js?file=example2.html'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;/noscript&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Now change the &quot;&lt;strong&gt;Insert your section name here&lt;/strong&gt;&quot; to something easy to deal with.Once you have everything in WordPress go back to the google tab.&lt;/p&gt;

&lt;p&gt;Scroll to the bottom and click &lt;strong&gt;Validate Pages&lt;/strong&gt;. If everything went well you should get confirmation and be allowed to click &lt;strong&gt;Continue&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2010/02/Website-Optimizer-contactbox2_1266538416866.jpg&quot; title=&quot;Website-Optimizer---contactbox2_1266538416866&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This page is where we get to start adding the variations. Click &lt;strong&gt;Add new variation&lt;/strong&gt; and enter in your second variation you wrote back in the beginning. Keep adding until you've added everything you wrote, then hit &lt;strong&gt;Save and Continue&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2010/02/Website-Optimizer-contactbox2_1266538830910.jpg&quot; title=&quot;Website-Optimizer---contactbox2_1266538830910&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;From here you can launch the experiment and watch as your traffic is split and analyzed. Results will take a while depending on your level of traffic, but expect to wait at least a day before you can see anything.&lt;/p&gt;

&lt;p&gt;Well that about covers it. See I told you it was simple. A/B test can be used to learn some surprising things about the nature of your audience.&lt;/p&gt;

&lt;p&gt;If you have experience with A/B testing and want to share some results, post them in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>10 Easy Solutions For Contact Forms</title>
   <link href="http://www.travisberry.com/2010/02/10-easy-solutions-for-contact-forms"/>
   <updated>2010-02-15T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2010/02/10-easy-solutions-for-contact-forms</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;10 Easy Solutions For Contact Forms&lt;/h3&gt;
  &lt;a href=&quot;http://oldstatic.travisberry.com/uploads/2010/02/contactformcap.jpg&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic1.travisberry.com/uploads/2010/02/contactformcap.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-02-15&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;Contact forms are an integral part of many websites. The construction of which can range from super simple to highly complex. As with most things, I prefer the easy solution. Here is a list of 10 contact form solutions that are super simple.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;&lt;a href=&quot;http://contactform7.com/&quot;&gt;Contact Form 7&lt;/a&gt; Are you looking for a contact form plugin for WordPress? If you value simplicity and flexibility, Contact Form 7 is a great choice. It allows you to flexibly design the form and mail. You can manage multiple contact forms as well.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.emailmeform.com/&quot;&gt;EmailMeForm&lt;/a&gt; Email Me Form is a free online form generator service that helps you create HTML forms for your website, with no programming required.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://wufoo.com/&quot;&gt;Wufoo&lt;/a&gt; Wufoo strives to be the easiest way to collect information over the Internet.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.deliciousdays.com/cforms-plugin/&quot;&gt;cforms&lt;/a&gt; cforms is a powerful and feature rich form plugin for Wordpress, offering convenient deployment of multiple Ajax driven contact forms throughout your blog or even on the same page.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://kontactr.com/&quot;&gt;Kontactr&lt;/a&gt; Kontactr is a one-click free contact form service. With Kontactr, you can fight against the amount of spam that you receive daily. Protect your email address by using our highly secure contact form. You can also use our simple tools to embed the form right into your own website. Everything is as easy as 1, 2, 3...&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.formtools.org/&quot;&gt;Form Tools&lt;/a&gt; Form Tools is an extremely powerful, versatile form processor, storage and access script written in PHP and MySQL, designed to work with any existing web form. It creates a custom database table based on your form data to store all submissions from the form.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://dadamailproject.com/&quot;&gt;Dada Mail&lt;/a&gt; Dada Mail turns 10 in 2010. To celebrate, we're giving never ending subscriptions to Pro Dada and the Dada Mail Manual for a low, low price:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.freedback.com/&quot;&gt;FreedBack&lt;/a&gt; Designed for people who want HTML forms without learning HTML. Try us out before you spend hours banging your head on your keyboard because you can't get it to work. You have more important things to do with your time.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.freecontactform.com/&quot;&gt;FreeContactForm&lt;/a&gt; Looking for a quick no frills website contact form? our Lite version is available at no charge.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.roscripts.com/AJAX_contact_form-144.html&quot;&gt;Ajax Contact Form&lt;/a&gt; The advantage on mootools is that you don't need to download the whole library just to have an ajax event or some other tiny effect. You just download what you need.&lt;/p&gt;

&lt;p&gt;If I left your favorite contact form solution off the list, let me know in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Use WordPress' is_page() To Exclude Content</title>
   <link href="http://www.travisberry.com/2010/01/use-wordpress-is_page-to-exclude-content"/>
   <updated>2010-01-30T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2010/01/use-wordpress-is_page-to-exclude-content</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Use WordPress' is_page() To Exclude Content&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/nbachiyski/2186228674/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/uploads/2010/01/wordpressnotebookcircle.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-01-30&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;After my last post involving including custom content, I've received questions about doing the reverse, excluding content on certain pages.&lt;/p&gt;

&lt;p&gt;As with everything there are several ways to accomplish this. I'll cover some of the easiest.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;The first way is the same as &lt;a href=&quot;http://www.travisberry.com/2010/01/use-wordpress-is_page-to-display-custom-content/&quot;&gt;including custom content&lt;/a&gt;. The only difference is you have to list every page besides the ones you don't want it to show on. This can be quite consuming if you have a large number of pages. On a small portfolio site though, this is totally useful.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176902.js?file=example1.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php 
    if ( is_page('work') || is_page('contact')) { 
        echo '&amp;lt;div id=&amp;quot;secondnav&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;secondnavs&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://www.travisberry.com/video/&amp;quot;&amp;gt;Video&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;longsecondnavs&amp;quot;&amp;gt;.&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;'; 
    } 
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;If you had three pages; 'work', 'contact', and 'blog', the above code would display the div 'secondnav' on every page but 'blog'.&lt;/p&gt;

&lt;p&gt;Another way is to use the above method but target it to the page you want excluded. So,&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176902.js?file=example2.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php 
    if ( is_page('blog')) { 
        echo '&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;http://whereeveryouputthenewcssfile.css&amp;quot; type=&amp;quot;text/css&amp;quot; media=&amp;quot;screen&amp;quot; /&amp;gt;'; 
    } 
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Can be used to exclude a section of content. Let's say you still don't want to show the 'secondnav' div on the blog page. So create a new .css file. Name it whatever you like and put it where ever you like. Just replace the url in the example with a link to the new file.Inside the new .css file put this;&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176902.js?file=example3.css'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;#secondnav{
    display:none !important;
}&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;The 'secondnav' div will no be invisible on the 'blog' page.&lt;/p&gt;

&lt;p&gt;One final, less conditional way of doing this would be to create a new template for the page. Create a file called, 'nonav.php'.&lt;/p&gt;

&lt;p&gt;Copy and paste everything from your normal 'page.php' file and paste it into 'nonav.php'. Find the part you want removed and delete it from the file. Move to the very top of the 'nonav.php' file. Paste this into the file.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176902.js?file=example4.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php
/*
    Template Name: NoNav
*/
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Save the file and upload it to your current theme directory.&lt;/p&gt;

&lt;p&gt;Now in the WordPress admin area, edit the page you don't want the 'secondnav' div in. On the right side of the screen, there is a place that allows you to pick a template. Select the drop down menu and select your new template. Hit the update post button, and your page should no longer have the 'secondnav' div.&lt;/p&gt;

&lt;p&gt;There you go, a few way's to exclude content from certain pages. The best way to decide between excluding or including content is to go with whichever is the shortest. If you have 100 pages and 1 doesn't need something, exclude. If the 1 needs something, and the 100 don't, include.&lt;/p&gt;

&lt;p&gt;If you have other solutions, or any questions, let me know in the comments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;a href=&quot;http://www.reddit.com/user/kylegetsspam&quot;&gt;kylegetsspam&lt;/a&gt; over on reddit pointed out another simple way of doing the same thing. Add,&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176902.js?file=example5.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php 
    body_class(); 
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;To your body tag. Then add this to your main style sheet.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176902.js?file=example6.css'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;#page-id-2 #secondnav { 
    display: none; 
}&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Edit 2:&lt;/strong&gt; To use regular PHP and not WordPress to exclude content, see &lt;a href=&quot;http://www.travisberry.com/2010/10/if-is_page-with-regular-php/&quot;&gt;my post here&lt;/a&gt;.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Don't Be Afraid To Self Promote</title>
   <link href="http://www.travisberry.com/2010/01/dont-be-afraid-to-self-promote"/>
   <updated>2010-01-17T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2010/01/dont-be-afraid-to-self-promote</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Don't Be Afraid To Self Promote&lt;/h3&gt;
  &lt;a href=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2010/01/MissionMangreat.jpg&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic3.travisberry.com/wp-content/uploads/2010/01/MissionMangreat.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-01-17&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;Self promoting your work can be a fine line to walk. Don't do it at all, and people won't take you seriously because you give the impression you don't take your work seriously. Do it too much and you run the risk of looking like a blowhard jerk. However, if you manage to find a good balance the rewards can be great.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;I have certainly been one to fall into the don't promote category. Mainly because I wanted to avoid falling into the latter category. But recently, after deciding my readership number aren't what I would like them to be, I have begun promoting my articles online.&lt;/p&gt;

&lt;p&gt;The number of sites I promote my work on is still relatively small. I also try to really interact on the site and promote others work as well as my own. This helps avoid the blowhard jerk label you can receive by only promoting your work. Plus when others begin to notice you consistently promoting their work, they start to do it to your stuff.&lt;/p&gt;

&lt;p&gt;Anyway, back to the rewards, after spending a minimal amount of time promoting my articles, my monthly views doubled in two days. And that was after doing it to just the &lt;a href=&quot;http://www.travisberry.com/2010/01/use-wordpress-is_page-to-display-custom-content/&quot;&gt;latest post&lt;/a&gt;. So from now on, I intend to continue with my article promotion. Hopefully, the trend will continue to grow.&lt;/p&gt;

&lt;p&gt;If you've had positive, or negative, experience with self promotion let me know in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Say It Aint So! Time For A New Contact Form</title>
   <link href="http://www.travisberry.com/2010/01/say-it-aint-so-time-for-a-new-contact-form"/>
   <updated>2010-01-12T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2010/01/say-it-aint-so-time-for-a-new-contact-form</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Say It Aint So! Time For A New Contact Form&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/ngmmemuda/4171221241/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic2.travisberry.com/uploads/2010/01/despair.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-01-12&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;So it may be time to ditch my favorite WordPress plugin, &lt;a href=&quot;http://contactform7.com/&quot;&gt;Contact Form 7&lt;/a&gt;, and find something new.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;It seems that with the upgrade to 2.1 comes a new script.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176888.js?file=example1.html'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
    //&amp;lt;![CDATA[
        var _wpcf7 = { cached: 1 };
    //]]&amp;gt;
&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;This script seems to work with WP Super Cache for some reason or another. Either way, it throws up all kinds of errors in google's page speed test. I'm not sure if there is a work around yet, if I'm going to ditch Contact Form 7 and redo all my forms, or if I'm crazy and this rogue script is coming from something else.&lt;/p&gt;

&lt;p&gt;If you have any idea what this is, or better yet how to remove it, please let me know in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Use WordPress' is_page() To Display Custom Content</title>
   <link href="http://www.travisberry.com/2010/01/use-wordpress-is_page-to-display-custom-content"/>
   <updated>2010-01-11T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2010/01/use-wordpress-is_page-to-display-custom-content</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Use WordPress' is_page() To Display Custom Content&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/nbachiyski/2186228674/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic1.travisberry.com/wp-content/uploads/2010/01/wordpressnotebook.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-01-11&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;Something that comes up on a regular basis is how to display certain content on different pages or if certain conditions are met. One way to accomplish this would be to create separate templates for each page. However, if you have a bunch of pages this can quickly become a pain. The other way to accomplish this would be to use WordPress' is_page() function to display content when you want.&lt;/p&gt;

&lt;p&gt;First let's take a look at what the function is. According to the codex&lt;/p&gt;

&lt;blockquote&gt;
This Conditional Tag checks if Pages are being displayed. This is a boolean function, meaning it returns either TRUE or FALSE.
&lt;/blockquote&gt;


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

&lt;p&gt;Ok, that's not the most helpful description ever. A simpler explanation would be that the tag checks the name of the page and returns TRUE or FALSE. This means you can put a nice little echo in there and have it display whatever you want.&lt;/p&gt;

&lt;p&gt;So let's say you have one page.php file. This is the template you use on every page on your site. On your about page you would like to add a secondary navigation. I don't know why you want to, let's just say you do. This navigation sits above the content area, so you can't just add it into your page through the WordPress wysiwyg editor. Again, you could create a new template for the page, but that is boring. Instead, where you want the second navigation to be, enter this into your page.php file.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176883.js?file=example1.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php 
    if ( is_page('about')) { 
        echo '&amp;lt;div id=&amp;quot;secondnav&amp;quot;&amp;gt;This is the super cool secondary navigation.&amp;lt;/div&amp;gt;'; 
    } 
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;The code is asking if the page is named &quot;about&quot;, if it is, it echo's the div &quot;secondnav&quot;. If the page isn't called &quot;about&quot; then it echo's nothing and nothing is displayed. It's that simple. If you want the nav to display on the &quot;about&quot;and &quot;contact&quot;page add this&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176883.js?file=example2.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php 
    if ( is_page('about') || is_page('contact')) { 
        echo '&amp;lt;div id=&amp;quot;secondnav&amp;quot;&amp;gt;This is the super cool secondary navigation.&amp;lt;/div&amp;gt;'; 
    } 
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;One place I find myself using this a lot is loading javascript only on pages that need it. One problem of adding javascript links to your footer.php file is that they are called on everypage whether you need them or not. The simple way to call them only when need is to add them like this&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176883.js?file=example3.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?php 
    if ( is_page('about'))  { 
        echo '&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;'; 
    } 
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;This works well for pages, but for your blog page and single posts you will need a different function.&lt;/p&gt;

&lt;p&gt;For your blog page use &lt;code&gt;is_home()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For your single posts use &lt;code&gt;is_single()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;WordPress provides a slew of other tags as well including&lt;/p&gt;

&lt;p&gt;&lt;code&gt;is_home(), is_front_page(), is_search(), is_404(), is_singular(), is_page(), is_attachment(), is_local_attachment(), is_single(), is_sticky(), is_archive(), is_category(), is_tag(), is_author(), is_date(), is_year(), is_month(), is_day(), is_time(), is_admin(), is_preview(), is_paged(), is_page_template(), is plugin active(), is_plugin_page(), is_new_day(), is_feed(), is_trackback(), is_comments_popup(), comments_open(), pings_open(), is_taxonomy(), is_taxonomy_hierarchical(), is_term(), is_user_logged_in(), is_blog_installed(), is_active_sidebar(), is_dynamic_sidebar(), is_active_widget()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;As you can see, you can target pretty specific events and conditions. So have fun experimenting with conditional tags and if you come up with something cool, let me know in the comments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; To use regular PHP and not WordPress to include content, see &lt;a href=&quot;http://www.travisberry.com/2010/10/if-is_page-with-regular-php/&quot;&gt;my post here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Gentleman WordPress Theme</title>
   <link href="http://www.travisberry.com/2010/01/gentleman-wordpress-theme"/>
   <updated>2010-01-11T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2010/01/gentleman-wordpress-theme</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Gentleman WordPress Theme&lt;/h3&gt;
  &lt;a href=&quot;http://gentleman.travisberry.com/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2010/01/gentlemanthemecap.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-01-11&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;Another new free theme. This WordPress theme is a simple and elegant theme, perfect for a simple text blog. &lt;a href=&quot;http://github.com/ninetwentyfour/Gentleman-WordPress-Theme/archives/master&quot;&gt;Download A Copy&lt;/a&gt; or&lt;a href=&quot;http://gentleman.travisberry.com/&quot;&gt;Visit A Demo&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;From README.txt&lt;/p&gt;

&lt;p&gt;Gentleman Wordpress Theme by Travis Berry is licensed under a Creative Commons Attribution 3.0 United States License.&lt;/p&gt;

&lt;p&gt;http://gentleman.travisberry.comThis theme is available for use for personal or commercial purposes. Please consider giving a link back to http://oldstatic.travisberry.com somewhere on your site.&lt;/p&gt;

&lt;p&gt;For questions email contact@travisberry.com&lt;/p&gt;

&lt;p&gt;Download latest version from &lt;a href=&quot;http://github.com/ninetwentyfour/Gentleman-WordPress-Theme/archives/master&quot;&gt;http://github.com/ninetwentyfour/Gentleman-WordPress-Theme/archives/master&lt;/a&gt;
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>A Hard Day At Work</title>
   <link href="http://www.travisberry.com/2010/01/a-hard-day-at-work"/>
   <updated>2010-01-02T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2010/01/a-hard-day-at-work</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;A Hard Day At Work&lt;/h3&gt;
  &lt;a href=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2010/01/travisretouchglow-640x489.jpg&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic3.travisberry.com/wp-content/uploads/2010/01/travisretouchglow-640x489.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2010-01-02&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;Had a hard day of modeling at work the other day. Jordan at &lt;a href=&quot;http://www.creative303.com&quot;&gt;Creative 303&lt;/a&gt; is a great photographer. Really kind of lazy on the blog post front. Hope to pick back up soon.&lt;/p&gt;

&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Happy Holidays</title>
   <link href="http://www.travisberry.com/2009/12/happy-holidays"/>
   <updated>2009-12-25T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/12/happy-holidays</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Happy Holidays&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/mr_t_in_dc/4159310486/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic2.travisberry.com/wp-content/uploads/2009/12/christmas.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-12-25&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;I just wanted to put up a quick post wishing everyone a happy holiday. The last year has been great for me, and I look forward to next year being even better. To all the people in my life that have had a positive impact, I just want to say thank you.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>New Free WordPress Theme: Dark Wood</title>
   <link href="http://www.travisberry.com/2009/12/new-free-wordpress-theme-dark-wood"/>
   <updated>2009-12-20T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/12/new-free-wordpress-theme-dark-wood</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;New Free WordPress Theme: Dark Wood&lt;/h3&gt;
  &lt;a href=&quot;http://darkwood.travisberry.com/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic1.travisberry.com/wp-content/uploads/2009/12/darkwoodcaplarge.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-12-20&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;I have just released a new Wordpress theme. The theme is dark and modern, perfect for a portfolio site. Theme features an accordion style menu, and slider example galleries.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;&lt;a href=&quot;http://github.com/ninetwentyfour/DarkWoodTheme/archives/master&quot;&gt;Download a copy&lt;/a&gt;, or &lt;a href=&quot;http://darkwood.travisberry.com/&quot;&gt;visit a demo&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you get a copy and have any questions, feel free to leave them in the comments.&lt;/p&gt;

&lt;p&gt;And if you’re interested in a completely custom site, feel free to send me an &lt;a href=&quot;mailto:contact@travisberry.com&quot;&gt;email&lt;/a&gt; and we can discuss your needs.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://creativecommons.org/licenses/by/3.0/us/&quot;&gt;&lt;img src=&quot;http://i.creativecommons.org/l/by/3.0/us/88x31.png&quot; alt=&quot;Creative Commons License&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; property=&quot;dc:title&quot;&gt;Dark Wood Wordpress Theme&lt;/span&gt; by Travis Berry is licensed under a &lt;a href=&quot;http://creativecommons.org/licenses/by/3.0/us/&quot;&gt;Creative Commons Attribution 3.0 United States License&lt;/a&gt;.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Improve YSlow Score With .htaccess</title>
   <link href="http://www.travisberry.com/2009/12/improve-yslow-score-with-htaccess"/>
   <updated>2009-12-20T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/12/improve-yslow-score-with-htaccess</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Improve YSlow Score With .htaccess&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/markjsebastian/3114597691/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/12/warpspeed.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-12-20&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;How fast your site loads is a huge factor in how many visits you get. One of the biggest names in performance testing is &lt;a href=&quot;http://developer.yahoo.com/yslow/&quot;&gt;YSlow&lt;/a&gt;. A high score on YSlow is a good indicator that your site is performing well. Many of the scores can be improved with a little bit of tweaking to your .htaccess file.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;Add this snippet to the top of your .htaccess file.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176878.js?file=example1.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;Header unset ETag

FileETag None

&amp;lt;FilesMatch &amp;quot;\.(css|js)$&amp;quot;&amp;gt;
    SetOutputFilter DEFLATE
&amp;lt;/FilesMatch&amp;gt;

&amp;lt;FilesMatch &amp;quot;\.(mov|otf|eot|ttf|ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$&amp;quot;&amp;gt;
    Header set Expires &amp;quot;Thu, 15 Apr 2010 20:00:00 GMT&amp;quot;
&amp;lt;/FilesMatch&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Now for a little breakdown of what each part does.&lt;/p&gt;

&lt;p&gt;This part disables &lt;a href=&quot;http://en.wikipedia.org/wiki/HTTP_ETag&quot;&gt;E-Tags&lt;/a&gt; so not to cause conflicts.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176878.js?file=example2.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;Header unset ETag

FileETag None&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;This &lt;a href=&quot;http://en.wikipedia.org/wiki/Gzip&quot;&gt;gzips&lt;/a&gt; your css and javascript files resulting in a smaller transfer size.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176878.js?file=example3.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;FilesMatch &amp;quot;\.(css|js)$&amp;quot;&amp;gt;
    SetOutputFilter DEFLATE
&amp;lt;/FilesMatch&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;This adds a &lt;a href=&quot;http://www.askapache.com/htaccess/apache-speed-expires.html&quot;&gt;far future Expires header&lt;/a&gt; to most static files you will have.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176878.js?file=example4.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;FilesMatch &amp;quot;\.(mov|otf|eot|ttf|ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$&amp;quot;&amp;gt;
    Header set Expires &amp;quot;Thu, 15 Apr 2010 20:00:00 GMT&amp;quot;
&amp;lt;/FilesMatch&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;With these few changes your score in YSlow should dramatically improve. Any other .htacces tricks? Let me know in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>This Makes Me Want To Quit Video</title>
   <link href="http://www.travisberry.com/2009/12/this-makes-me-want-to-quit-video"/>
   <updated>2009-12-16T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/12/this-makes-me-want-to-quit-video</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;This Makes Me Want To Quit Video&lt;/h3&gt;
  &lt;a href=&quot;http://oldstatic.travisberry.com/natalieVideoThunb.jpg&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic3.travisberry.com/natalieVideoThunb.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-12-16&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;WTF?! How? Who? What? My &lt;a href=&quot;http://studiolascala.com/&quot;&gt;teacher&lt;/a&gt; sent me this, it's from a &lt;strong&gt;photography student&lt;/strong&gt; who just took his first video class. This is from a freaking &lt;strong&gt;Fundamentals of Editing&lt;/strong&gt; class. I can't believe how good this kid is. He has great things in his future. Oh, and he did the music and sang the song too. Fantastic.&lt;/p&gt;

&lt;object width=&quot;640&quot; height=&quot;505&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/UUIo-Jv90LA&amp;hl=en_US&amp;fs=1&amp;&quot; /&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot; /&gt;&lt;embed src=&quot;http://www.youtube.com/v/UUIo-Jv90LA&amp;hl=en_US&amp;fs=1&amp;&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;640&quot; height=&quot;505&quot;&gt;&lt;/embed&gt;&lt;/object&gt;


&lt;p&gt;Head over to &lt;a href=&quot;http://www.youtube.com/user/shamanphoto&quot;&gt;his youtube page&lt;/a&gt; and leave a comment letting him know how awesome he is.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Simplifying Video Aspect Ratios</title>
   <link href="http://www.travisberry.com/2009/12/simplifying-video-aspect-ratios"/>
   <updated>2009-12-16T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/12/simplifying-video-aspect-ratios</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Simplifying Video Aspect Ratios&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/janramroth/1298370325/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic2.travisberry.com/wp-content/uploads/2009/12/brokentv.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-12-16&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;Video aspect ratio can be a confusing beast. Is it 4:3 or 16:9? Are the pixels square or some sort of rectangle? All of these things are important to consider when creating video files and assets for video. Make a mistake and all of a sudden that circle is more of an oval. So I'm here to help you simplify and make heads from tails in video aspect ratio.&lt;/p&gt;

&lt;p&gt;First the easy part. 4:3 vs 16:9. This is the difference between old school &quot;square&quot; (not really square but close) televisions and the new fancy &quot;widescreen&quot; televisions. 4:3 is the size of the screen that standard definition uses. 16:9 is for HD content. As a matter of fact, 16:9 is the only consistent component to HD video. Which is why you have the mess of 480p, 480i, 720p, 1080p, etc.&lt;/p&gt;

&lt;p&gt;Basically if you shoot in standard definition you'll be using 4:3, if you're shooting HD, you'll be using 16:9.&lt;/p&gt;

&lt;p&gt;Once you have your composition aspect ratio worked out, it's time to deal with pixel aspect ratio. Pixels are the little dots that combine to make up the image. Most of you are familiar with this concept on computers. Here pixels live in nice even rows and are nice and square. Square is good. Square is easy to understand.&lt;/p&gt;

&lt;p&gt;Now let's look at standard definition television. The history of television in the US is a clusterf#@k. The technology has been built and expanded upon old and broken technology, leading to many compromises in ease of use to support old technology. For instance, the frame rate of TV is a nice and even 29.97 frames per second. Wait, what? How the fuck is that convenient? Wouldn't an even number be much easier to work with? Well, yes it would, but that would be too simple. See when color TV came out there needed to be a way to add the color information into the signal without ruining the TV of people who already had one. So a compromise was made to add the signal to the existing tech and make the frame rate, an unbearable 29.97 fps.&lt;/p&gt;

&lt;p&gt;Another compromise to come out of the history of television is the .9:1 aspect ratio of pixels. This means, that on a standard definition television, the pixels are slightly taller than they are wide. This leads to creating a circle on a computer, and all of a sudden it's an oval on a TV. That's not what we want.&lt;/p&gt;

&lt;p&gt;The simple solution is to convert everything to square pixels for use on the computer. To create images that will look right when moved to a standard definition television create your compositions at 648 X 480 with square pixels. When moved to the TV the stretching compensates for the pixel aspect ration, and things should look right.&lt;/p&gt;

&lt;p&gt;HD video has suffered from a clusterf#@k of formats more so than being built to accommodate legacy technology. Every camera and television maker wants desperately to be the standard for HD, but unfortunately having so many competing formats and no winner creates problems in post.&lt;/p&gt;

&lt;p&gt;The most common problem again is keeping pixel aspect ratios consistent. The easiest way to solve the problem is to force square pixels on everything. The correct size for 720 video is 1280x720 square pixels, and for 1080 video it is 1920x1080 square pixels. So if you have a problem of pulling footage from Final Cut Pro into After Effects and having it appear 4:3 instead of 16:9 double check that you are using square pixels with the correct dimensions.&lt;/p&gt;

&lt;p&gt;This is a little long winded but it's just the tip of the iceberg when it comes to video aspect ratio.&lt;/p&gt;

&lt;p&gt;If you have any tips or questions, feel free to add them in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Tooting My Own Horn</title>
   <link href="http://www.travisberry.com/2009/12/tooting-my-own-horn"/>
   <updated>2009-12-14T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/12/tooting-my-own-horn</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Tooting My Own Horn&lt;/h3&gt;
  &lt;a href=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/12/trombone.jpg&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic1.travisberry.com/wp-content/uploads/2009/12/trombone.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-12-14&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;
So I got an email today from &lt;a href=&quot;http://mobify.me/&quot; target=&quot;blank&quot;&gt;mobify.me&lt;/a&gt;. I use them to make the mobile friendly version of my site. Turns out they have a design gallery and mine was selected for entry. &lt;span id=&quot;more-409&quot;&gt;&lt;/span&gt;&lt;a href=&quot;http://mobify.me/gallery/travisberry/&quot; target=&quot;blank&quot;&gt;Go check it out&lt;/a&gt;, and if you&amp;#8217;re looking for a mobile solution for your website, check out mobify.me&amp;#8217;s services.&lt;/p&gt;


&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Another Free WordPress Theme</title>
   <link href="http://www.travisberry.com/2009/12/another-free-wordpress-theme"/>
   <updated>2009-12-12T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/12/another-free-wordpress-theme</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Another Free WordPress Theme&lt;/h3&gt;
  &lt;a href=&quot;http://github.com/ninetwentyfour/DrifterEntertainment_com/archives/master&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/12/driftersnewdesignscreencap.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-12-12&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;I have recently completed a new WordPress theme for &lt;a href=&quot;http://www.drifterentertainment.com&quot; target=&quot;blank&quot;&gt;Drifter Entertainment&lt;/a&gt;.&lt;span id=&quot;more-381&quot;&gt;&lt;/span&gt; Again I have decided to give it away for free. The theme is simple allowing your content to stand out. The theme is built to Drifter Entertainments custom needs, so you will have to edit the source files.&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;http://github.com/ninetwentyfour/DrifterEntertainment_com/archives/master&quot; target=&quot;blank&quot;&gt;Get the latest copy here.&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;If you get a copy and have any questions, feel free to leave them in the comments.&lt;/p&gt;


&lt;p&gt;And if you&amp;#8217;re interested in a completely custom site, feel free to send me an &lt;a class=&quot;email&quot; href=&quot;mailto:contact@travisberry.com&quot;&gt;email&lt;/a&gt; and we can discuss your needs.&lt;/p&gt;




&lt;p&gt;&lt;a rel=&quot;license&quot; href=&quot;http://creativecommons.org/licenses/by/3.0/us/&quot;&gt;&lt;img alt=&quot;Creative Commons License&quot; style=&quot;border-width:0&quot; src=&quot;http://i.creativecommons.org/l/by/3.0/us/88x31.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; property=&quot;dc:title&quot;&gt;Drifter Entertainment WordPress Theme&lt;/span&gt; by Travis Berry is licensed under a &lt;a rel=&quot;license&quot; href=&quot;http://creativecommons.org/licenses/by/3.0/us/&quot;&gt;Creative Commons Attribution 3.0 United States License&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Making display:none; Javascript Accessible</title>
   <link href="http://www.travisberry.com/2009/12/making-displaynone-javascript-accessible"/>
   <updated>2009-12-11T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/12/making-displaynone-javascript-accessible</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Making display:none; Javascript Accessible&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/dmitry-baranovskiy/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic3.travisberry.com/wp-content/uploads/2009/12/javascript.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-12-11&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;
When creating a collapsible navigation for a client, I came across the problem of having my navigation remaining hidden if someone has javascript disabled. Needless to say, this was a big problem. There is no secondary navigation on the site, so without it, there is NO navigation.&lt;span id=&quot;more-365&quot;&gt;&lt;/span&gt;&lt;/p&gt;


&lt;p&gt;The problem came from the fact that the element is set to&lt;/p&gt;


&lt;p&gt;&lt;div class=&quot;gistFallback&quot;&gt;&lt;script src='https://gist.github.com/1176865.js?file=example1.css'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;.menu_body{ display:none; }&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;&lt;/div&gt;&lt;/p&gt;


&lt;p&gt;Which is fine and dandy if you have javascript enabled. If you don&amp;#8217;t, all you see is a list of headers.&lt;/p&gt;




&lt;p&gt;Luckily there is an easy solution. Create another css file. I named mine, nojs.css&lt;/p&gt;


&lt;p&gt;In the css file add this, (Change the selector to which ever one you have set to display:none;)&lt;/p&gt;


&lt;p&gt;&lt;div class=&quot;gistFallback&quot;&gt;&lt;script src='https://gist.github.com/1176865.js?file=example2.css'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;.menu_body { display:inline !important; }&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;&lt;/div&gt;&lt;/p&gt;


&lt;p&gt;Place the file somewhere on your server and move back to your html.&lt;/p&gt;


&lt;p&gt;Add a &amp;lt;noscript&amp;gt; tag and in between create a link to the new css file.&lt;/p&gt;




&lt;p&gt;That&amp;#8217;s it. Your navigation should now show if someone has javascript disabled.&lt;/p&gt;


&lt;p&gt;Any other simple accessibility solutions I left out? Let me know in the comments.&lt;/p&gt;


&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Chrome and Thunderbird 3 Review</title>
   <link href="http://www.travisberry.com/2009/12/chrome-and-thunderbird-3-review"/>
   <updated>2009-12-09T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/12/chrome-and-thunderbird-3-review</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Download My WordPress Theme&lt;/h3&gt;
  &lt;a href=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/12/thunderchromereview.jpg&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic2.travisberry.com/wp-content/uploads/2009/12/thunderchromereview.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-12-07&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;It was a big day the other day with both Chrome and Thunderbird 3 being released. Chrome has been out on  Windows for a year, but this is the first official release for Mac. Thunderbird has been around for a while but this is the first big release in years. I downloaded and gave both a test run.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/12/chrome.jpg&quot; title=&quot;chrome&quot; alt=&quot;chrome&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.google.com/chrome&quot;&gt;Chrome&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So much potential. The key with Chrome is to remember this is still a beta release and it shows. Most things work fine, but occasionally you will find errors. For instance, on &lt;a href=&quot;http://oldstatic.travisberry.com/video/&quot;&gt;my videos page&lt;/a&gt;, the video will play, but there is no controller shown. There is also no support for extensions yet, so no extra add ons for you.&lt;/p&gt;

&lt;p&gt;The best thing about Chrome is the speed. Pages are much faster than other browsers and the launch time is quick as well.&lt;/p&gt;

&lt;p&gt;Anyone who does web design knows about the greatness of firebug, and Chrome tries to build it in, in the form of their Developer tools. They work well but still have plenty of refining to match firebug, but I'm sure with google working on it, the problems won't last long.&lt;/p&gt;

&lt;p&gt;All in all Chrome, at this point, is best served as a secondary browser. For now I'm sticking with the Fox, at least until Chrome matures a little bit more.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/12/thunderbird.jpg&quot; title=&quot;thunderbird&quot; alt=&quot;thunderbird&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.mozillamessaging.com/en-US/thunderbird/&quot;&gt;Thunderbird 3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Oh Thunderbird, I want to like you so much. Your big brother, Firefox, is the greatest thing since sliced bread. Well with this release, you may have won me over.&lt;/p&gt;

&lt;p&gt;I tried Thunderbird 2 a while ago. I was still using Mac Mail up to a couple days ago. I found Thunderbird 2 to be ugly, buggy, and ultimately less productive than Mail.&lt;/p&gt;

&lt;p&gt;Thunderbird 3 is out to change all that. By far the coolest thing about it is tabbed mail. Mozilla knows how to do tabs, and the execution in Thunderbird 3 is fantastic. After a few hours of tabbing out messages and flipping between them had me wondering how I ever lived without it.&lt;/p&gt;

&lt;p&gt;Other improvements include an updated appearance, and &quot;improved&quot; account creation. This is where I think Thunderbird 3 falls short. Adding a new account is still a messy process, and if you have a google hosted email on your own domain, the auto detection doesn't even come close to getting it right. If you're not experienced in setting up a mail client, you'll have a hard time.&lt;/p&gt;

&lt;p&gt;Overall Thunderbird 3 is looking solid. So far I'm still using it. There are plenty of nice features and the search function is awesome. Time will tell if I stick with it long term, but for now, it's doing a fine job.&lt;/p&gt;

&lt;p&gt;Have you gave either a download yet? Let me know what you think in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Download My WordPress Theme</title>
   <link href="http://www.travisberry.com/2009/12/download-my-wordpress-theme"/>
   <updated>2009-12-07T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/12/download-my-wordpress-theme</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Download My WordPress Theme&lt;/h3&gt;
  &lt;a href=&quot;http://github.com/ninetwentyfour/TravisBerry_com/archives/master&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic1.travisberry.com/wp-content/uploads/2009/12/mygithubpage.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-12-07&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;This was my old wordpress theme. You can get my current site at &lt;a href=&quot;https://github.com/ninetwentyfour/travisberry_com_static&quot;&gt;https://github.com/ninetwentyfour/travisberry_com_static&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're looking for a simple &lt;a href=&quot;http://wordpress.org/&quot;&gt;WordPress&lt;/a&gt; theme to use as a framework to modify, why not download mine?&lt;/p&gt;

&lt;p&gt;Built entirely from scratch by yours truly, my theme is super easy to understand and the css is easy to read and customize.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;You can grab a copy from my &lt;a href=&quot;http://github.com/ninetwentyfour/TravisBerry_com&quot;&gt;github page&lt;/a&gt;. Just click on the &lt;a href=&quot;http://github.com/ninetwentyfour/TravisBerry_com/archives/master&quot;&gt;download link&lt;/a&gt; and choose your preferred download format. I'm using github as opposed to hosting it here because the theme is still being worked on. Github makes it much easier to ensure everyone can get the latest copy.&lt;/p&gt;

&lt;p&gt;If you get a copy and have any questions, feel free to leave them in the comments.&lt;/p&gt;

&lt;p&gt;And if you're interested in a completely custom site, feel free to send me an &lt;a href=&quot;mailto:contact@travisberry.com&quot;&gt;email&lt;/a&gt; and we can discuss your needs.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://creativecommons.org/licenses/by/3.0/us/&quot;&gt;&lt;img src=&quot;http://i.creativecommons.org/l/by/3.0/us/88x31.png&quot; alt=&quot;Creative Commons License&quot; /&gt;&lt;/a&gt;&lt;span xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; property=&quot;dc:title&quot;&gt;Wordpress Theme&lt;/span&gt; by Travis Berry is licensed under a &lt;a href=&quot;http://creativecommons.org/licenses/by/3.0/us/&quot;&gt;Creative Commons Attribution 3.0 United States License&lt;/a&gt;. Fonts subject to separate license.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>The Worst Is Over</title>
   <link href="http://www.travisberry.com/2009/12/the-worst-is-over"/>
   <updated>2009-12-05T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/12/the-worst-is-over</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;The Worst Is Over&lt;/h3&gt;
  &lt;a href=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/12/celebration2.jpg&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/12/celebration2.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-12-05&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;Holy cow! The hardest quarter of school is over. So for the last 6 months I have had to create 5 commercials, a 5 minute fiction piece, and a 5 min non-fiction piece.&lt;/p&gt;

&lt;p&gt;All in all it went well for the most part, just a lot of work when combined with other classes and work.&lt;/p&gt;

&lt;p&gt;Well it's over now with me having passed review last Friday. You can see the 7 videos on my &lt;a href=&quot;http://www.youtube.com/user/ninetwentyfour&quot;&gt;video&lt;/a&gt; page. Go have a look and feel free to leave a comment about them on this page.&lt;/p&gt;

&lt;p&gt;And congrats to Aspen, Henry, and Kelly who also passed.&lt;/p&gt;

&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Sound FX Tip - Muffled Sounds</title>
   <link href="http://www.travisberry.com/2009/11/sound-fx-tip-muffled-sounds"/>
   <updated>2009-11-29T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/11/sound-fx-tip-muffled-sounds</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Sound FX Tip - Muffled Sounds&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/mourner/3306939463/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic3.travisberry.com/wp-content/uploads/2009/12/audioknobs.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-11-29&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;When I was working on a video project this week I came across the need to have my sound effects sound like they are coming through a cell phone and from inside a box.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;Turns out there is an extremely easy solution for both, high and low pass filters.&lt;/p&gt;

&lt;p&gt;To make something sound like it is coming out of a crappy cell phone speaker put a high pass filter on it. You may have to tweak the settings a little bit to get the effect you want, but that is it.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/11/highpass.jpg&quot; title=&quot;highpass&quot; alt=&quot;highpass&quot; /&gt;&lt;/p&gt;

&lt;p&gt;To solve the other problem of needing a sound to sound like it's coming from inside a box, use a low pass filter. Again, you may need to tweak the settings to get your desired results.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/11/lowpass.jpg&quot; title=&quot;lowpass&quot; alt=&quot;lowpass&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I love when solutions to problems are as simple as this. If you know of any other quick audio tips, let me know in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>5 Awesome News Mashup Sites</title>
   <link href="http://www.travisberry.com/2009/11/5-awesome-news-mashup-sites"/>
   <updated>2009-11-25T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/11/5-awesome-news-mashup-sites</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;5 Awesome News Mashup Sites&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/shironekoeuro/4040697914/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic2.travisberry.com/wp-content/uploads/2009/12/newspapers.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-11-25&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;There are so many great news sites out there. From traditional news, to bloggers, to social submission sites, following them all can be overwhelming. Luckily there are mashups that bring all these wonderful sites to one place. This makes keeping track of the latest and greatest much easier.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;Here is a list of 5 awesome news mashup sites.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.jimmyr.com&quot;&gt;JimmyR&lt;/a&gt; My personal favorite site. This could easily over take googles position as my homepage. Plus the guy who runs it is pretty smart and he has a lot of other random good things on his site like tutorials.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://oursignal.com/static/about&quot;&gt;OurSignal&lt;/a&gt; This one has a pretty cool interface. Don't know if I could use it long term though.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://popurls.com/&quot;&gt;POPURLS&lt;/a&gt; This is the name most people think of when they think news mashup. Oldie but goody.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://alltop.com/&quot;&gt;Alltop&lt;/a&gt; This one has more categories than just &quot;news&quot; so it may be worth cecking out if you're looking for something new or specific.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://web20.originalsignal.com/&quot;&gt;originalsignal&lt;/a&gt; Very tech centered mashup. All internet related news.&lt;/p&gt;

&lt;p&gt;Use a different mashup? Let me know in the comments.&lt;/p&gt;

&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>5 Resources To Learn After Effects Expressions</title>
   <link href="http://www.travisberry.com/2009/11/5-resources-to-learn-after-effects-expressions"/>
   <updated>2009-11-23T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/11/5-resources-to-learn-after-effects-expressions</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;5 Resources To Learn After Effects Expressions&lt;/h3&gt;
  &lt;a href=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/11/aftereffectsexpressions.jpg&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic1.travisberry.com/wp-content/uploads/2009/11/aftereffectsexpressions.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-11-23&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;After Effects is an incredibly powerful motion graphics editor. One of the more powerful things inside of After Effects is expressions. Expressions give you much greater control over your animations and can automate things that are not possible with key frames and filters alone.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;Learning to use expressions is not hard but it does takes some work. Here are 5 resources to help you on your way.&lt;/p&gt;

&lt;p&gt;Some are tutorials while other are example scripts but all should help you become a scripting ninja in no time.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://jjgifford.com/expressions/basics/index.html&quot;&gt;http://jjgifford.com/expressions/basics/index.html&lt;/a&gt; The tutorial was written for AE 5.0 but the concepts hold up remarkably well. Really good, must read. Seriously, if you follow any of these links, this is it.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://aescripts.com/&quot;&gt;http://aescripts.com/&lt;/a&gt; This site has a lot of useful scripts. Some cost money but some are pay what you want.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://xscriptorium.com/&quot;&gt;http://xscriptorium.com/&lt;/a&gt; Another script repository, quite large.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://xscriptorium.com/&quot;&gt;http://www.yenaphe.info/top-10-scripts-for-after-effects-for-workflow-enhancement/&lt;/a&gt; A good blog post to highlight some of the more useful expressions.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://forums.adobe.com/community/aftereffects_general_discussion/aftereffects_expressions&quot;&gt;http://forums.adobe.com/community/aftereffects_general_discussion/aftereffects_expressions&lt;/a&gt; What a better place to learn about After Effects than Adobe.&lt;/p&gt;

&lt;p&gt;These sites are only the tip of the iceberg when it comes to After Effects expressions. Know of some other really good resources? Let me know in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Running A Git Repo on DreamHost</title>
   <link href="http://www.travisberry.com/2009/11/running-a-git-repo-on-dreamhost"/>
   <updated>2009-11-20T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/11/running-a-git-repo-on-dreamhost</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Running A Git Repo on DreamHost&lt;/h3&gt;
  &lt;a href=&quot;http://git-scm.com/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/11/gitlogo.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-11-20&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://git-scm.com/&quot;&gt;Git&lt;/a&gt; is freaking awesome. I'm not sure how I lived without it. For those who don't know, Git is a version control system.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;




&lt;blockquote&gt;
[From Wikipedia](http://en.wikipedia.org/wiki/Revision_control): Revision control (also known as version control, source control or (source) code management (SCM)) is the management of changes to documents, programs, and other information stored as computer files. It is most commonly used in software development, where a team of people may be changing the same files. Changes are usually identified by a number or letter code, termed the &quot;revision number&quot;, &quot;revision level&quot;, or simply &quot;revision&quot;. For example, an initial set of files is &quot;revision 1&quot;. When the first change is made, the resulting set is &quot;revision 2&quot;, and so on. Each revision is associated with a timestamp and the person making the change. Revisions can be compared, restored, and with some types of files, merged.
&lt;/blockquote&gt;


&lt;p&gt;Simply put a version control system allows you to track changes to files, and merge them in multiple locations.&lt;/p&gt;

&lt;p&gt;There are numerous websites that host git repos, the largest being &lt;a href=&quot;http://github.com/&quot;&gt;github&lt;/a&gt;, but most either require being public or paying for hosting. Well I already pay for a host so why pay for another? Especially when they seem to cost as much as my regular host.&lt;/p&gt;

&lt;p&gt;So to set up a git repo on &lt;a href=&quot;http://www.dreamhost.com/&quot;&gt;DreamHost&lt;/a&gt; you have to enable &lt;a href=&quot;http://en.wikipedia.org/wiki/WebDAV&quot;&gt;webDAV&lt;/a&gt; on a folder on your server. You can accomplish this by going to your DreamHost webpanel and going to &quot;goodies&quot; - &quot;.htaccess/webDAV&quot;.&lt;/p&gt;

&lt;p&gt;Go through the on screen instructions to setup the webDAV in a folder. I named mine /git/. If you need help with this, follow this &lt;a href=&quot;http://wiki.dreamhost.com/WebDAV&quot;&gt;walk-through&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After an hour or so the folder will be setup. You can test by logging in. In OSx hit command k and enter in the url to your folder. something like http://yoursite.com/git . You will be prompted for the user name and password you assigned when you setup the webDAV. If all goes well, a folder should appear in your finder with the folder on your server shown.&lt;/p&gt;

&lt;p&gt;Now create a blank folder on the desktop. Name it whatever you want. I'll call mine, &quot;gittest&quot; .&lt;/p&gt;

&lt;p&gt;Initiate a blank repository by running&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176861.js?file=command1.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;mkdir gittest

cd gittest

git --bare init&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Now tell the repository where it will live&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176861.js?file=command2.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;git repo-config remote.origin.url http://yoursite.com/git/gittest/git update-server-info&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Once you have that done, upload the folder into the &quot;git&quot; folder on your webDAV server.&lt;/p&gt;

&lt;p&gt;Now create the folder you want to use as your local files folder. It can be named whatever you want. Inside create a couple html files. Save them.Now do the typical git initialization and commit the files.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176861.js?file=command3.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;git init

git add .

git commit -m &amp;quot;yourmessagegoeshere&amp;quot;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Now configure your remote master repo.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176861.js?file=command4.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;git repo-config remote.origin.url http://yourusername@www.yoursite.com/git/gittest/&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;The &quot;yourusername&quot; is the user name you use to login to the webDAV folder. Now try to push to the remote.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176861.js?file=command5.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;git push origin master&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;After you hit enter on the code above it will prompt your for the password for the account.&lt;/p&gt;

&lt;p&gt;That should push all your local files to the git remote repo. Now don't panic when you can't see the html files in your webDAV server. Git doesn't need them to track your changes and files.&lt;/p&gt;

&lt;p&gt;You can test that it works by creating a new folder somewhere on your computer. Now clone your project to it.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176861.js?file=command6.txt'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;mkdir newfolder

cd newfolder

git clone http://yourusername@www.yoursite.com/git/gittest/&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;If everything is working you should now be able to see the html files in the new folder.&lt;/p&gt;

&lt;p&gt;So that's it really. You now have a self-hosted git repo. The only other thing left to do is to add a &lt;a href=&quot;http://git.or.cz/gitwiki/InterfacesFrontendsAndTools#WebInterface&quot;&gt;web interface&lt;/a&gt; if you want, however, I haven't been able to get one to work. As I continue to mess with it, if I find a solution, I will post it here.&lt;/p&gt;

&lt;p&gt;Helpful articles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://wiki.dreamhost.com/Git&quot;&gt;DreamHost support wiki&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://casperfabricius.com/site/2008/09/21/keeping-git-repositories-on-dreamhost-using-ssh/&quot;&gt;Keeping git repositories on Dreamhost using SSH&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://toolmantim.com/articles/setting_up_a_new_remote_git_repository&quot;&gt;Setting up a new remote git repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://joemaller.com/2008/11/25/a-web-focused-git-workflow/&quot;&gt;A web-focused Git workflow&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://ikiwiki.info/rcs/git/&quot;&gt;git repository setup&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Any tips to smooth out this process? Leave them in the comments.&lt;/p&gt;

&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Handy List of Terminal Commands</title>
   <link href="http://www.travisberry.com/2009/11/handy-list-of-terminal-commands"/>
   <updated>2009-11-20T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/11/handy-list-of-terminal-commands</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Handy List of Terminal Commands&lt;/h3&gt;
  &lt;a href=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/11/terminalcap.jpg&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic3.travisberry.com/wp-content/uploads/2009/11/terminalcap.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-11-20&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;This list is more for my personal reference than anything but you may find some useful information here.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;Restart .profile
&lt;code&gt;. ~/.profile&lt;/code&gt;Stop default Apache on OSx&lt;code&gt;sudo /usr/sbin/apachectl stop&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Restart Apache
&lt;code&gt;sudo /opt/local/apache2/bin/apachectl restart&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Start mysql
&lt;code&gt;sudo mysqld_safe5&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Change database privileges
&lt;code&gt;grant all privileges on &quot;databasename&quot;.* to 'name'@'localhost' identified by 'name'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Dump database
&lt;code&gt;mysqldump db_name &amp;gt; backup-file.sql&lt;/code&gt;Import database&lt;code&gt;mysql db_name &amp;lt; backup-file.sql&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Initialize git repository
&lt;code&gt;git init&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Configure git remote server
&lt;code&gt;git repo-config remote.origin.url http://yourusername@www.yoursite.com/git/gittest/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Push git changes to remote
&lt;code&gt;git push origin master&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Clone repository
&lt;code&gt;git clone http://yourusername@www.yoursite.com/git/gittest/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Pull changes to local branch
&lt;code&gt;git pull http://yourusername@www.yoursite.com/git/gittest/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Connect to remote with ssh
&lt;code&gt;ssh yourusername@yoursite.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Copy file contents directly to clipboard
&lt;code&gt;cat ~/filelocation | pbcopy&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Sync MacPorts
&lt;code&gt;sudo port selfupdate&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Display installed ports
&lt;code&gt;port installed&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;List outdated ports
&lt;code&gt;port outdated&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Upgrade outdated ports
&lt;code&gt;port upgrade outdated&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Compress video with h264
&lt;code&gt;ffmpeg -i example.mov -vcodec libx264 -vpre hq -b 1300k -s 640x360 -acodec libfaac -ar 44100 -ab 128k -threads 6 -f mp4 example.mp4&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Compress video to Ogg
&lt;code&gt;ffmpeg2theora -V 700 -A 96 -H 44100 -K 24 -x 640 -y 360 --two-pass --optimize --speedlevel 0 --seek-index --soft-target --pp vdeblock:10/hdeblock:10 example.mov&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This post will continue to grow as I update it with new handy terminal commands.&lt;/p&gt;

&lt;p&gt;Any commands you can't live without? Let me know in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>5 Resources for Web Type</title>
   <link href="http://www.travisberry.com/2009/11/5-resources-for-web-type"/>
   <updated>2009-11-17T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/11/5-resources-for-web-type</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;5 Resources for Web Type&lt;/h3&gt;
  &lt;a href=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/11/typeimage.jpg&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic2.travisberry.com/wp-content/uploads/2009/11/typeimage.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-11-17&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;Typography has come a long way in recent years. From everything being done in Arial, to using images to fake different fonts, the web has grown up. People now expect to be able to style their websites like they could style a photoshop mock up. These resources will help you accomplish that goal.&lt;!--more--&gt;&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;&lt;a href=&quot;http://webfontspecimen.com/&quot;&gt;Web Font Specimen&lt;/a&gt; Find out how fonts render in browser. Useful for @fontface fonts.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://nicewebtype.com/notes/2009/10/30/how-to-use-css-font-face/&quot;&gt;How to use CSS @font-face &lt;/a&gt; Tutorial for using @fontface to embed fonts other than the standard &quot;web safe&quot; fonts.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.theleagueofmoveabletype.com/&quot;&gt;The League of Moveable Type&lt;/a&gt; They list fonts licensed for web embedding.&quot;We are Caroline and Micah, the founders of The League. As designers on the web, we have a calling to raise the standards of the web-design world. We're not the only ones who value good design, and it's time for the web world to catch up with it. We understand the challenges that comes with the internet, but with our recent discovery of @font-face, we started getting excited. For those who aren't up to speed, @font-face is a fairly new addition to web styling, letting a designer specify the location of their own font files. Instead of having to design with just a handful of web-friendly fonts, we'll be able to use any typeface we desire. Well, that's our vision, anyway.&quot;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.hostscope.com/wordpress-plugins/ttftitles-wordpress-plugin/&quot;&gt;TTFTitles&lt;/a&gt; This wordpress plugin lets you use images to replace the titles of your posts, thus circumventing the problem of guessing what fonts your end-users might have installed.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://webdesignledger.com/tips/20-dos-and-donts-of-effective-web-typography&quot;&gt;20 Dos and Donts of Effective Web Typography&lt;/a&gt; Good list on typography rules.&lt;/p&gt;

&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Set Up a Domain, Host, and Email Quickly</title>
   <link href="http://www.travisberry.com/2009/11/set-up-a-domain-host-and-email-quickly"/>
   <updated>2009-11-16T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/11/set-up-a-domain-host-and-email-quickly</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Set Up a Domain, Host, and Email Quickly&lt;/h3&gt;
  &lt;a href=&quot;http://godaddy.com&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic1.travisberry.com/wp-content/uploads/2009/11/godaddyscreencap-640x269.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-11-16&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;I've had a few people ask me to do this in the last couple days so I thought I would do a write up to help save some time.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;First thing to do is to head over to &lt;a href=&quot;http://www.godaddy.com/&quot;&gt;godaddy&lt;/a&gt; and register a domain name.&lt;/p&gt;

&lt;p&gt;It is really important that you keep track of your account login information. This really applies to all of the login info you're about to get.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/11/dreamhostscreencap-640x461.jpg&quot; title=&quot;dreamhostscreencap&quot; alt=&quot;dreamhostscreencap&quot; /&gt;&lt;/p&gt;

&lt;p&gt;So after you have registered your domain name it is time to get a host. I use &lt;a href=&quot;http://www.dreamhost.com&quot;&gt;DreamHost&lt;/a&gt; and they are about as good and cheap as you're going to find. The key with this is, you only have to buy one hosting plan, you can then run as many domains off it as you want. So sign up for a DreamHost account and get it all setup by following their instructions.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/11/adddomaincap-640x211.jpg&quot; title=&quot;adddomaincap&quot; alt=&quot;adddomaincap&quot; /&gt;&lt;/p&gt;

&lt;p&gt;On the left side of your screen will be a &quot;Domains&quot; button. Click it and then &quot;add a domain&quot;. Enter in the domain you just registered with godaddy. Scroll down and make sure you check, &quot;Host email with google&quot;. This will allow you to have gmail run your email. Much better than other options.&lt;/p&gt;

&lt;p&gt;Once the hosting is set up you will need to go back to godaddy. Go Domains -&gt; My Domains -&gt; Click on domain name -&gt; On this page down towards the lower left is a &quot;Nameservers&quot; setting. Click manage and choose &quot;I host my domains with another provider&quot;. Delete the existing names and enter in ns1.dreamhost.com ns2.dreamhost.com ns3.dreamhost.com in the first three blanks.&lt;/p&gt;

&lt;p&gt;Click update and go back to DreamHost. Your site should now be live and be hosted on DreamHost. You can check by going to your domain in a browser. If you get a page that says &quot;Index of&quot; and has two files listed then you are all good to go.&lt;/p&gt;

&lt;p&gt;Now check the email account you used to setup the DreamHost. They should send you an email containing the ftp login information. Ftp into your account using your ftp program of choice. I use cyberduck, you can download it &lt;a href=&quot;http://cyberduck.ch/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/11/googleappscreencap-640x273.jpg&quot; title=&quot;googleappscreencap&quot; alt=&quot;googleappscreencap&quot; /&gt;&lt;/p&gt;

&lt;p&gt;If you can login to your account through ftp go over to &lt;a href=&quot;http://www.google.com/a&quot;&gt;google.com/a&lt;/a&gt; and sign up for a standard account. Enter in your information and when they ask how you would like to confirm owner ship choose upload an html file. Copy the text they give you and save it as the file name they specify. Take this file and upload it to your server through the ftp program.&lt;/p&gt;

&lt;p&gt;Check to see if you can view the file on your site and then click through to continue the google apps setup. Once you have reached the dashboard click activate email. You will now be able to setup as many email accounts you want. (up to 50) This will allow you to have contact@yourdomainname.com To enable imap support click on your inbox, click on settings, imap/pop3 forwarding -&gt; scroll down and click enable imap.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/11/mailscreencap.jpg&quot; title=&quot;mailscreencap&quot; alt=&quot;mailscreencap&quot; /&gt;&lt;/p&gt;

&lt;p&gt;If you use mail in OSx you can add the account by clicking add account -&gt; enter in your name and new email address -&gt; enter imap.gmail.com as your incoming server -&gt; use authentication with your full email address as your name and the password for the account -&gt; enter smtp.gmail.com as the outgoing server again using authentication. Take account live and you should be all setup.&lt;/p&gt;

&lt;p&gt;You now have a website, hosting, and email. You can continue on and add some html files to your server to setup a website, or install a blogging platform.Any tips to speed this process up? Let me know in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>YouTube Gets 1080p</title>
   <link href="http://www.travisberry.com/2009/11/youtube-gets-1080p"/>
   <updated>2009-11-15T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/11/youtube-gets-1080p</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;YouTube Gets 1080p&lt;/h3&gt;
  &lt;a href=&quot;http://youtube.com&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/11/youtubecap-640x281.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-11-15&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://youtube.com&quot;&gt;YouTube&lt;/a&gt; is the worlds largest online video site. They have been slow to the game when it comes to HD video but they seem to be trying to take the lead as of late. &lt;!--more--&gt;&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;YouTube now streams in up to 1080p. If you're interested in the quality check out this embed below.&lt;/p&gt;

&lt;object width=&quot;640&quot; height=&quot;385&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/qas5lWp7_R0&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;hd=1&quot; /&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot; /&gt;&lt;embed src=&quot;http://www.youtube.com/v/qas5lWp7_R0&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;hd=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;640&quot; height=&quot;385&quot;&gt;&lt;/embed&gt;&lt;/object&gt;


&lt;p&gt;You'll notice it takes some seriously fast internet to not have to let it buffer for a while, but it's not unbearable.They have certainly come a long way compared to the early days.&lt;/p&gt;

&lt;p&gt;This is a screencap of the compressed mess that is one of my early uploads.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/11/compressedvideoyoutube-640x385.jpg&quot; title=&quot;compressedvideoyoutube&quot; alt=&quot;compressedvideoyoutube&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Have you uploaded a 1080p video? Post a link to it in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Great CMYK Art</title>
   <link href="http://www.travisberry.com/2009/11/great-cmyk-art"/>
   <updated>2009-11-15T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/11/great-cmyk-art</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Great CMYK Art&lt;/h3&gt;
  &lt;a href=&quot;http://wow-dg.deviantart.com/art/cmyk-back-to-basics-42258028&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic3.travisberry.com/wp-content/uploads/2009/11/cmyklogo.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-11-15&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;There is a great post over at &lt;a href=&quot;http://www.printradar.com/2009/11/14/21-awesome-piece-of-digital-cmyk-art/&quot;&gt;PrintRadar&lt;/a&gt; highlighting some cool designs using CMYK as their color palate. There are some really stunning examples listed.&lt;!--more--&gt;&lt;/p&gt;

&lt;p&gt;A couple of my favorites are below.&lt;/p&gt;

&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;


&lt;p&gt;&lt;a href=&quot;http://cloning.deviantart.com/art/Fashion-victim-52491862&quot;&gt;Fashion victim by cloning&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://cloning.deviantart.com/art/Fashion-victim-52491862&quot;&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/11/cmyk_fashion_victim_by_cloning.jpg&quot; title=&quot;cmyk_fashion_victim_by_cloning&quot; alt=&quot;cmyk_fashion_victim_by_cloning&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://rajdesigns.deviantart.com/art/CMYK-Explosion-83455797&quot;&gt;CMYK Explosion by rajdesigns&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://rajdesigns.deviantart.com/art/CMYK-Explosion-83455797&quot;&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/11/cmyk_explosion_by_rajdesigns.jpg&quot; title=&quot;cmyk_explosion_by_rajdesigns&quot; alt=&quot;cmyk_explosion_by_rajdesigns&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Head over to &lt;a href=&quot;http://www.printradar.com/2009/11/14/21-awesome-piece-of-digital-cmyk-art/&quot;&gt;PrintRadar&lt;/a&gt; and check out the rest.Any other great CMYK art out there? Let me know in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>5 Handy Plugins for 5 Kick-Ass Free Apps</title>
   <link href="http://www.travisberry.com/2009/11/5-handy-plugins-for-5-kick-ass-free-apps"/>
   <updated>2009-11-15T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/11/5-handy-plugins-for-5-kick-ass-free-apps</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;5 Handy Plugins for 5 Kick-Ass Free Apps&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/villeneuve53/2191206080/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic2.travisberry.com/wp-content/uploads/2009/12/plugins.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-11-15&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;I'm a fan of open free technology. Not only is it useful but it's free. For beginning artists and designers, that's key. So here is a list of kick-ass free applications and some plugins that help extend their functionality.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Gimp is the closet alternative to photoshop there is. There are a few things it lacks, but that's where plugins fill in the gaps.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://registry.gimp.org/node/144&quot;&gt;Liquid Rescale&lt;/a&gt;: Content-aware rescaling. Keeps the features of the image while rescaling along a single direction.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.shallowsky.com/software/pandora/&quot;&gt;Pandora Stitch&lt;/a&gt;: together multiple images to make a panorama.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://registry.gimp.org/node/33&quot;&gt;SaveForWeb&lt;/a&gt;: Find optimal compromise between minimal file size and acceptable quality of image quickly&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://registry.gimp.org/node/104&quot;&gt;ISO Noise Reduction&lt;/a&gt;: Implements an ISO noise reduction&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://code.google.com/p/altcanvas/wiki/GimpPublishr&quot;&gt;GimpPublishr&lt;/a&gt;: Publish images to Picassa and Flickr directly from inside GIMP.&lt;/li&gt;
&lt;/ul&gt;


&lt;hr /&gt;

&lt;p&gt;Blender is my favorite 3D program and it works fine out of the box. It can do so much more though with the inclusion of a few plugins and add ons.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.harkyman.com/bp.html&quot;&gt;Blender People&lt;/a&gt;: Really cool animation script similar to Massive.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.selleri.org/Blender/&quot;&gt;Julia Fractals&lt;/a&gt;: Generate complex fractals.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.bchynds.com/?p=149&quot;&gt;Hynds|Studio Blender Fur Library Volume 1&lt;/a&gt;: Great collection of animal fur&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://wiki.blender.org/index.php/Extensions:Py/Scripts/Manual/Add/Add_Mesh_Gear&quot;&gt;add_mesh_Gears&lt;/a&gt;: Add a gear to your primitives&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://lsystem.liquidweb.co.nz/Downloads/tabid/118/Default.aspx&quot;&gt;L_system_Forest&lt;/a&gt;: Generate 3D, mesh based, trees.&lt;/li&gt;
&lt;/ul&gt;


&lt;hr /&gt;

&lt;p&gt;Inkscape is a fine alternative to illustrator. These plugins really make it shine.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://wiki.inkscape.org/wiki/index.php/ExtrudeEffect&quot;&gt;ExtrudeEffect&lt;/a&gt;: extrude polygons to &quot;3d&quot;, also make &quot;string art&quot;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.colivre.coop.br/bin/view/Aurium/InkscapeAreaCuter&quot;&gt;InkscapeAreaCutter&lt;/a&gt;: For Webdesigners, layout for sites, slice area into .png images&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.colivre.coop.br/Aurium/Puff&quot;&gt;Puff&lt;/a&gt;: Fluffs elements!Â :-D&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.ekips.org/comp/inkscape/&quot;&gt;Inkscape Effects&lt;/a&gt;: Aaron Spikes set of extensions is now included in Inkscape.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sites.google.com/site/placeonpath/&quot;&gt;Place Objects on Path&lt;/a&gt;:  This extension places objects on a curve.&lt;/li&gt;
&lt;/ul&gt;


&lt;hr /&gt;

&lt;p&gt;Firefox, the little browser that could. Firefox has ballooned in user size over the years and for good reason. It's solid and has a giant collections of plugins. These are my personal favorites.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://getfirebug.com/&quot;&gt;firebug:&lt;/a&gt; View and edit html, css, and numerous other things. Must have for web designers.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://adblockplus.org/en/&quot;&gt;Adblockplus&lt;/a&gt;: I remember how ad infested the internet is when I surf without this.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://noscript.net/&quot;&gt;Noscript:&lt;/a&gt; Don't get infected by visiting less than legitimate sites.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/3615&quot;&gt;delicious bookmarks&lt;/a&gt;: Delicious keeps all my book marks sync across multiple computers.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/748&quot;&gt;Greasemonkey&lt;/a&gt;: Greasemokey allows you to run custom scripts on websites to improve their functionality.&lt;/li&gt;
&lt;/ul&gt;


&lt;hr /&gt;

&lt;p&gt;Wordpress is my web framework of choice. It's easy to use and best of all it's free. Like firefox, there is a giant plugin developer scene. I install these plguins on every site.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://wordpress.org/extend/plugins/all-in-one-seo-pack/&quot;&gt;all in one seo&lt;/a&gt;: Makes handling meta information a breeze.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://wordpress.org/extend/plugins/login-lockdown/&quot;&gt;login lockdown&lt;/a&gt;: Prevent brute force password attacks&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://wordpress.org/extend/plugins/wp-super-cache/&quot;&gt;wp super cache&lt;/a&gt;: dont crash your server if you hit the front page of digg. This serves static html instead of running php processes.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://wordpress.org/extend/plugins/wp-optimize/&quot;&gt;wp optimize&lt;/a&gt;: Post revisions and plugin options can make your database grow to unwieldy sizes. Use this to keep it clean.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://wordpress.org/extend/plugins/wp-db-backup/&quot;&gt;wp database backup&lt;/a&gt;: Speaking of databases, they are the heart and soul of your website. Keep yours safe with automatic back ups emailed to you.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;What plugins do you use the most? Let me know in the comments.
&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Setting Up Quicktime Streaming</title>
   <link href="http://www.travisberry.com/2009/11/setting-up-quicktime-streaming"/>
   <updated>2009-11-14T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/11/setting-up-quicktime-streaming</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Setting Up Quicktime Streaming&lt;/h3&gt;
  &lt;a href=&quot;http://www.flickr.com/photos/mwichary/2319091169/&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic1.travisberry.com/wp-content/uploads/2009/12/seriesoftubes.jpg&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-11-14&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;I usually use a third-party service such as &lt;a href=&quot;http://vimeo.com&quot;&gt;vimeo&lt;/a&gt; to host and stream my video. However, after moving to my new awesome host, &lt;a href=&quot;http://www.dreamhost.com/&quot;&gt;DreamHost&lt;/a&gt;, I discovered that they had an option to enable quicktime streaming. I poked around the support wiki and decided to test it out. &lt;!--more--&gt;&lt;/p&gt;

&lt;p&gt;The process to setup is super simple. Click on the media streaming panel in your dashboard and pick a streaming sub domain. Give it a little while to setup and that's it.&lt;/p&gt;

&lt;p&gt;DreamHost creates a folder on your server to upload your .mov files into. They also generate a new url that will look something like rtsp://your_streaming_subdomain.com:554/your_streaming_subdomain.com/movie.mov&lt;/p&gt;

&lt;p&gt;You take this url and use an &amp;lt;object&amp;gt; code to embed the movie in a page.&lt;/p&gt;

&lt;p&gt;The final code looks something like this&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176830.js?file=quicktime.html'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;OBJECT CLASSID=&amp;quot;clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B&amp;quot; WIDTH=&amp;quot;320&amp;quot; HEIGHT=&amp;quot;240&amp;quot; CODEBASE=&amp;quot;http://www.apple.com/qtactivex/qtplugin.cab&amp;quot;&amp;gt;
    &amp;lt;PARAM name=&amp;quot;SRC&amp;quot; VALUE=&amp;quot;poster.mov&amp;quot;&amp;gt;
    &amp;lt;PARAM name=&amp;quot;QTSRC&amp;quot; VALUE=&amp;quot;rtsp://your_streaming_subdomain.com:554/your_streaming_subdomain.com/movie.mov&amp;quot;&amp;gt;
    &amp;lt;PARAM name=&amp;quot;AUTOPLAY&amp;quot; VALUE=&amp;quot;true&amp;quot;&amp;gt;
    &amp;lt;PARAM name=&amp;quot;CONTROLLER&amp;quot; VALUE=&amp;quot;false&amp;quot;&amp;gt;
    &amp;lt;embed src=&amp;quot;poster.mov&amp;quot; qtsrc=&amp;quot;rtsp://your_streaming_subdomain.com:554/your_streaming_subdomain.com/movie.mov&amp;quot; width=&amp;quot;320&amp;quot; height=&amp;quot;240&amp;quot; target=&amp;quot;myself&amp;quot; controller=&amp;quot;false&amp;quot; autoplay=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;/embed&amp;gt;
&amp;lt;/OBJECT&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;Here is my first test at an embeded .mov file streamed off a quicktime server.&lt;/p&gt;

&lt;object classid=&quot;clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B&quot; codebase=&quot;http://www.apple.com/qtactivex/qtplugin.cab&quot; height=&quot;376&quot; width=&quot;640&quot;&gt;&lt;param name=&quot;src&quot; value=&quot;http://oldstatic.travisberry.com/videos/Comp51_3.mov&quot; /&gt;&lt;param name=&quot;autoplay&quot; value=&quot;false&quot; /&gt;&lt;param name=&quot;type&quot; value=&quot;video/quicktime&quot; height=&quot;376&quot; width=&quot;640&quot; /&gt;&lt;embed src=&quot;http://oldstatic.travisberry.com/videos/Comp51_3.mov&quot; height=&quot;376&quot; width=&quot;640&quot; autoplay=&quot;false&quot; type=&quot;video/quicktime&quot; pluginspage=&quot;http://www.apple.com/quicktime/download/&quot; /&gt;&lt;/object&gt;


&lt;p&gt;You may have noticed that this is in fact not embedded with the code above. I couldn't get it to work. I used this code -&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176830.js?file=quicktime2.html'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;object classid=&amp;quot;clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B&amp;quot; codebase=&amp;quot;http://www.apple.com/qtactivex/qtplugin.cab&amp;quot; height=&amp;quot;376&amp;quot; width=&amp;quot;640&amp;quot;&amp;gt;
    &amp;lt;param name=&amp;quot;src&amp;quot; value=&amp;quot;http://www.travisberry.com/videos/Comp51_3.mov&amp;quot; /&amp;gt;
    &amp;lt;param name=&amp;quot;autoplay&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&amp;lt;param name=&amp;quot;type&amp;quot; value=&amp;quot;video/quicktime&amp;quot; height=&amp;quot;376&amp;quot; width=&amp;quot;640&amp;quot; /&amp;gt;
    &amp;lt;embed src=&amp;quot;http://www.travisberry.com/videos/Comp51_3.mov&amp;quot; height=&amp;quot;376&amp;quot; width=&amp;quot;640&amp;quot; autoplay=&amp;quot;false&amp;quot; type=&amp;quot;video/quicktime&amp;quot; pluginspage=&amp;quot;http://www.apple.com/quicktime/download/&amp;quot; /&amp;gt;
&amp;lt;/object&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;This may be caused by numerous things. I will continue to update as I tinker around with a solution. However, a regular quicktime embed does seem to move a little faster but that could be in my head.&lt;/p&gt;

&lt;p&gt;I'm up in the air as to stay with flash video or move to hosted quicktime. There are upsides and downsides to both.&lt;/p&gt;

&lt;p&gt;If you have any thoughts about which is the better way to go, let me know in the comments.
&lt;article&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Creating Navigation Highlights</title>
   <link href="http://www.travisberry.com/2009/11/creating-navigation-highlights"/>
   <updated>2009-11-13T00:00:00-07:00</updated>
   <id>http://www.travisberry.com/2009/11/creating-navigation-highlights</id>
   <content type="html">&lt;p&gt;&lt;article class=&quot;post clearfix&quot;&gt;
  &lt;h3&gt;Creating Navigation Highlights&lt;/h3&gt;
  &lt;a href=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/12/Course_and_Bearing_Navigation.png&quot; class=&quot;postImageLink&quot;&gt;&lt;img src=&quot;http://oldstatic.travisberry.com/wp-content/uploads/2009/12/Course_and_Bearing_Navigation.png&quot; alt=&quot;&quot; class=&quot;thumbnail alignleft&quot; width=640  /&gt;&lt;/a&gt;
  &lt;h6&gt;Published: 2009-11-13&lt;/h6&gt;&lt;/p&gt;

&lt;p&gt;When creating this site I decided I wanted to have the navigation bar have a different color highlight the current page. I dived in thinking it would be a simple problem. Turns out I was wrong.&lt;!--more--&gt;&lt;/p&gt;

&lt;p&gt;It's not impossible but it's not easy. As you can see above, I eventually got it to work. &lt;a href=&quot;http://www.vanseodesign.com/wordpress/hightlight-current-page-wordpress/&quot;&gt;This article&lt;/a&gt; was of immense help. Just follow along and hope for the best.&lt;/p&gt;

&lt;p&gt;One final tip, if your home page is different from the blog page, use the is_page('originalpagename') not is_home() and use is_home() for the blog page. Update: This is the code I used for those interested.&lt;/p&gt;

&lt;div class=&quot;gistFallback&quot;&gt;
&lt;script src='https://gist.github.com/1176823.js?file=highlightedNav.php'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;ul&amp;gt;
    &amp;lt;li&amp;lt;?php if ( is_page('about') || is_404() ){ echo ' class=&amp;quot;current_page_item&amp;quot; ';}?&amp;gt;&amp;gt;&amp;lt;a href=&amp;quot;&amp;lt;?php echo get_option('home'); ?&amp;gt;/&amp;quot;&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
    &amp;lt;li&amp;lt;?php if ( is_home() || is_page('blog')|| is_single() || is_search() || is_archive()) { echo ' class=&amp;quot;current_page_item&amp;quot;'; } ?&amp;gt;&amp;gt;&amp;lt;a href=&amp;quot;&amp;lt;?php bloginfo('url'); ?&amp;gt;/blog/&amp;quot;&amp;gt;Blog&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
    &amp;lt;li&amp;lt;?php if ( is_page('work') || is_page('video') || is_page('web')) { echo ' class=&amp;quot;current_page_item&amp;quot;'; } ?&amp;gt;&amp;gt;&amp;lt;a href=&amp;quot;&amp;lt;?php bloginfo('url'); ?&amp;gt;/work/&amp;quot;&amp;gt;Work&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
    &amp;lt;li&amp;lt;?php if ( is_page('contact')) { echo ' class=&amp;quot;current_page_item&amp;quot;'; } ?&amp;gt;&amp;gt;&amp;lt;a href=&amp;quot;&amp;lt;?php bloginfo('url'); ?&amp;gt;/contact/&amp;quot;&amp;gt;Contact&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;/div&gt;


&lt;p&gt;&lt;/article&gt;&lt;/p&gt;
</content>
 </entry>
 
 
</feed>