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

<channel>
	<title>avanderzwan &#187; Scripts</title>
	<atom:link href="http://www.aaronvanderzwan.com/blog/category/scripts/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aaronvanderzwan.com/blog</link>
	<description>Smile... It&#039;ll make you feel better.</description>
	<lastBuildDate>Fri, 30 Jul 2010 15:08:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<!-- podcast_generator="podPress/8.8" - maintenance_release="8.8.5.3" -->
	<copyright>Copyright &#xA9; 2010 avanderzwan </copyright>
	<managingEditor>akv292@gmail.com</managingEditor>
	<webMaster>akv292@gmail.com</webMaster>
	<category>posts</category>
	<ttl>1440</ttl>
	<image>
		<url>http://aaronvanderzwan.com/podcast_pic144.jpg</url>
		<title>avanderzwan &#187; Scripts</title>
		<link>http://www.aaronvanderzwan.com/blog</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle></itunes:subtitle>
	<itunes:summary>Smile... It'll make you feel better.</itunes:summary>
	<itunes:keywords></itunes:keywords>
	<itunes:category text="Society &amp; Culture" />
	<itunes:author></itunes:author>
	<itunes:owner>
		<itunes:name></itunes:name>
		<itunes:email>akv292@gmail.com</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://aaronvanderzwan.com/podcast_pic144.jpg" />
		<item>
		<title>jQuery: RegExp for all occurances; Wrap all &#169; and &#174; with HTML</title>
		<link>http://www.aaronvanderzwan.com/blog/2010/03/jquery-regexp-for-all-occurances-treat-all-and-with-specific-css/</link>
		<comments>http://www.aaronvanderzwan.com/blog/2010/03/jquery-regexp-for-all-occurances-treat-all-and-with-specific-css/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 20:33:45 +0000</pubDate>
		<dc:creator>Aaron Vanderzwan</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Hints / Tips]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[reg]]></category>
		<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://www.aaronvanderzwan.com/blog/?p=246</guid>
		<description><![CDATA[This script will find all &#169; and &#174; on a page and wrap them a span around them with a &#8220;copy&#8221; or &#8220;reg&#8221; class accordingly. &#60;style> .copy, .reg {font-size:xx-small;vertical-align:text-top;} &#60;/style> &#60;script> $(function(){ var copy = new RegExp(&#8216;\u00a9&#8242;,&#8217;g'); var reg = new RegExp(&#8216;\u00ae&#8217;,'g&#8217;); var newBody = $(&#8216;body&#8217;).html().replace(copy, &#8216;&#60;span class=&#8221;copy&#8221;>&#38;copy;&#60;/span>&#8217;).replace(reg, &#8216;&#60;span class=&#8221;reg&#8221;>&#38;reg;&#60;/span>&#8217;); $(&#8216;body&#8217;).html(newBody); }); &#60;/script>]]></description>
			<content:encoded><![CDATA[<p>This script will find all &copy; and &reg; on a page and wrap them a span around them with a &#8220;copy&#8221; or &#8220;reg&#8221; class accordingly.</p>
<blockquote class="code"><p>&lt;style><br />
			.copy, .reg {font-size:xx-small;vertical-align:text-top;}<br />
		&lt;/style></p>
<p>		&lt;script><br />
			$(function(){<br />
				var copy = new RegExp(&#8216;\u00a9&#8242;,&#8217;g');<br />
				var reg = new RegExp(&#8216;\u00ae&#8217;,'g&#8217;);<br />
		   	var newBody = $(&#8216;body&#8217;).html().replace(copy, &#8216;&lt;span class=&#8221;copy&#8221;>&amp;copy;&lt;/span>&#8217;).replace(reg, &#8216;&lt;span class=&#8221;reg&#8221;>&amp;reg;&lt;/span>&#8217;);<br />
		   	$(&#8216;body&#8217;).html(newBody);<br />
			});<br />
		&lt;/script></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronvanderzwan.com/blog/2010/03/jquery-regexp-for-all-occurances-treat-all-and-with-specific-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>focusMagic jQuery Plugin</title>
		<link>http://www.aaronvanderzwan.com/blog/2009/09/focusmagic-jquery-plugin/</link>
		<comments>http://www.aaronvanderzwan.com/blog/2009/09/focusmagic-jquery-plugin/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 18:35:42 +0000</pubDate>
		<dc:creator>Aaron Vanderzwan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[blur]]></category>
		<category><![CDATA[focus]]></category>
		<category><![CDATA[focusmagic]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[textarea]]></category>
		<category><![CDATA[watermark]]></category>

		<guid isPermaLink="false">http://aaronvanderzwan.com/blog/?p=216</guid>
		<description><![CDATA[This plugin is meant to expedite the basic process of making form fields empty or clear on focus and refill on blur, depending on a few specs&#8230; a watermark. The three different scenarios that I have built for are represented. A normal form field watermark that empties on focus and refills on blur. A value [...]]]></description>
			<content:encoded><![CDATA[<p>This plugin is meant to expedite the basic process of making form fields empty or clear on focus and refill on blur, depending on a few specs&#8230; a watermark. The three different scenarios that I have built for are represented.  </p>
<ol>
<li>A normal form field watermark that empties on focus and refills on blur.</li>
<li>A value that is set by the server trumps anything that the plugin does.  (Note: this way, if a user has to fill out the form again because one of the fields didn&#8217;t validate, the server can send values so that the user doesn&#8217;t have to refill the whole form)</li>
<li>There may be a time when you want to ignore the plugin and keep your label visible.  Just add a &#8216;ignore&#8217; class to your label and the plugin doesn&#8217;t touch it.</li>
<li>This is an extra couple of lines written so that validation works correctly.  What it does is it empties the fields that have not been touched by the user on submit.  That way, we can run our validation against those fields, and we don&#8217;t submit our label.</li>
</ol>
<p>This solution focuses on accessibility as it does not remove the label, just moves it off the viewport. This way, if a user does not have Javascript, CSS, or uses a screen reader, they will still get normal labels.</p>
<p><a href="http://www.aaronvanderzwan.com/focusmagic/">View a demo</a><br />
<a href="http://plugins.jquery.com/project/focusmagic">Download plugin</a> (link to jQuery plugins)</p>
<p>Please let me know what you think about it, or if there is anything I should do to improve.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronvanderzwan.com/blog/2009/09/focusmagic-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Movable Type 4.2: Custom Fields on registration / sign up form</title>
		<link>http://www.aaronvanderzwan.com/blog/2008/08/movable-type-42-custom-fields-on-registration-sign-up-form/</link>
		<comments>http://www.aaronvanderzwan.com/blog/2008/08/movable-type-42-custom-fields-on-registration-sign-up-form/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 16:10:37 +0000</pubDate>
		<dc:creator>Aaron Vanderzwan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Movable Type]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[4.2.]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[fields]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[registration]]></category>
		<category><![CDATA[sign]]></category>
		<category><![CDATA[up]]></category>

		<guid isPermaLink="false">http://aaronvanderzwan.com/blog/?p=146</guid>
		<description><![CDATA[This is a blog post about Movable Type development. If you are uninterested in Movable Type development, then you don&#8217;t need to read this. I have been working on building a pretty substantial website with Movable Type for the last couple of months and have learned a few things along the way. This is one [...]]]></description>
			<content:encoded><![CDATA[<p>This is a blog post about Movable Type development.  If you are uninterested in Movable Type development, then you don&#8217;t need to read this.  I have been working on building a pretty substantial website with Movable Type for the last couple of months and have learned a few things along the way.  This is one of those things that I learned that isn&#8217;t really documented anywhere.  I thought I would try.</p>
<p>The website that I am building allows for users to signup/create usernames/login/post entries/etc.  The goal was to require a user, when signing up, to add what company they worked for.  This is not one of the standard fields that come with Movable Type&#8217;s sign up form (we purchased the Community Solution).  What is baked in to Movable Type is the ability to create custom fields on the user object.  This is good.  It means that we can add as many fields as we want, and associate the data to a specific user, (i.e. Company, Job Title, Birthday, etc.).  MT has some documentation on allowing a user to update this custom information on their profile page (<a href="http://www.movabletype.org/documentation/community/user-profiles.html" target="_blank">http://www.movabletype.org/documentation/community/user-profiles.html</a>).  Here is the code they suggest:</p>
<blockquote><p><code>&lt;mt:loop name="field_loop"&gt;<br />
    &lt;mt:if name="__first__"&gt;<br />
    &lt;input type="hidden" name="customfield_beacon" value="1" id="customfield_beacon" /&gt;<br />
    &lt;/mt:if&gt;<br />
    <!-- start-customfield_&lt;mt:var name="basename"> --><br />
    &lt;mtapp:setting<br />
        id="$field_id"<br />
        label="$name"<br />
        hint="$description"<br />
        shown="$show_field"<br />
        show_hint="$show_hint"<br />
        required="$required"&gt;<br />
    &lt;mt:var name="field_html"&gt;<br />
    &lt;/mtapp:setting&gt;<br />
    <!-- end-customfield_&lt;mt:var name="basename"> --><br />
&lt;/mt:loop&gt;&lt;br /&gt;</code></p></blockquote>
<p>This is great if you want a user to be able to enter all of the created custom field data at once because it just loops through all of your custom fields and creates input fields for each of them.  We had about 10 custom fields on the user object and only wanted the person signing up to enter the &#8216;Company&#8217; information on signup (as to not make them feel overwhelmed with so much information to input).</p>
<p>How I accomplished only writing one field is to throw an MT if statement in there based on what the $field_id is.  In other words what your custom field&#8217;s basename is preceded by &#8220;customfield_&#8221;.</p>
<blockquote><p><code>&lt;mt:if name="field_id" eq="customfield_company"&gt;<br />
&lt;/mt:if&gt;</code></p></blockquote>
<p>With &#8220;company&#8221; my field&#8217;s basename, that made the field_id I was looking for, customfield_company.</p>
<p>My final code to display only the company custom field on the user signup form (with MT4.2):</p>
<blockquote><p><code>&lt;mt:loop name="field_loop"&gt;<br />
    &lt;mt:if name="__first__"&gt;<br />
    &lt;input type="hidden" name="customfield_beacon" value="1" id="customfield_beacon" /&gt;<br />
    &lt;/mt:if&gt;<br />
    <!-- start-customfield_&lt;mt:var name="basename"> --><br />
    &lt;mt:if name="field_id" eq="customfield_company"&gt;<br />
    &lt;mtapp:setting<br />
        id="$field_id"<br />
        label="$name"<br />
        hint="$description"<br />
        shown="$show_field"<br />
        show_hint="$show_hint"<br />
        required="$required"&gt;<br />
    &lt;mt:var name="field_html"&gt;<br />
    &lt;/mtapp:setting&gt;<br />
    &lt;/mt:if&gt;<br />
    <!-- end-customfield_&lt;mt:var name="basename"> --><br />
&lt;/mt:loop&gt;&lt;br /&gt;</code></p></blockquote>
<p><em><strong>Note:</strong> This is only possible on the user registration page after the release of <a href="http://www.movabletype.org/2008/08/movable_type_42_is_here.html" target="_blank">MovableType 4.2</a>.  Before that, I think this could only be done on the profile page.</em></p>
<p>I will update this if I learn any discrepancies in what I said.  If you find any, please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronvanderzwan.com/blog/2008/08/movable-type-42-custom-fields-on-registration-sign-up-form/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>RMagick &amp; ImageMagick from Source: Mac OSX Leopard</title>
		<link>http://www.aaronvanderzwan.com/blog/2008/04/rmagick-imagemagick-from-source-mac-osx-leopard/</link>
		<comments>http://www.aaronvanderzwan.com/blog/2008/04/rmagick-imagemagick-from-source-mac-osx-leopard/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 17:23:35 +0000</pubDate>
		<dc:creator>Aaron Vanderzwan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://aaronvanderzwan.com/blog/?p=108</guid>
		<description><![CDATA[The Problem I know that there are a lot of dependencies that go along with installing RMagick from source on Leopard.  For this reason, I was very interested in the idea of packing all of the commands into a script and just letting it run.  If you are like me, your past with scripts has [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-weight: bold">The Problem</span></p>
<p>I know that there are a lot of dependencies that go along with installing RMagick from source on Leopard.  For this reason, I was very interested in the idea of packing all of the commands into a script and just letting it run.  If you are like me, your past with scripts has been grey at best; i.e. there always seems to be some sort of problem that kills your script.  Then you have to search through it to find where it broke and you spend a lot of time aligning yourself with something that might not even work.</p>
<p>The reason most of these scripts will fail is that references are now broken or code deprecated.  If it fails, I then have to make sure that http://whatever.com still exists and is hosting the file and version that I need. I got to thinking&#8230; so often I would like (at least) the option of using something that is a bit older, but can be run smoothly.
</p>
<p><strong>The &#8216;Dependencies&#8217;/Libraries</strong></p>
<p>This script uses Ruby to install ImageMagick and RMagick, with the necessary dependencies for gif, jpg, png, freetype, tiff, libwmf (?), littlecms (?), and ghostscript (?).  It rely&#8217;s on these libraries:</p>
<p>
JPEG:<br />
<a href="ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz ">ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz</a></p>
<p>PNG:<br />
<a href="http://superb-west.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.22.tar.bz2">http://superb-west.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.22.tar.bz2</a></p>
<p>Freetype:<br />
<a href="http://download.savannah.gnu.org/releases/freetype/freetype-2.3.5.tar.gz">http://download.savannah.gnu.org/releases/freetype/freetype-2.3.5.tar.gz</a></p>
<p>TIFF:<br />
<a href="ftp://ftp.remotesensing.org/libtiff/tiff-3.8.2.tar.gz">ftp://ftp.remotesensing.org/libtiff/tiff-3.8.2.tar.gz</a></p>
<p><a href="http://jaist.dl.sourceforge.net/sourceforge/wvware/libwmf-0.2.8.4.tar.gz">http://jaist.dl.sourceforge.net/sourceforge/wvware/libwmf-0.2.8.4.tar.gz</a></p>
<p>LittleCMS:<br />
<a href="http://www.littlecms.com/lcms-1.17.tar.gz">http://www.littlecms.com/lcms-1.17.tar.gz</a></p>
<p>Ghostscript:<br />
<a href="ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/gs860/ghostscript-8.60.tar.gz">ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/gs860/ghostscript-8.60.tar.gz</a></p>
<p>Ghostscript Fonts:<br />
<a href="ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/current/ghostscript-fonts-std-8.11.tar.gz">ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/current/ghostscript-fonts-std-8.11.tar.gz</a></p>
<p>ImageMagick:<br />
<a href="ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.3.8-11.tar.gz">ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.3.8-11.tar.gz</a></p>
<p>
When I found this script these URLs were built in so that if one of the URLs didn&#8217;t work, it would break.  That is fine, but it is not built to find the newest and greatest, or make sure that the newest still works with everything else.  So why not just package all of those url&#8217;s libraries together and make that downloadable here.  I may be breaking a law or something&#8230; (if I am let me know) but I think these are all open-source.
</p>
<p><strong>The Instructions</strong></p>
<p>So here is how it is done.  </p>
<p> &#8211; <a href="http://www.aaronvanderzwan.com/blog/wp-content/uploads/2008/01/Rmagick%20Installer%20for%20MacOSX%2010.5.zip">Download the zip</a> (39.5 MB)<br />
 &#8211; Unpack it<br />
 &#8211; Open Terminal.app</p>
<blockquote style="text-align:left;"><p>
<code>cd /to/inside/the/unzipped/dir<br />
ruby setup.rb</code>
</p></blockquote>
<p>Now just let it run.  (You may have to put in your password every once in a while because of the &#8216;sudo&#8217;s).
</p>
<p>I should also note that I had X11 (Applications &gt; Utilities &gt; X11) and Xcode 3.0 (Macintosh HD &gt; Developer &gt; Applications &gt; Xcode) installed when I ran this script.  I am not sure how much this helped/effected the script running, but I do have these installed and runnable.
</p>
<p><strong>The Original</strong></p>
<p>Again, a special thanks to Solomon White who originally posted this script at <a href="http://onrails.org/articles/2007/11/03/installing-rmagick-on-leopard-without-macports-or-fink" target="_blank">his blog</a>.</p>
<p style="text-align:left;">Here are some other references for this technique.</p>
<p>John Ford:<br />
<a href="http://www.aldenta.com/2007/11/26/installing-imagemagickrmagick-on-leopard/">http://www.aldenta.com/2007/11/26/installing-imagemagickrmagick-on-leopard/</a></p>
<p>Ben Reubenstein:<br />
<a href="http://www.benr75.com/articles/2008/03/16/install-rmagick-on-mac-os-x-leopard-from-source">http://www.benr75.com/articles/2008/03/16/install-rmagick-on-mac-os-x-leopard-from-source</a></p>
<p>Here is what I found at Solomon&#8217;s website.</p>
<blockquote style="text-align:left;"><p><code>#!/bin/sh<br />
curl -O http://download.savannah.gnu.org/releases/freetype/freetype-2.3.5.tar.gz<br />
tar xzvf freetype-2.3.5.tar.gz<br />
cd freetype-2.3.5<br />
./configure --prefix=/usr/local<br />
make<br />
sudo make install<br />
cd ..</p>
<p>curl -O http://superb-west.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.22.tar.bz2<br />
tar jxvf libpng-1.2.22.tar.bz2<br />
cd libpng-1.2.22<br />
./configure --prefix=/usr/local<br />
make<br />
sudo make install<br />
cd ..</p>
<p>curl -O ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz<br />
tar xzvf jpegsrc.v6b.tar.gz<br />
cd jpeg-6b<br />
ln -s `which glibtool` ./libtool<br />
export MACOSX_DEPLOYMENT_TARGET=10.5<br />
./configure --enable-shared --prefix=/usr/local<br />
make<br />
sudo make install<br />
cd ..</p>
<p>curl -O ftp://ftp.remotesensing.org/libtiff/tiff-3.8.2.tar.gz<br />
tar xzvf tiff-3.8.2.tar.gz<br />
cd tiff-3.8.2<br />
./configure --prefix=/usr/local<br />
make<br />
sudo make install<br />
cd ..</p>
<p>curl -O http://jaist.dl.sourceforge.net/sourceforge/wvware/libwmf-0.2.8.4.tar.gz<br />
tar xzvf libwmf-0.2.8.4.tar.gz<br />
cd libwmf-0.2.8.4<br />
make clean<br />
./configure<br />
make<br />
sudo make install<br />
cd ..</p>
<p>curl -O http://www.littlecms.com/lcms-1.17.tar.gz<br />
tar xzvf lcms-1.17.tar.gz<br />
cd lcms-1.17<br />
make clean<br />
./configure<br />
make<br />
sudo make install<br />
cd ..</p>
<p>curl -O ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/gs860/ghostscript-8.60.tar.gz<br />
tar zxvf ghostscript-8.60.tar.gz<br />
cd ghostscript-8.60/<br />
./configure  --prefix=/usr/local<br />
make<br />
sudo make install<br />
cd ..</p>
<p>curl -O ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/current/ghostscript-fonts-std-8.11.tar.gz<br />
tar zxvf ghostscript-fonts-std-8.11.tar.gz<br />
sudo mv fonts /usr/local/share/ghostscript</p>
<p>curl -O ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.3.8-11.tar.gz<br />
tar -xzvf ImageMagick-6.3.8-11.tar.gz<br />
cd ImageMagick-6.3.8<br />
export CPPFLAGS=-I/usr/local/include<br />
export LDFLAGS=-L/usr/local/lib<br />
./configure --prefix=/usr/local --disable-static --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --with-gs-font-dir=/usr/local/share/ghostscript/fonts<br />
make<br />
sudo make install<br />
cd ..</p>
<p>sudo gem install rmagick<br />
</code>
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronvanderzwan.com/blog/2008/04/rmagick-imagemagick-from-source-mac-osx-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
