<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Van Dev - Home</title>
  <id>tag:vandev.com,2008:mephisto/</id>
  <generator uri="http://mephistoblog.com" version="0.7.3">Mephisto Noh-Varr</generator>
  <link href="http://vandev.com/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://vandev.com/" rel="alternate" type="text/html"/>
  <updated>2008-04-22T09:02:12Z</updated>
  <entry xml:base="http://vandev.com/">
    <author>
      <name>vanpelt</name>
    </author>
    <id>tag:vandev.com,2008-04-22:4651</id>
    <published>2008-04-22T08:29:00Z</published>
    <updated>2008-04-22T09:02:12Z</updated>
    <category term="Javascript"/>
    <category term="Programming"/>
    <category term="Tutorials"/>
    <category term="awesome"/>
    <category term="form"/>
    <category term="jsawesome"/>
    <category term="mootools"/>
    <link href="http://vandev.com/2008/4/22/jsawesome" rel="alternate" type="text/html"/>
    <title>JSAwesome</title>
<summary type="html">&lt;p&gt;Wow, what ever happened to Chris the crazy blogger?  I think he wants to make a come back&#8230;  &lt;/p&gt;

&lt;p&gt;Here&#8217;s the deal, I left &lt;a href=&quot;http://powerset.com&quot;&gt;Powerset&lt;/a&gt; at the beginning of the year to co-found an amazing &lt;a href=&quot;http://doloreslabs.com&quot;&gt;company&lt;/a&gt;.  I&#8217;ve been able to create some really cool stuff with this company, the most recent being &lt;a href=&quot;http://facestat.com&quot;&gt;FaceStat&lt;/a&gt;.  I&#8217;ve also been dating an incredible &lt;a href=&quot;http://flickr.com/photos/vanpelt/2059081220/&quot;&gt;Serbian&lt;/a&gt;, but enough personal life excuses for low blog activity, onto the juicy nerd crap.&lt;/p&gt;

&lt;p&gt;A pretty cool project I&#8217;ve had a chance to work on recently is a little something I like to call &lt;a href=&quot;http://github.com/vanpelt/jsawesome/tree/master&quot;&gt;JSAwesome&lt;/a&gt; as in JSON + Awesome.  What does it do?  It likes Rails form helpers written in Javascript but 13.5 times better&#8230;  Read on for the full scoop.&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;Wow, what ever happened to Chris the crazy blogger?  I think he wants to make a come back&#8230;  &lt;/p&gt;

&lt;p&gt;Here&#8217;s the deal, I left &lt;a href=&quot;http://powerset.com&quot;&gt;Powerset&lt;/a&gt; at the beginning of the year to co-found an amazing &lt;a href=&quot;http://doloreslabs.com&quot;&gt;company&lt;/a&gt;.  I&#8217;ve been able to create some really cool stuff with this company, the most recent being &lt;a href=&quot;http://facestat.com&quot;&gt;FaceStat&lt;/a&gt;.  I&#8217;ve also been dating an incredible &lt;a href=&quot;http://flickr.com/photos/vanpelt/2059081220/&quot;&gt;Serbian&lt;/a&gt;, but enough personal life excuses for low blog activity, onto the juicy nerd crap.&lt;/p&gt;

&lt;p&gt;A pretty cool project I&#8217;ve had a chance to work on recently is a little something I like to call &lt;a href=&quot;http://github.com/vanpelt/jsawesome/tree/master&quot;&gt;JSAwesome&lt;/a&gt; as in JSON + Awesome.  What does it do?  It likes Rails form helpers written in Javascript but 13.5 times better&#8230;  Read on for the full scoop.&lt;/p&gt;
&lt;p&gt;Here is a sample call to JSAwesome:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;new JSAwesome('an_id',[
      ['text_field', 'default value'],
      ['#text_area', ''],
      ['_hidden_input','i_am_invisible'],
      ['*radios', ['so|nice', 'many', 'radio|boxes', 'yeah']],
      [['^checkbox', true], '^not'],
      ['^choices', ['Choice 1|one', 'Choice 2|two', ['Choice 3|three', true]]],
      ['single_select', ['boo', '~yah']],
      ['nested_select', 
     {'rad': ['cool', 'neat'], 
      'awesome':
        {'crazy': ['Indeed|~shit', 'man'],
         'way': ['oh', 'yeah']}
     }]]).to_html()&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This generates this form (&lt;em&gt;choose &lt;code&gt;awesome&lt;/code&gt;, than &lt;code&gt;crazy&lt;/code&gt;, than &lt;code&gt;Indeed&lt;/code&gt; from the set of select boxes at the bottom of the form to have your mind blown&lt;/em&gt;)
&amp;lt;style&gt;
label { display:block; margin-top:5px }&lt;br /&gt;
&amp;lt;/style&gt;
&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;With this markup:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;&amp;lt;div id=&amp;quot;an_id&amp;quot;&amp;gt;
  &amp;lt;div class=&amp;quot;error text_field&amp;quot;&amp;gt;
    &amp;lt;label for=&amp;quot;an_id_text_field&amp;quot;&amp;gt;Text field&amp;lt;/label&amp;gt; &amp;lt;input id=&amp;quot;an_id_text_field&amp;quot; class=&amp;quot;text_field&amp;quot; type=&amp;quot;text&amp;quot; name=&amp;quot;an_id[text_field]&amp;quot;&amp;gt;
  &amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;error text_area&amp;quot;&amp;gt;
    &amp;lt;label for=&amp;quot;an_id_text_area&amp;quot;&amp;gt;Text area&amp;lt;/label&amp;gt; &amp;lt;textarea id=&amp;quot;an_id_text_area&amp;quot; class=&amp;quot;text_area&amp;quot; name=&amp;quot;an_id[text_area]&amp;quot;&amp;gt;
  &amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;error hidden_input&amp;quot;&amp;gt;
    &amp;lt;input id=&amp;quot;an_id_hidden_input&amp;quot; class=&amp;quot;hidden_input&amp;quot; type=&amp;quot;hidden&amp;quot; name=&amp;quot;an_id[hidden_input]&amp;quot; value=&amp;quot;i_am_invisible&amp;quot;&amp;gt;
  &amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;error radios&amp;quot;&amp;gt;
    &amp;lt;fieldset&amp;gt;
      &amp;lt;legend&amp;gt;Radios&amp;lt;/legend&amp;gt; 
      &amp;lt;label for=&amp;quot;an_id_radios&amp;quot;&amp;gt;
          &amp;lt;input id=&amp;quot;&amp;quot; class=&amp;quot;radios&amp;quot; type=&amp;quot;radio&amp;quot; name=&amp;quot;an_id[radios]&amp;quot; value=&amp;quot;nice&amp;quot;&amp;gt; So&amp;lt;/label&amp;gt; 
       &amp;lt;label for=&amp;quot;an_id_radios&amp;quot;&amp;gt;
          &amp;lt;input id=&amp;quot;&amp;quot; class=&amp;quot;radios&amp;quot; type=&amp;quot;radio&amp;quot; name=&amp;quot;an_id[radios]&amp;quot; value=&amp;quot;many&amp;quot;&amp;gt; Many&amp;lt;/label&amp;gt; 
       &amp;lt;label for=&amp;quot;an_id_radios&amp;quot;&amp;gt;
          &amp;lt;input id=&amp;quot;&amp;quot; class=&amp;quot;radios&amp;quot; type=&amp;quot;radio&amp;quot; name=&amp;quot;an_id[radios]&amp;quot; value=&amp;quot;boxes&amp;quot;&amp;gt; Radio&amp;lt;/label&amp;gt; 
       &amp;lt;label for=&amp;quot;an_id_radios&amp;quot;&amp;gt;
          &amp;lt;input id=&amp;quot;&amp;quot; class=&amp;quot;radios&amp;quot; type=&amp;quot;radio&amp;quot; name=&amp;quot;an_id[radios]&amp;quot; value=&amp;quot;yeah&amp;quot;&amp;gt; Yeah&amp;lt;/label&amp;gt;
    &amp;lt;/fieldset&amp;gt;
  &amp;lt;/div&amp;gt;
   &amp;lt;div class=&amp;quot;error row_5&amp;quot;&amp;gt;
      &amp;lt;div style=&amp;quot;float: left; margin-right: 5px;&amp;quot;&amp;gt;
        &amp;lt;label for=&amp;quot;an_id_checkbox&amp;quot;&amp;gt;
           &amp;lt;span&amp;gt;
              &amp;lt;input id=&amp;quot;an_id_real_cool&amp;quot; class=&amp;quot;real_cool&amp;quot; type=&amp;quot;checkbox&amp;quot; name=&amp;quot;an_id[checkbox]&amp;quot; value=&amp;quot;true&amp;quot;&amp;gt; 
              &amp;lt;input id=&amp;quot;an_id_real_cool&amp;quot; class=&amp;quot;real_cool&amp;quot; type=&amp;quot;hidden&amp;quot; name=&amp;quot;an_id[checkbox]&amp;quot; value=&amp;quot;false&amp;quot;&amp;gt;
           &amp;lt;/span&amp;gt; Checkbox&amp;lt;/label&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;div style=&amp;quot;float: left; margin-right: 5px;&amp;quot;&amp;gt;
        &amp;lt;label for=&amp;quot;an_id_not&amp;quot;&amp;gt;
            &amp;lt;span&amp;gt;
                &amp;lt;input id=&amp;quot;an_id_not&amp;quot; class=&amp;quot;not&amp;quot; type=&amp;quot;checkbox&amp;quot; name=&amp;quot;an_id[not]&amp;quot; value=&amp;quot;true&amp;quot;&amp;gt; 
                &amp;lt;input id=&amp;quot;an_id_not&amp;quot; class=&amp;quot;not&amp;quot; type=&amp;quot;hidden&amp;quot; name=&amp;quot;an_id[not]&amp;quot; value=&amp;quot;false&amp;quot;&amp;gt;
             &amp;lt;/span&amp;gt; Not&amp;lt;/label&amp;gt;
      &amp;lt;/div&amp;gt;&amp;lt;br style=&amp;quot;clear: left;&amp;quot;&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;div class=&amp;quot;error choices&amp;quot;&amp;gt;
      &amp;lt;fieldset&amp;gt;
        &amp;lt;legend&amp;gt;Choices&amp;lt;/legend&amp;gt; 
            &amp;lt;label for=&amp;quot;an_id_one&amp;quot;&amp;gt;
               &amp;lt;span&amp;gt;
                  &amp;lt;input id=&amp;quot;an_id_one&amp;quot; class=&amp;quot;one&amp;quot; type=&amp;quot;checkbox&amp;quot; name=&amp;quot;an_id[one]&amp;quot; value=&amp;quot;true&amp;quot;&amp;gt; 
                  &amp;lt;input id=&amp;quot;an_id_one&amp;quot; class=&amp;quot;one&amp;quot; type=&amp;quot;hidden&amp;quot; name=&amp;quot;an_id[one]&amp;quot; value=&amp;quot;false&amp;quot;&amp;gt;
               &amp;lt;/span&amp;gt; Choice 1&amp;lt;/label&amp;gt; 
             &amp;lt;label for=&amp;quot;an_id_two&amp;quot;&amp;gt;
               &amp;lt;span&amp;gt;
                  &amp;lt;input id=&amp;quot;an_id_two&amp;quot; class=&amp;quot;two&amp;quot; type=&amp;quot;checkbox&amp;quot; name=&amp;quot;an_id[two]&amp;quot; value=&amp;quot;true&amp;quot;&amp;gt; 
                  &amp;lt;input id=&amp;quot;an_id_two&amp;quot; class=&amp;quot;two&amp;quot; type=&amp;quot;hidden&amp;quot; name=&amp;quot;an_id[two]&amp;quot; value=&amp;quot;false&amp;quot;&amp;gt;
               &amp;lt;/span&amp;gt; Choice 2&amp;lt;/label&amp;gt; 
            &amp;lt;label for=&amp;quot;an_id_three&amp;quot;&amp;gt;
                &amp;lt;span&amp;gt;
                    &amp;lt;input id=&amp;quot;an_id_three&amp;quot; class=&amp;quot;three&amp;quot; type=&amp;quot;checkbox&amp;quot; name=&amp;quot;an_id[three]&amp;quot; value=&amp;quot;true&amp;quot;&amp;gt;
                    &amp;lt;input id=&amp;quot;an_id_three&amp;quot; class=&amp;quot;three&amp;quot; type=&amp;quot;hidden&amp;quot; name=&amp;quot;an_id[three]&amp;quot; value=&amp;quot;false&amp;quot;&amp;gt;
                &amp;lt;/span&amp;gt; Choice 3&amp;lt;/label&amp;gt;
      &amp;lt;/fieldset&amp;gt;
    &amp;lt;/div&amp;gt;
   &amp;lt;div class=&amp;quot;error single_select&amp;quot;&amp;gt;
      &amp;lt;label for=&amp;quot;an_id_single_select&amp;quot;&amp;gt;Single select&amp;lt;/label&amp;gt;
          &amp;lt;select id=&amp;quot;an_id_single_select&amp;quot; class=&amp;quot;single_select&amp;quot; name=&amp;quot;an_id[single_select]&amp;quot;&amp;gt;
              &amp;lt;option value=&amp;quot;&amp;quot;&amp;gt;Choose Category&amp;lt;/option&amp;gt;
              &amp;lt;option value=&amp;quot;boo&amp;quot;&amp;gt;boo&amp;lt;/option&amp;gt;
              &amp;lt;option value=&amp;quot;yah&amp;quot;&amp;gt;yah&amp;lt;/option&amp;gt;
           &amp;lt;/select&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;error nested_select&amp;quot;&amp;gt;
    &amp;lt;label for=&amp;quot;an_id_nested_select&amp;quot;&amp;gt;Sub cats&amp;lt;/label&amp;gt; &amp;lt;select id=&amp;quot;an_id_nested_select&amp;quot; class=&amp;quot;nested_select&amp;quot; name=&amp;quot;an_id[nested_select]&amp;quot;&amp;gt;
      &amp;lt;option value=&amp;quot;&amp;quot;&amp;gt;
        Choose Category
      &amp;lt;/option&amp;gt;
      &amp;lt;option value=&amp;quot;rad&amp;quot;&amp;gt;
        rad
      &amp;lt;/option&amp;gt;
      &amp;lt;option value=&amp;quot;awesome&amp;quot;&amp;gt;
        awesome
      &amp;lt;/option&amp;gt;
    &amp;lt;/select&amp;gt; &amp;lt;select id=&amp;quot;an_id_nested_select_1&amp;quot; class=&amp;quot;nested_select_1&amp;quot; name=&amp;quot;an_id[nested_select_1]&amp;quot;&amp;gt;
      &amp;lt;option value=&amp;quot;&amp;quot;&amp;gt;
        Choose Subcategory
      &amp;lt;/option&amp;gt;
    &amp;lt;/select&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Wow, lot&#8217;s of HTML from a little JSON.  Let&#8217;s do an overview of the parameters.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The first parameter to JSAwesome is an id of an element already in the DOM.  It also acts as a namespace for the names and id&#8217;s of form elements to allow for multiple JSAwesome forms on a page.  Looking at the html you can see you have plenty of classes added as well to style your generated form to your hearts content.&lt;/li&gt;
&lt;li&gt;The second parameter is an array of tuples specifying the form elements in order.  The tuples can create the following elements using these rules:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;textfield&lt;/strong&gt; - the first element is the name with no special character and the second element is a string with the default value&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;textarea&lt;/strong&gt; - the first element is the name beginning with a &lt;code&gt;#&lt;/code&gt; and the second element is a string with the default value&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;hidden&lt;/strong&gt; - the first element is the name beginning with a &lt;code&gt;_&lt;/code&gt; and the second element is the value&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;radio&lt;/strong&gt; - the first element is the legend of a fieldset / name of the radio buttons beginning with a &lt;code&gt;*&lt;/code&gt; and the second element is an array of names.  Optionally you can specify label / name pairs separated by the &lt;code&gt;|&lt;/code&gt; character.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;checkbox&lt;/strong&gt; - the first element is the name and label of a checkbox beginning with a &lt;code&gt;^&lt;/code&gt; character.  If a second element is present, the checkbox will be checked.  The example above also demonstrates the ability to group fields together on the same line.  If you use an array of tuples, &lt;em&gt;or in this case checkboxes can be specfied with a single string if the you don&#8217;t want it checked&lt;/em&gt;, those elements will be wrapped in div&#8217;s with the style set to &#8216;float:left&#8217;.  Optionally label / name pairs work the same as radio&#8217;s.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;checkbox group&lt;/strong&gt; - the first element is the legend of a fieldset and the second is an array of checkboxes as described above&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;single select&lt;/strong&gt; - the first element is the name of the select and the second is an array of options.  Optionally the options can specify name / value pairs separated by the &lt;code&gt;|&lt;/code&gt; character.  You can also use the &#8216;~&#8217; character to specify a custom input.  When this option is selected a textfield will appear to allow the user to enter a custom value.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;nested select&lt;/strong&gt; - the first element is the name of the select.  The second element is a hash with the keys being the options and the values being hashes or arrays of the child selects.  Optionally name / value pairs and custom inputs work the same as single selects.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;But there&#8217;s more.  JSAwesome takes a third parameter which gives you custom labels and validations.  This use case might look like this:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;var test = new JSAwesome('validated',[
      ['text_field', 'default value'],
      ['#text_area', ''],
      ['single_select', ['boo', '~yah']]
      ], 
      {'text_field': &amp;quot;JSAwesome&amp;quot;,
       'text_area': {
          'required':true,
          'validation': [&amp;quot;\\d+&amp;quot;, &amp;quot;Field must contain atleast one digit&amp;quot;],
          'label': &amp;quot;Input some text with atleast one digit&amp;quot;
       },
       'single_select': {
          'required':true
       },
       '~': 'Custom instructions',
       '{}': ['Select something']
   })
   test.to_html()
   test.addValidation()&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Which generates this form:&lt;/p&gt;

&lt;p&gt;&amp;lt;form&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&amp;lt;input /&gt;&amp;lt;/form&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bam&lt;/strong&gt;, is your mind completely blown yet?  Here&#8217;s an overview of the 3rd parameter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The keys to the hash are either names of elements in the form (&lt;em&gt;without the special characters&lt;/em&gt;) or one of two special global names &lt;code&gt;~&lt;/code&gt; or &lt;code&gt;{}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The values of the hash are either a string or another hash.  If it&#8217;s a string, it represents the label for the element specifed.  If it&#8217;s a hash you can specify all or one of the following:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;required&lt;/strong&gt; - a boolean specifying whether the field is required. &lt;em&gt;if it is used for a radio or checkbox group it will require atleast one radio button to be clicked&lt;/em&gt;.  It can also be used alongside of &lt;strong&gt;validation&lt;/strong&gt; to make a text input field both required and validated&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;validation&lt;/strong&gt; - a tuple with the first element being a javascript RegEx string.  The second is a message to be displayed on failure&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;label&lt;/strong&gt; - the label, just as if you had given only a string, but can be used alongside required and validation&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;If the key is &lt;code&gt;~&lt;/code&gt; this specifies the value to be used in custom fields as opposed to the default &#8216;Custom&#8230;&#8217; (&lt;em&gt;choose &#8216;yah&#8217; from the select box above&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;If the key is &lt;code&gt;{}&lt;/code&gt; the value is a tuple with the first element being the default value for the root select element, and the optional second parameter being the default for any sub-selects.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So there you have it.  JSAwesome in a nutshell.  We use this library over at &lt;a href=&quot;http://doloreslabs.com&quot;&gt;Dolores Labs&lt;/a&gt; for easily creating dynamic forms for all of our &lt;a href=&quot;http://blog.doloreslabs.com&quot;&gt;experiments&lt;/a&gt;.  It beats the crap out of writing HTML forms manually and makes our tasks load a lot faster.  We also get validation for free.  It currently requires mootools 1.2b, which is packed with the &lt;a href=&quot;http://github.com/vanpelt/jsawesome/tree/master&quot;&gt;project&lt;/a&gt;. Fork away!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://vandev.com/">
    <author>
      <name>vanpelt</name>
    </author>
    <id>tag:vandev.com,2007-10-30:3325</id>
    <published>2007-10-30T08:01:00Z</published>
    <updated>2007-10-30T23:20:28Z</updated>
    <category term="Funny"/>
    <category term="The Rest"/>
    <category term="animated"/>
    <category term="dance"/>
    <category term="gif"/>
    <link href="http://vandev.com/2007/10/30/6-monthes-not-bad" rel="alternate" type="text/html"/>
    <title>6.5 months... not bad</title>
<content type="html">
            &lt;p&gt;Hmmm, well I don&#8217;t know what to say.  This will have to do until I come up with something&#8230;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://vandev.com/assets/2007/10/30/dance.gif&quot; alt=&quot;Dance baby dance&quot; /&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://vandev.com/">
    <author>
      <name>vanpelt</name>
    </author>
    <id>tag:vandev.com,2007-04-16:2796</id>
    <published>2007-04-16T08:45:00Z</published>
    <updated>2008-04-21T03:53:25Z</updated>
    <category term="Javascript"/>
    <category term="Programming"/>
    <category term="Tutorials"/>
    <category term="croppr"/>
    <category term="dom"/>
    <category term="javascript"/>
    <category term="mootools"/>
    <category term="tutorial"/>
    <link href="http://vandev.com/2007/4/16/inside-the-croppr-frontend" rel="alternate" type="text/html"/>
    <title>Inside the Croppr frontend</title>
<content type="html">
            &lt;p&gt;I learned allot creating &lt;a href=&quot;http://vandev.com/croppr&quot;&gt;croppr&lt;/a&gt;.  It&#8217;s pretty intersting what you can do with the DOM and some CSS.  Let&#8217;s take a peek under the hood.  &lt;/p&gt;

&lt;p&gt;The first thing croppr does upon instantiation is create a bunch of DOM elements.  Here&#8217;s what that looks like.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;#&quot;&gt;Toggle Styles&lt;/a&gt;&lt;/p&gt;

&lt;div&gt;
&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;&amp;lt;div style=&amp;quot;background: white;
            position: absolute;
            top: 0px; left: 0px;
            width: 100%; height: 545px;
            opacity: 0.8;&amp;quot;/&amp;gt; 
&amp;lt;div id=&amp;quot;croppr&amp;quot; style=&amp;quot;overflow: hidden;
                        position: absolute;
                        top: 0px; left: 0px;
                        width: 100%; height: 545px;&amp;quot;&amp;gt;                  
  &amp;lt;div style=&amp;quot;border: 1px solid #000000;
              overflow: hidden;
              position: absolute;
              top: 50%; left: 50%;
              width: 118px; height: 118px;
              margin-top: -60px; margin-left: -60px;&amp;quot;&amp;gt;
    &amp;lt;img src=&amp;quot;/croppr/images/1&amp;quot; style=&amp;quot;cursor: move;
                                       position: absolute;
                                       top: 50%; left: 50%;
                                       margin-top: -272px; margin-left: -357px;
                                       width: 714px; height: 544px;
                                       opacity: 1;&amp;quot;/&amp;gt;
  &amp;lt;/div&amp;gt;
  &amp;lt;img src=&amp;quot;/croppr/images/1&amp;quot; style=&amp;quot;cursor: move;
                                     position: absolute;
                                     top: 50%; left: 50%;
                                     margin-top: -272px; margin-left: -357px;
                                     width: 714px; height: 544px;
                                     opacity: 0.3;&amp;quot;/&amp;gt;
  &amp;lt;a class=&amp;quot;exit&amp;quot;&amp;gt;
    &amp;lt;span&amp;gt;EXIT&amp;lt;/span&amp;gt;
  &amp;lt;/a&amp;gt;
  &amp;lt;a class=&amp;quot;crop&amp;quot;&amp;gt;
    &amp;lt;span&amp;gt;CROP&amp;lt;/span&amp;gt;
  &amp;lt;/a&amp;gt;
  &amp;lt;div class=&amp;quot;track&amp;quot;&amp;gt;
    &amp;lt;div class=&amp;quot;handle&amp;quot; style=&amp;quot;cursor: move;
                               position: relative;
                               left: 154.312px;&amp;quot;/&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;#the_styles&quot;&gt;Toggle&lt;/a&gt; the styles to understand what&#8217;s going on here.  The first element is the transparency or &#8220;light box&#8221; that dims whatever else is on the screen (&lt;em&gt;trans&lt;/em&gt;).  The order of the elements is important.  We want the transparency to be all the way in the back.   Elements later in the DOM that are absolutely positioned will be infront of previous absolutely positioned elements (unless we  set the z-index property). &lt;/p&gt;

&lt;p&gt;The next element is our container for all the fun goodies we&#8217;re about to add (&lt;em&gt;container&lt;/em&gt;).  It serves three purposes.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;em&gt;Makes cleanup easy.&lt;/em&gt;  By deleting this element, all the others will disappear.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Namespaces the rest of our elements.&lt;/em&gt;  You can target &lt;code&gt;#croppr .exit&lt;/code&gt; in your CSS without effecting other elements with the class of &lt;code&gt;exit&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Get&#8217;s rid of vertical and horizontal scroll bars.&lt;/em&gt;  By setting &lt;code&gt;overflow:hidden&lt;/code&gt; when the image we are cropping goes outside of the window, the browser doesn&#8217;t add scrollbars and screw up our math.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The transparent box is not placed in this div because we want a nice fade back into the original environment after we have deleted all of the cropping tools.  More on this in a little bit.&lt;/p&gt;

&lt;p&gt;Next we have the mask.  The width and height of the mask is set to the width and height of the desired crop - 2.  We subtract two because it has a 1 pixel border and the box model includes the border in the width and height.  A copy of the main image (&lt;em&gt;ghost&lt;/em&gt;) is put inside of the mask.  &lt;code&gt;overflow:hidden&lt;/code&gt; is set on the mask as well, making the parts outside of it invisible.  Both the mask and the ghost are positioned absolutely and have &lt;code&gt;top&lt;/code&gt; and &lt;code&gt;left&lt;/code&gt; attributes set to 50%.  We then give them negative &lt;code&gt;top&lt;/code&gt; and &lt;code&gt;left&lt;/code&gt; margins.  The mask&#8217;s margin&#8217;s will always be half of its width and height, while the ghost&#8217;s margins are based on it&#8217;s current position.  This puts the work of keeping the items centered if the window resizes in the hands of the browser.  All of this is done rather elegantly with mootools:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;this.mask = new Element(&amp;quot;div&amp;quot;).setStyles({
      border: &amp;quot;1px solid #000&amp;quot;,
      overflow: &amp;quot;hidden&amp;quot;,
      position: &amp;quot;absolute&amp;quot;,
      width: this.options.crop[0]-2+&amp;quot;px&amp;quot;,
      height: this.options.crop[1]-2+&amp;quot;px&amp;quot;,
      top: &amp;quot;50%&amp;quot;,
      left: &amp;quot;50%&amp;quot;, 
      marginTop: -this.options.crop[1]/2+&amp;quot;px&amp;quot;, 
      marginLeft: -this.options.crop[0]/2+&amp;quot;px&amp;quot; 
}).injectInside(this.container);
this.ghost = this.image.clone(false).injectInside(this.mask);&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The image itself is next up.  She is infront of the mask so we can drag her around without having the mask conflict.  We set the opacity to .3 making the ghosting effect.  The positioning of this image is identical to the one inside the mask.  Infact, as you drag the image, it&#8217;s css is copied straight into the css of the image inside of the mask.  The only difference is the opacity.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;draw: function() {
  this.ghost.style.cssText = this.image.style.cssText;
  this.ghost.setOpacity(1);
}

this.drag = new Drag.Base(this.image, {
  limit: {
    x: [-this.size[0] + this.options.crop[0] / 2, -this.options.crop[0] / 2], 
    y: [-this.size[1] + this.options.crop[1] / 2, -this.options.crop[1] / 2]
  },
  modifiers: {
    x: &amp;quot;margin-left&amp;quot;, 
    y: &amp;quot;margin-top&amp;quot;
  },
  onDrag: this.draw.bind(this)
});&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Mootool&#8217;s awesome &lt;a href=&quot;http://docs.mootools.net/Drag/Drag-Base.js&quot;&gt;Drag&lt;/a&gt; class provides a way to constrain the object being drug via the limit parameter in the constructor.  This logic is repeated in the scaling function (&lt;em&gt;updateSlide&lt;/em&gt;) to insure the image is not scaled outside of the mask.  This function is the hairiest of them all&#8230; maybe we&#8217;ll dig into her another time.&lt;/p&gt;

&lt;p&gt;Last but not least we have the CROP and EXIT buttons along with the slider itself.  These need to be infront of everything else, which is why they are last.  There is no styling done explicitly by the croppr javascript library.  Instead, it gives you the freedom to style them however you would like.  &lt;/p&gt;

&lt;p&gt;When we&#8217;re done using croppr, cleanup is as easy as:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;this.container.remove();
new Fx.Style(this.trans, 'opacity', {duration: 1000, onComplete: this.trans.remove}).start(0.8, 0);&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And that&#8217;s that, bending the DOM to do your dirty work turns out not to be so bad&#8230;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://vandev.com/">
    <author>
      <name>vanpelt</name>
    </author>
    <id>tag:vandev.com,2007-04-11:2772</id>
    <published>2007-04-11T06:36:00Z</published>
    <updated>2007-04-16T02:41:49Z</updated>
    <category term="Javascript"/>
    <category term="Projects"/>
    <category term="Rails and or Ruby"/>
    <category term="camping"/>
    <category term="croppr"/>
    <category term="javascript"/>
    <category term="ruby"/>
    <category term="tutorial"/>
    <link href="http://vandev.com/2007/4/11/croppr-ready-for-primetime" rel="alternate" type="text/html"/>
    <title>Croppr, ready for primetime</title>
<content type="html">
            &lt;p&gt;It&#8217;s been a long time coming&#8230; Croppr has grown out of it&#8217;s infancy.  Sparked recently by the release of &lt;a href=&quot;http://gravatar.com&quot;&gt;Gravatar 2.0&lt;/a&gt; and the Ruby on Rails podcast &lt;a href=&quot;http://podcast.rubyonrails.com/programs/1/episodes/the_camping_episode_ii&quot;&gt;Camping II&lt;/a&gt;, I dove back into the code and cleaned it up.  Croppr now adheres to the minimalistic principles of &lt;a href=&quot;http://code.whytheluckystiff.net/camping&quot;&gt;Camping&lt;/a&gt;.  RMagick was thrown out in favor of &lt;a href=&quot;http://seattlerb.rubyforge.org/ImageScience.html&quot;&gt;ImageScience&lt;/a&gt;.  The javascript was tweaked for performance and readability using the ever so light and powerfull &lt;a href=&quot;http://mootools.net&quot;&gt;MooTools&lt;/a&gt;.  The magic is really in the javascript, I encourage you to check &lt;a href=&quot;http://svn.vandev.com/croppr/trunk/ext/croppr.js&quot;&gt;it&lt;/a&gt; out.  All the pieces come together as a living tutorial of how to implement Croppr on your own.  Go &lt;a href=&quot;http://vandev.com/croppr&quot;&gt;play&lt;/a&gt; with my vain demo!  If you want to get sneaky and upload your own image tag &lt;code&gt;/new&lt;/code&gt; to the end of the URL, but keep it clean&#8230;  Here&#8217;s an overview on how to get her up and running on your own machine:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;sudo gem install mongrel
sudo gem install camping
sudo gem install json
sudo gem install sqlite3-ruby (you need to have sqlite3 installed) 
sudo gem install image_science (you need to have freeimage installed)

svn co http://svn.vandev.com/croppr/trunk croppr
cd croppr

ruby croppr.rb&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It&#8217;s that easy.  You should be able to follow the documentation in the javascript and the implementation example in the camping app to get her working yourself.  Goodluck, and let me know of any crazy browser issues.  I half-assed tested it in IE 6 and 7&#8230;  Safari and Firefox are golden.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://vandev.com/">
    <author>
      <name>vanpelt</name>
    </author>
    <id>tag:vandev.com,2007-03-11:2562</id>
    <published>2007-03-11T01:41:00Z</published>
    <updated>2007-04-11T17:13:40Z</updated>
    <category term="Design"/>
    <category term="Javascript"/>
    <category term="Tutorials"/>
    <category term="effect"/>
    <category term="javascript"/>
    <category term="mootools"/>
    <category term="tutorial"/>
    <link href="http://vandev.com/2007/3/11/mootools-and-my-sidebar-doing-it" rel="alternate" type="text/html"/>
    <title>Mootools and my sidebar, doing it</title>
<content type="html">
            &lt;p&gt;This afternoon I was perusing the web and ended up mining &lt;a href=&quot;http://yelp.com&quot;&gt;Yelp&lt;/a&gt; for something to do in this new and foreign &lt;a href=&quot;http://www.ci.sf.ca.us&quot;&gt;city&lt;/a&gt;.  I noticed a slick &lt;a href=&quot;http://www.yelp.com/search?find_desc=something+to+do&amp;amp;amp;find_loc=San+Francisco%2C+Ca&quot;&gt;effect&lt;/a&gt; that was used to keep the map in the view port as you scrolled.  I had done this before with the &lt;code&gt;position:fixed&lt;/code&gt; css directive, but it's rather limited especially in a centered layout.  You also can't choose your easing equation or delay the effect... Thanks &lt;a href=&quot;http://mootools.net&quot;&gt;Moo&lt;/a&gt;, let's do it.&lt;/p&gt;

&lt;p&gt;I added a set of links which link to targets on this &lt;a href=&quot;http://vandev.com&quot;&gt;page&lt;/a&gt; in my sidebar entitled &quot;On this page...&quot;.  I want the links to scroll the page to the targeted element, and I also want the links to follow me there so I can click on another one if I need to.  8 lines of javascript with the aid of Mootools gets her done.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;var slideEffect = new Fx.Style('sidenav', 'margin-top', {wait:false, duration:800, transition:Fx.Transitions.circOut});
  window.addEvent('load', function() {
    var top = $('sidenav').getPosition().y - 10;
    window.addEvent('scroll', function(){
      slideEffect.start.delay(600, slideEffect, Math.max(0, document.documentElement.scrollTop - top));
    });
    new SmoothScroll({duration:700, transition:Fx.Transitions.circOut});
  });&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Let's analyze the crap out of this code.  I first create a new Fx.Style specifying &lt;code&gt;wait:false&lt;/code&gt; (&lt;em&gt;so If I start scrolling down the page and than suddenly switch direction, the effect will simply start over in that new direction&lt;/em&gt;).  I'm modifying the &lt;code&gt;margin-top&lt;/code&gt; property of the &lt;code&gt;sidenav&lt;/code&gt; element.  I also specify a custom transition &lt;code&gt;circOut&lt;/code&gt; which starts fast and than slows to a stop. Using &lt;code&gt;window.addEvent('load'&lt;/code&gt;, I wait for the document to load because the position of my div is relative to the image of my face.  You could use the &lt;code&gt;domready&lt;/code&gt; event if the position of the div you will be scrolling is not relative to an image...  Next I get the position of the top of my div and subtract 10 from it to give it some padding.&lt;/p&gt;

&lt;p&gt;Now for the magic.  I listen for the &lt;code&gt;scroll&lt;/code&gt; event and when it happens I fire the recently created &lt;code&gt;slideEffect&lt;/code&gt;.  However, because the delay is cool and if I don't delay the effect will look really jumpy, I delay the start of the effect.  Moo provides a delay method which can be called on any function.  You have to call it on the function, not on the thing the function returns: e.g. &lt;code&gt;myFunction.delay(100)&lt;/code&gt; or &lt;code&gt;function(){return 'rad'}.delay(300)&lt;/code&gt; instead of &lt;code&gt;myFunction('awesome').delay(30)&lt;/code&gt;.  The second attribute to delay is an object that will become &lt;code&gt;this&lt;/code&gt; in the function delay is being called on.  In this case we want &lt;code&gt;this&lt;/code&gt; to be the effect itself.  The third attribute is the attribute(s) that will be passed into the function.  For us, this is an integer representing the new margin.  We calculate this as the maximum of either 0 or the difference of the current viewport offset and the original offset of the image.  &lt;/p&gt;

&lt;p&gt;The last thing to do is make a call to &lt;code&gt;SmoothScroll&lt;/code&gt;, making all links that point to a target scroll to the element with that targets id (this was detailed in my &lt;a href=&quot;#article_2140&quot;&gt;last&lt;/a&gt; post).  So there it is, a detailed description of how my sidebar and mootools did it.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://vandev.com/">
    <author>
      <name>vanpelt</name>
    </author>
    <id>tag:vandev.com,2007-02-28:2140</id>
    <published>2007-02-28T08:02:00Z</published>
    <updated>2007-03-11T02:57:26Z</updated>
    <category term="Javascript"/>
    <category term="Tutorials"/>
    <category term="effect"/>
    <category term="javascript"/>
    <category term="moo"/>
    <category term="mootools"/>
    <category term="tutorial"/>
    <link href="http://vandev.com/2007/2/28/mootools-a-silly-fx-tutorial" rel="alternate" type="text/html"/>
    <title>Mootools, a silly Fx tutorial</title>
<content type="html">
            &lt;p&gt;I&#8217;ve been loving &lt;a href=&quot;http://mootools.net&quot;&gt;mootools&lt;/a&gt; lately so I figured I would demonstrate some of it&#8217;s awesomeness by explaining a few of the effects generated on this very page.&lt;/p&gt;

&lt;h3&gt;Awesome bouncy nav tabs (&lt;em&gt;upper right, funny creative projects&lt;/em&gt;)&lt;/h3&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;$$('#header ul li a').each(function(el) {
  var bounce = new Fx.Style(el, 'top', {duration:700, transition: Fx.Transitions.elasticOut});
  var colors = new Fx.Styles(el, {wait:false});

  el.addEvent('mouseover', function(){
    el.setStyle('background-color', '#d5e88f');
    bounce.start(15,0);
    colors.start({
        color: '35342e'
    });
  });
  el.addEvent('mouseout', function(){
    colors.start({
        'background-color': '35342e',
        color: 'd5e88f'
    });
  });
});&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Allright, so moo gives us a DOM selector much like prototypes.  I use it to grab all the &lt;code&gt;a&lt;/code&gt; tags in my nav list, and then I iterate over them.  Moo has three generic Fx classes, &lt;a href=&quot;http://docs.mootools.net/files/Effects/Fx-Style-js.html&quot;&gt;Style&lt;/a&gt;, &lt;a href=&quot;http://docs.mootools.net/files/Effects/Fx-Styles-js.html&quot;&gt;Styles&lt;/a&gt;, and &lt;a href=&quot;http://docs.mootools.net/files/Effects/Fx-Elements-js.html&quot;&gt;Elements&lt;/a&gt;.  I don&#8217;t use Fx.Elements here, but you can read about it via moos excellent &lt;a href=&quot;http://docs.mootools.net/files/Core/Moo-js.html&quot;&gt;documentation&lt;/a&gt;.  If you are familiar with the scriptaculous Morph effect, these will come natuarlly.  They let you tween a list of css attributes, leaving the door of possibilities for amazing custom effects wide open.&lt;/p&gt;

&lt;p&gt;First I create two effects.  One to deal with the motion, &lt;em&gt;bounce&lt;/em&gt;, and the other to deal with font and background color, &lt;em&gt;colors&lt;/em&gt;.  Moo supplies an &lt;a href=&quot;http://mootools.net/download/svn&quot;&gt;optional&lt;/a&gt; set of robust transitions based on Robert Penner&#8217;s &lt;a href=&quot;http://www.robertpenner.com/easing/easing_demo.html&quot;&gt;easing&lt;/a&gt; equations (&lt;em&gt;the easing demo is extremely helpful&lt;/em&gt;).  I specify the elasticOut transition upon instantiation of the &lt;em&gt;bounce&lt;/em&gt; effect to make it, well bouncy.  Setting &lt;code&gt;wait&lt;/code&gt; to false in the Fx.Styles call tells the effect to go ahead and run even if there is another effect just like it already running. This let&#8217;s the tab fade back to normal if I mouseout before it&#8217;s finished.&lt;/p&gt;

&lt;p&gt;After the effects are created, all that&#8217;s left is attaching them to an event.  Voila, crazy cool bouncy tabs.&lt;/p&gt;

&lt;h3&gt;A silly unobtrusive smooth scrolling effect (&lt;em&gt;click &#8220;it&#8217;s not what you think&#8221; next to the VD logo&lt;/em&gt;)&lt;/h3&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;new SmoothScroll({duration:1000});&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Another &lt;a href=&quot;http://mootools.net/download/svn&quot;&gt;optional&lt;/a&gt; effect (thank you kickass building tool), is &lt;a href=&quot;http://docs.mootools.net/files/Plugins/SmoothScroll-js.html&quot;&gt;SmoothScroll&lt;/a&gt;.  Upon instantiation she finds all of the targets (aka anything with an id) and adds an event to all the &lt;code&gt;a&lt;/code&gt; tags referencing that target (aka href=&#8221;#name_of_target&#8221;), which scrolls the window to that element&#8230; just click it.&lt;/p&gt;

&lt;h3&gt;Opaque image rollover (&lt;em&gt;what the flick&lt;/em&gt;)&lt;/h3&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;$$('div#flickr img').each(function(e){
  var fade = new Fx.Style(e, 'opacity', {wait:false});
  fade.set(.5);
  e.addEvent('mouseover', function(){
    fade.start(1);
  });
  e.addEvent('mouseout', function(){
    fade.start(.5);
  });
});&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This uses the same techniques as the first effect.  The set method allows you to set the initial position of the effect.  In this case it makes all of the images 50% opaque when the page loads.&lt;/p&gt;

&lt;p&gt;So there you have it.  Mootools is silly powerful and fun.  It puts the control in your hands, and does so in a lightweight and extremely sexy manner. &lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://vandev.com/">
    <author>
      <name>vanpelt</name>
    </author>
    <id>tag:vandev.com,2007-02-12:1280</id>
    <published>2007-02-12T04:04:00Z</published>
    <updated>2007-04-11T17:14:13Z</updated>
    <category term="The Rest"/>
    <category term="life"/>
    <category term="powerset"/>
    <link href="http://vandev.com/2007/2/12/really-awesome-i-mean-really-awesome" rel="alternate" type="text/html"/>
    <title>Really awesome, I mean really awesome</title>
<content type="html">
            &lt;p&gt;So back on the 15th of December friend and fellow rubyist, &lt;a href=&quot;http://glu.ttono.us&quot;&gt;Kevin Clark&lt;/a&gt;, forwarded me a job description from &lt;a href=&quot;http://powerset.com&quot;&gt;Powerset&lt;/a&gt;.  Well, I applied to said job and long story short I&#8217;m starting tomorrow!  I drove a Budget rental truck up to San Francisco from San Diego on Friday.  I don&#8217;t have a place yet&#8230; a slight problem which will hopefully be remedied very soon.  Anyway, we had an awesome &lt;a href=&quot;http://www.flickr.com/photos/yogurtboy/sets/72157594529172885&quot;&gt;party&lt;/a&gt; last night to celebrate the series A funding, and I&#8217;m excited to get started and settle into San Francisco.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://vandev.com/">
    <author>
      <name>vanpelt</name>
    </author>
    <id>tag:vandev.com,2007-02-07:897</id>
    <published>2007-02-07T07:55:00Z</published>
    <updated>2007-03-11T02:48:30Z</updated>
    <category term="Design"/>
    <category term="Javascript"/>
    <category term="Tutorials"/>
    <category term="javascript"/>
    <category term="mephisto"/>
    <category term="mootools"/>
    <category term="tag cloud"/>
    <category term="tutorial"/>
    <link href="http://vandev.com/2007/2/7/a-mephisto-tag-cloud" rel="alternate" type="text/html"/>
    <title>A mephisto tag cloud</title>
<content type="html">
            &lt;p&gt;As I continue to customize my new &lt;a href=&quot;http://mephistoblog.com&quot;&gt;mephisto&lt;/a&gt; installation, I wanted a tag cloud for the Folksonomy section at the bottom of the page.  At first I thought I would use a mephisto plugin&#8230; after further consideration I decided that was a little overkill.  JavaScript kicks ass, especially with the recent &lt;a href=&quot;http://blog.mad4milk.net/entry/mootools-version-1-official-world-release&quot;&gt;release&lt;/a&gt; of &lt;a href=&quot;http://mootools.net&quot;&gt;mootools&lt;/a&gt; version 1.0, so I decided to let it do the work.  I created a small class called Overcast which makes tag clouds easy peasy japaneasy.  So, just how easy is it to get a tag cloud in mephisto?  Here&#8217;s a snipet from my layout.liquid&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;{{ 'mootools' | javascript }}
{{ 'overcast' | javascript }}
&amp;lt;/head&amp;gt;

&amp;lt;div id=&amp;quot;overcast&amp;quot;&amp;gt;
  {% for tag in site.tags %}
    &amp;lt;a href=&amp;quot;/tags/{{ tag }}&amp;quot; class=&amp;quot;_{{tag | tagged_articles | size}}&amp;quot; rel=&amp;quot;tag&amp;quot;&amp;gt;{{ tag }}&amp;lt;/a&amp;gt;
  {% endfor %}
&amp;lt;/div&amp;gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
  over = new Overcast({min: 1, fuzz: 2, overlay: &amp;quot;/images/gloss.png&amp;quot;});
&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;A couple sexy things to note are the cool transparent overlays ontop of each tag, and the ability to fuzz tags when your weights aren&#8217;t very diverse.  Also, if you&#8217;ve got &lt;a href=&quot;http://getfirebug.com&quot;&gt;Firebug&lt;/a&gt; you can type &lt;em&gt;over.update(&#8220;amazing&#8221;,4)&lt;/em&gt; in the console to add a new tag to the cloud with that weight, or &lt;em&gt;over.update(&#8220;javascript&#8221;, 3)&lt;/em&gt; to change the weight of an existing tag.  All of the functionality is documented in the source.&lt;/p&gt;

&lt;p&gt;Grab the &lt;a href=&quot;http://vandev.com/javascripts/overcast.js&quot;&gt;source&lt;/a&gt; from the include in this page.  I&#8217;ll put it under version control soon.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://vandev.com/">
    <author>
      <name>vanpelt</name>
    </author>
    <id>tag:vandev.com,2007-01-12:102</id>
    <published>2007-01-12T00:17:00Z</published>
    <updated>2007-02-05T08:00:07Z</updated>
    <category term="Rails and or Ruby"/>
    <category term="The Rest"/>
    <category term="mephisto"/>
    <category term="merb"/>
    <category term="mootools"/>
    <category term="news"/>
    <link href="http://vandev.com/2007/1/12/mephisto-is-finally-up-and-running" rel="alternate" type="text/html"/>
    <title>Mephisto is finally up and running</title>
<content type="html">
            &lt;p&gt;Dang, procrastination is a terrible terrible thing.  I had been doing allot of traveling prior to the Holidays and just didn&#8217;t have the motivation needed to put the time into setting up &lt;a href=&quot;http://www.mephistoblog.com&quot;&gt;Mephisto&lt;/a&gt;.  I finnaly got around to doing it, and it went pretty well.  The Typo conversion didn&#8217;t happen as smoothly as I had hoped and I had to hack the Flickr plugin a bit to get her up and going, but she&#8217;s finally here.  This time around I shouldn&#8217;t rank as #1 on Google for a series of absurdly explicit terms describing grotesque sexual actions&#8230;  Thank you &lt;a href=&quot;http://akismet.com&quot;&gt;Akismet&lt;/a&gt;.  I also decided to drop the blog from blog.vandev.com.  From now on, this is vandev.com.&lt;/p&gt;

&lt;p&gt;I&#8217;ve got a couple new little projects that I&#8217;ll release in the near future.  &lt;a href=&quot;http://merb.devjavu.com/&quot;&gt;Merb&lt;/a&gt; has entertained me as of late, as well as &lt;a href=&quot;http://mootools.mad4milk.net/&quot;&gt;MooTools&lt;/a&gt;.  Anyway, I&#8217;ll get them up and I&#8217;ll finish polishing the site.  Polishing it until it shines.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://vandev.com/">
    <author>
      <name>vanpelt</name>
    </author>
    <id>tag:vandev.com,2006-10-15:73</id>
    <published>2006-10-15T15:55:00Z</published>
    <updated>2007-02-07T23:37:35Z</updated>
    <category term="Mapping"/>
    <category term="Programming"/>
    <category term="Rails and or Ruby"/>
    <category term="Tutorials"/>
    <category term="geolite"/>
    <category term="map"/>
    <category term="maxmind"/>
    <category term="postgis"/>
    <category term="postgresql"/>
    <category term="rails"/>
    <category term="ruby"/>
    <category term="srid"/>
    <category term="utf8"/>
    <link href="http://vandev.com/2006/10/15/maxmind-geolite-on-rails-with-postgis" rel="alternate" type="text/html"/>
    <title>MaxMind GeoLite on Rails with PostGIS</title>
<content type="html">
            &lt;p&gt;Ughhhh, many hours of frustration have been spent trying to push the MaxMind GeoLite City CSV &lt;a href=&quot;http://www.maxmind.com/app/geolitecity&quot;&gt;files&lt;/a&gt; into a database configured with &lt;a href=&quot;http://postgis.refractions.net/&quot;&gt;PostGIS&lt;/a&gt;.  Anyway, I figured I would document the process that I went through incase someone else wants some free IP based geocoding in there Rails app.&lt;/p&gt;

&lt;p&gt;MaxMind gives you two CSV files for the city database.  One has an assload (2,783,434) of IP blocks that map to the id of a row in the other table containing location data.  The location data is pretty rich.  It contains a postal code, area code, dma code, country, region (state in US), and a latitude and longitude.  Because I wanted to be cool and more efficient, I decided to store the lat / lon as a point in PostGIS format.  Using PostGIS along with Guilhem Vellut&#8217;s Spatial Adaptor &lt;a href=&quot;http://thepochisuperstarmegashow.com/projects/&quot;&gt;plugin&lt;/a&gt; for Rails, makes doing geo-spatial operations sexier and easier than ever.  You can use the Spatial Adaptor with MySQL, but you&#8217;ll never be as cool as the guy using it with PostgreSQL.&lt;/p&gt;

&lt;p&gt;First off I had to create my tables.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;create_table &amp;quot;geo_ip_locations&amp;quot; do |t|
  t.column &amp;quot;country&amp;quot;, :string, :limit =&amp;gt; 2
  t.column &amp;quot;region&amp;quot;, :string, :limit =&amp;gt; 2
  t.column &amp;quot;city&amp;quot;, :string
  t.column &amp;quot;postal_code&amp;quot;, :string, :limit =&amp;gt; 7
  t.column &amp;quot;dma_code&amp;quot;, :integer, :limit =&amp;gt; 3
  t.column &amp;quot;area_code&amp;quot;, :integer, :limit =&amp;gt; 3
  t.column &amp;quot;geom&amp;quot;, :point, :null =&amp;gt; false, :srid =&amp;gt; 4269, :with_z =&amp;gt; false
end

add_index :geo_ip_locations, :geom, :spatial =&amp;gt; true

create_table &amp;quot;geo_ips&amp;quot; do |t|
  t.column &amp;quot;start_ip&amp;quot;, :integer, :limit =&amp;gt; 10
  t.column &amp;quot;end_ip&amp;quot;, :integer, :limit =&amp;gt; 10
  t.column &amp;quot;geo_ip_location_id&amp;quot;, :integer
end

add_index :gep_ips, :start_ip
add_index :geo_ips, :end_ip
add_index :geo_ips, :geo_ip_location_id&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;A few things to note:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The geom column has the srid set to 4269, this threw me for a loop for way too long.  Make sure you have the &lt;code&gt;spatial_ref_sys&lt;/code&gt; table populated.  I&#8217;m also assuming that the MaxMind data is mapped to the WGS 84 standard.&lt;/li&gt;
&lt;li&gt;The limit&#8217;s on the start and end ip&#8217;s are set to 10.  This creates bigint columns in my DB.  I&#8217;m not sure what version of Rails started doing this (I&#8217;m on Edge), but the columns have to be bigints for the IP block information to be imported.&lt;/li&gt;
&lt;li&gt;Remember to create a couple models for the tables&lt;/li&gt;
&lt;li&gt;You may want to add an index on postal_code or anything else you&#8217;ll be using in a SQL WHERE clause&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now because the CSV file with the blocks of IP addresses in it is so large I went with an importing tool to get it into the table.  I was going to use PostgreSQL&#8217;s COPY command, but it doesn&#8217;t seem to support CSV&#8217;s with double quotes.  I went with &lt;a href=&quot;http://pgsql.navicat.com/download.html&quot;&gt;Navicat&lt;/a&gt; and took advantage of my 30 day trial.  The CSV with the locations in it is another story.  We need to convert the lat / lon pairs into points for PostGIS.  Not only that, but if we want to be really cool we need to convert the city names into UTF-8.  The file that MaxMind gives us has ISO-8859-1 encoding.  &lt;a href=&quot;http://www.gnu.org/software/libiconv/documentation/libiconv/iconv.1.html&quot;&gt;Iconv&lt;/a&gt; comes to the rescue.  You can either convert the entire file from the command line, or just use the ruby library to do it in the import script below.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;require &amp;quot;#{File.dirname(__FILE__)}/../../config/environment&amp;quot;
require 'fastercsv'
require 'iconv'
ICONV = Iconv.new( 'UTF-8', 'ISO-8859-1' )

FasterCSV::HeaderConverters[:underscore] = lambda { |h| h.underscore }

FasterCSV.foreach('geo_ip_locations.csv', {:headers =&amp;gt; :first_row, :col_sep =&amp;gt; &amp;quot;,&amp;quot;, :header_converters =&amp;gt; :underscore}) do |row|
  begin
    row['id'] = row.delete('loc_id')[1]
    row['geom'] = Point.from_x_y(row.delete('longitude')[1].to_f, row.delete('latitude')[1].to_f, 4326)
    row['city'] = ICONV.iconv(row['city'])
    cool = GeoIpLocation.new(row.to_hash)
    cool.id = row['id']
    cool.save!
    $stdout.print '.'
  rescue
    puts $!.message
    $stdout.print 'f'
  end
  $stdout.flush
end&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Things to note:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need FasterCSV for this to work &lt;code&gt;gem install fastercsv&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;You need to delete the first line (&lt;em&gt;with the copyright info in it&lt;/em&gt;) in the CSV for this script to work.&lt;/li&gt;
&lt;li&gt;If you converted the file from the command line, comment out the three lines referencing iconv to improve performance.&lt;/li&gt;
&lt;li&gt;I created a directory called &lt;code&gt;transform&lt;/code&gt; in my &lt;code&gt;db&lt;/code&gt; directory, renamed and moved the location CSV there, and created a file with the above code in it.&lt;/li&gt;
&lt;li&gt;Always remember to put the srid in the &lt;code&gt;Point.from_x_y&lt;/code&gt; call, otherwise you&#8217;ll be very very frustrated.&lt;/li&gt;
&lt;li&gt;You&#8217;ll need to specify &lt;code&gt;encoding: unicode&lt;/code&gt; &lt;em&gt;Postgres&lt;/em&gt;, &lt;code&gt;encoding: utf8&lt;/code&gt; &lt;em&gt;MySQL&lt;/em&gt; in database.yml to use UTF-8 with the DB.  See the Rails &lt;a href=&quot;http://wiki.rubyonrails.org/rails/pages/HowToUseUnicodeStrings&quot;&gt;wiki&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;The id is set this way to preserve it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That&#8217;s it!  There you have it, the possibilities are now endless.  As I said before, I set this up on PostgreSQL, but this should work the same on MySQL.  The one main difference will be the srid&#8217;s.  MySQL doesn&#8217;t support them, so you don&#8217;t need to specify them.  Goodluck!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://vandev.com/">
    <author>
      <name>vanpelt</name>
    </author>
    <id>tag:vandev.com,2006-10-06:72</id>
    <published>2006-10-06T18:05:00Z</published>
    <updated>2007-02-01T02:04:27Z</updated>
    <category term="Programming"/>
    <category term="Projects"/>
    <category term="Rails and or Ruby"/>
    <category term="camping"/>
    <category term="keynote"/>
    <category term="presentation"/>
    <category term="quicksilver"/>
    <link href="http://vandev.com/2006/10/6/quickpresent" rel="alternate" type="text/html"/>
    <title>QuickPresent</title>
<content type="html">
            &lt;p&gt;I threw together a quick and simple way to make a presentation on a mac using &lt;a href=&quot;http://quicksilver.blacktree.com/&quot;&gt;Quicksilver&lt;/a&gt; and &lt;a href=&quot;http://code.whytheluckystiff.net/camping&quot;&gt;Camping&lt;/a&gt; a while back.  Well, I finally got around to refining it and putting it into a both tiny and awesome package.  This puppy is made of two files, and makes presenting dead simple.  You just outline your thoughts in a text file, and QuickPresent smacks it onto your screen using Quicksilver&#8217;s &lt;em&gt;largetype&lt;/em&gt; feature.  Not only that, but it also gives you a slick little web interface to show you what you&#8217;ve said, and what you&#8217;re about to say.  Let me show you&#8230;&lt;/p&gt;

&lt;p&gt;&lt;img title=&quot;QuickPresent preview&quot; src=&quot;http://vandev.com/assets/2007/2/1/Picture_1.png&quot; width=&quot;600&quot; /&gt;&lt;/p&gt;

&lt;p&gt;A few other slick features include automatically opening URL&#8217;s and Files from your hard drive.  All you need is Camping and Quicksilver (with the &lt;em&gt;command line tool (qs)&lt;/em&gt; plugin installed).  Just type &lt;code&gt;camping quickpresent.rb&lt;/code&gt; from the command line and your up running.  If you want to try something cheaper than Keynote or Powerpoint, play with QuickPresent.  Let me know what you think.&lt;/p&gt;

&lt;p&gt;Get it from my SVN Repo: &lt;a href=&quot;http://svn.vandev.com/presenter&quot;&gt;http://svn.vandev.com/presenter&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://vandev.com/">
    <author>
      <name>vanpelt</name>
    </author>
    <id>tag:vandev.com,2006-09-22:71</id>
    <published>2006-09-22T11:02:00Z</published>
    <updated>2007-01-07T03:45:41Z</updated>
    <category term="Javascript"/>
    <category term="Rails and or Ruby"/>
    <category term="Tutorials"/>
    <category term="camping"/>
    <category term="croppr"/>
    <category term="life"/>
    <category term="mephisto"/>
    <category term="rails"/>
    <category term="ruby"/>
    <category term="sdruby"/>
    <link href="http://vandev.com/2006/9/22/croppr-podcast-a-little-late" rel="alternate" type="text/html"/>
    <title>Croppr podcast... a little late</title>
<content type="html">
            &lt;p&gt;The SDRuby &lt;a href=&quot;http://podcast.sdruby.com&quot;&gt;podcast site&lt;/a&gt; is filling up with great episodes.  One of which being my little talk on camping and &lt;a href=&quot;http://www.vandev.com/croppr&quot;&gt;Croppr&lt;/a&gt; (Episode 002 on the bottom).  The thing has been up for a couple of monthes now, but my posting consistency has been miserable lately.  I&#8217;ve had more &lt;a href=&quot;http://www.vanblog.net/archives/88-Wow,-its-a-record.html&quot;&gt;pressing issues&lt;/a&gt;, but today is a new day.  My next project will be pushing this thing over to &lt;a href=&quot;http://www.mephistoblog.com&quot;&gt;Mephisto&lt;/a&gt;.  I should also spend some time fixing the Rails date_select helper, but that&#8217;s another post all together.  The next time I speak, the entire back end of this puppy will be different&#8230; totally awesome.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://vandev.com/">
    <author>
      <name>vanpelt</name>
    </author>
    <id>tag:vandev.com,2006-07-05:67</id>
    <published>2006-07-05T22:33:00Z</published>
    <updated>2007-02-08T00:39:50Z</updated>
    <category term="Javascript"/>
    <category term="Rails and or Ruby"/>
    <category term="camping"/>
    <category term="crop"/>
    <category term="croppr"/>
    <category term="javascript"/>
    <link href="http://vandev.com/2006/7/5/croppr" rel="alternate" type="text/html"/>
    <title>Croppr is born... perhaps pre-mature</title>
<content type="html">
            &lt;p&gt;So, I finally got around to testing TextMate&#8217;s new blogging bundle.  It&#8217;s dead simple&#8230;  Anywho, I figured I would use it to give a sneak peek of my newest invention &lt;em&gt;Croppr&lt;/em&gt;, which I will be revealing in it&#8217;s full glory tomorrow night at &lt;a href=&quot;http://sdruby.com&quot;&gt;SDruby&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;All right, so Croppr was born out of a desire to make a better way to crop images online.  Specifically the need came from my buddy &lt;a href=&quot;http://www.cube6media.com&quot;&gt;Tom Werner&#8217;s&lt;/a&gt; pet project, &lt;a href=&quot;http://gravatar.com&quot;&gt;Gravatar&lt;/a&gt;.  The inspiration came from iChat&#8217;s avatar cropper:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://vandev.com/assets/2007/2/1/iChat_cropper.png&quot; alt=&quot;iChat Cropper&quot; /&gt;&lt;/p&gt;

&lt;p&gt;After days of arduous JavaScript hacking with the help of &lt;a href=&quot;http://prototype.conio.net&quot;&gt;Prototype&lt;/a&gt; and eventually Prototype Lite with &lt;a href=&quot;http://moofx.mad4milk.net/&quot;&gt;moo.fx&lt;/a&gt; I had a lightweight browser equivalent.  Have a &lt;a href=&quot;http://svn.vandev.com/croppr&quot;&gt;peek&lt;/a&gt; and play around.&lt;/p&gt;

&lt;p&gt;What good is a lightweight JavaScript cropper without a lightweight back end to actually do the cropping?  Enter &lt;a href=&quot;http://code.whytheluckystiff.net/camping&quot;&gt;camping&lt;/a&gt;.  In just 225 lines of &lt;a href=&quot;http://svn.vandev.com/croppr&quot;&gt;sexy Ruby code&lt;/a&gt; I have a fully functional image cropping machine.  I hope to have a running demo available in the near future.  As far as licensing goes, I&#8217;m still working on it so hold your shorts.  Until than, come to the SDruby meetup (start driving now if you have to) and see all the awesomeness that is Croppr!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://vandev.com/">
    <author>
      <name>vanpelt</name>
    </author>
    <id>tag:vandev.com,2006-06-27:69</id>
    <published>2006-06-27T20:59:00Z</published>
    <updated>2007-01-07T03:49:05Z</updated>
    <category term="Cool Tech"/>
    <category term="The Rest"/>
    <category term="cellphone"/>
    <category term="edge"/>
    <category term="photo"/>
    <category term="rocket"/>
    <category term="satellite"/>
    <category term="ufo"/>
    <link href="http://vandev.com/2006/6/27/edge-and-a-ufo" rel="alternate" type="text/html"/>
    <title>EDGE and a UFO Satellite</title>
<content type="html">
            &lt;p&gt;I have just witnessed quite the spectacle.  About 15 minutes ago, I saw something strange outside of the Encinitas Ca Starbucks on the 101.  In the twilight sky over the vast Pacific a UFO appeared.  Screaming up from the horizon the strange object slowed abruptly and than continued on it's path South-Southeast.  At the place where it slowed a large smoke plume appeared which seemed to get brighter as the sky darkened.  Fortunately I had my new W600i camera phone.  I snapped 8 pics and used the phones wireless modem feature to link up to the EDGE network and send &lt;a href=&quot;http://www.flickr.com/photos/vanpelt/sets/72157594180026564/&quot;&gt;them&lt;/a&gt; to Flickr.&lt;/p&gt;

&lt;div class=&quot;flickrplugin&quot;&gt;&lt;a href=&quot;http://flickr.com/photos/vanpelt/176781709&quot;&gt;&lt;img title=&quot;UFO 2&quot; src=&quot;http://farm1.static.flickr.com/59/176781709_69aa1943ba.jpg&quot; height=&quot;375&quot; alt=&quot;UFO 2&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;I watched as the object seemed to emit some type of vapor sporadically as it trailed off.  This was definitely not a comet and had to have been something engineered... &lt;em&gt;upon further review it must have been a satellite being launched from somewhere in the Pacific&lt;/em&gt;  I'm very curious to see if there were any other sightings.  As far as the validity of these photos go, I know the quality is poor but check out the upload timestamps on Flickr.  If there were other sightings, this could easily be verified.  Crazy stuff.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;It is now confirmed that this was no UFO, nay it was a Delta IV rocket launching a NROL-22 reconnaissance satellite into orbit.  Here's the &lt;a href=&quot;http://www.boeing.com/news/releases/2006/q2/060627b_nr.html&quot;&gt;press release&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It was launched from &lt;a href=&quot;http://local.google.com/local?f=q&amp;amp;amp;hl=en&amp;amp;amp;q=Vandenberg+Air+Force+Base&amp;amp;amp;ie=UTF8&amp;amp;amp;ll=34.939985,-120.552979&amp;amp;amp;spn=3.926252,10.667725&amp;amp;amp;om=1&quot;&gt;Vandenburg AFB&lt;/a&gt; just north of Santa Barbara.  I'm glad it wasn't aliens or the Koreans...&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://vandev.com/">
    <author>
      <name>vanpelt</name>
    </author>
    <id>tag:vandev.com,2006-06-06:70</id>
    <published>2006-06-06T16:22:00Z</published>
    <updated>2007-02-07T23:39:08Z</updated>
    <category term="Rails and or Ruby"/>
    <category term="Tutorials"/>
    <category term="compile"/>
    <category term="graphicsmagick"/>
    <category term="imagemagick"/>
    <category term="rmagick"/>
    <category term="ruby"/>
    <category term="tutorial"/>
    <link href="http://vandev.com/2006/6/6/rmagick-on-mac-os-x-10-4-tiger" rel="alternate" type="text/html"/>
    <title>RMagick on Mac OS X 10.4 Tiger</title>
<content type="html">
            &lt;p&gt;Recently I needed Rmagick installed on my Mac OS X 10.4 system.  This turned out to be nearly impossible, until I got down and dirty and just went for a fresh compile from source.  Actually it became more impossible until I found enlightenment on the long and arduous journey.  The following is a pretty bare-bones install.  It leaves out excess functionality like exporting to &lt;a href=&quot;ftp://ftp.remotesensing.org/libtiff/&quot;&gt;TIFF&lt;/a&gt;, working with &lt;a href=&quot;http://www.cs.wisc.edu/~ghost/&quot;&gt;PostScript or PDF&lt;/a&gt; files, &lt;a href=&quot;http://www.littlecms.com/&quot;&gt;color management&lt;/a&gt;, &lt;a href=&quot;http://sourceforge.net/projects/libexif&quot;&gt;EXIF&lt;/a&gt; headers, &lt;a href=&quot;http://xmlsoft.org/&quot;&gt;SVG&lt;/a&gt; images, or &lt;a href=&quot;http://sourceforge.net/projects/wvware/&quot;&gt;MSWord&lt;/a&gt; documents.  All of this functionality can be added by downloading the source from the links above, and compiling them before you run &lt;code&gt;./configure&lt;/code&gt; for ImageMagick.  You can also install GraphicsMagick if you like, it shouldn&#8217;t make a difference which one you use.&lt;/p&gt;

&lt;p&gt;The following instructions will have you up and running in no time (actually about 30 minutes depending on the speed of your system &lt;em&gt;ImageMagick takes forever&lt;/em&gt;).  These instructions assume you have installed Ruby according to the instructions at &lt;a href=&quot;http://hivelogic.com/articles/2005/12/01/ruby_rails_lighttpd_mysql_tiger&quot;&gt;HiveLogic&lt;/a&gt;.  If you have not, make sure you atleast follow the steps up to the point of installing ruby.  This makes sure your path is correct and your build environment is in place.&lt;/p&gt;

&lt;p&gt;X11:&lt;/p&gt;

&lt;p&gt;10.4 Tiger install DVD or http://www.apple.com/downloads/macosx/apple/x11formacosx.html &lt;/p&gt;

&lt;p&gt;Freetype2:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;curl -O http://umn.dl.sourceforge.net/sourceforge/freetype/freetype-2.2.1.tar.gz
tar zxvf freetype-2.2.1.tar.gz
cd freetype-2.2.1
./configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; sudo make install
cd ..&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Jpeg:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;curl -O ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
tar zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b
ln -s `which glibtool` ./libtool
export MACOSX_DEPLOYMENT_TARGET=10.4
./configure --enable-shared &amp;amp;&amp;amp; make &amp;amp;&amp;amp; sudo make install
cd ..&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;PNG:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;curl -O http://umn.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.10-no-config.tar.gz
tar zxvf libpng-1.2.10-no-config.tar.gz
cd libpng-1.2.10
cp scripts/makefile.darwin Makefile
make &amp;amp;&amp;amp; sudo make install
cd ..&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;ImageMagick:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;curl -O http://umn.dl.sourceforge.net/sourceforge/imagemagick/ImageMagick-6.2.8-0.tar.gz
tar zxvf ImageMagick-6.2.8-0.tar.gz
cd ImageMagick-6.2.8
./configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; sudo make install
cd ..&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;RMagick (finally and thankfully):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo gem install rmagick&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That&#8217;s it, goto &lt;a href=&quot;http://rmagick.rubyforge.org/&quot;&gt;RMagick&lt;/a&gt;&#8217;s web site for information on using RMagick in your apps.  Be on the look out for an incredible little &lt;a href=&quot;http://code.whytheluckystiff.net/camping/&quot;&gt;Camping&lt;/a&gt; app that uses the power of RMagick to appear on VD soon!&lt;/p&gt;
          </content>  </entry>
</feed>
