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

<channel>
	<title>codeblog</title>
	<atom:link href="http://andyhill.us/codeblog/feed/" rel="self" type="application/rss+xml" />
	<link>http://andyhill.us/codeblog</link>
	<description></description>
	<lastBuildDate>Tue, 22 Nov 2011 18:39:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>First jQuery Plugin</title>
		<link>http://andyhill.us/codeblog/2011/11/22/first-jquery-plugin/</link>
		<comments>http://andyhill.us/codeblog/2011/11/22/first-jquery-plugin/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 18:25:13 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://andyhill.us/codeblog/?p=19</guid>
		<description><![CDATA[I wrote my first jQuery plugin. It&#8217;s nothing fancy, but I&#8217;ve got the boilerplate down for future plugins. Thanks to jMar for the jump start. (function($){ $.fn.truncate = function() { ////truncate is the name of the plugin var defaults = { ////set up default parameters ////default values here }; var options = $.extend(defaults, options); ////options [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote my first jQuery plugin. It&#8217;s nothing fancy, but I&#8217;ve got the boilerplate down for future plugins.</p>
<p>Thanks to <a href="http://blog.jeremymartin.name/2008/02/building-your-first-jquery-plugin-that.html" target="_blank">jMar</a> for the jump start.</p>
<pre>(function($){
 $.fn.truncate = function() {                    ////truncate is the name of the plugin
    var defaults = {                             ////set up default parameters
         ////default values here
    };
    var options = $.extend(defaults, options);   ////options will be the parameter scope
    return this.each(function() {                ////loop through each matched element

    });
 };
})(jQuery);</pre>
<p>My plugin takes containers and horizontally spaces all images they contain. I built it for the images across the top of <a href="http://andyhill.us" target="_blank">my web site</a>. It could definitely be expanded upon. Currently, it only takes a width option (default: 120) and only works horizontally.</p>
<p>Regardless, you can check it out <a title="jquery.imageArray.js" href="http://andyhill.us/js/jquery.imageArray.js" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://andyhill.us/codeblog/2011/11/22/first-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making a Simple YouTube Video with Audacity and OpenShot</title>
		<link>http://andyhill.us/codeblog/2011/11/19/making-a-simple-youtube-video-with-audacity-and-openshot/</link>
		<comments>http://andyhill.us/codeblog/2011/11/19/making-a-simple-youtube-video-with-audacity-and-openshot/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 19:03:00 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Audio-video]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[audacity]]></category>
		<category><![CDATA[audio-video]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[openshot]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://andyhill.us/codeblog/?p=12</guid>
		<description><![CDATA[I have often wanted to extract a good clip from an audio file and publish it on YouTube. I finally got around to doing it and it was easier than I had imagined (once I figured it out). All I&#8217;m doing here is creating a video with a still picture and audio. I&#8217;m using Fedora [...]]]></description>
			<content:encoded><![CDATA[<p>I have often wanted to extract a good clip from an audio file and publish it on YouTube. I finally got around to doing it and it was easier than I had imagined (once I figured it out). All I&#8217;m doing here is creating a video with a still picture and audio.</p>
<ol>
<li>I&#8217;m using <a href="http://fedoraproject.org/" target="_blank">Fedora Linux</a>. I had <a href="http://audacity.sourceforge.net/" target="_blank">Audacity</a>(audio editor) installed, but it did not have MP3 (which was the type of my audio file) support. Thankfully, there was an easy fix:
<ol>
<li>$ sudo yum remove audacity</li>
<li>$ sudo yum install audacity-freeworld</li>
<li>Thanks to <a href="http://insidesocal.com/click/2010/08/audacity-in-fedora-cant-import.html" target="_blank">http://insidesocal.com/click/2010/08/audacity-in-fedora-cant-import.html</a></li>
</ol>
</li>
<li>My .mp3 file was almost two hours long. I wanted about three minutes of it. I opened the .mp3 file and found the location of the clip and then did the following:
<ol>
<li>Clicked on the wave pattern about where I wanted the clip to start</li>
<li>Shift-clicked on the wave pattern about where I wanted it to end</li>
<li>Hit the space bar to play/pause the clip.</li>
<li>When paused, edit the start and end points by Shift+left-arrow/right-arrow to expand the selection and Control+Shift+left-arrow/right-arrow to contract. Click on the timeline above the wave pattern to start at that point (when tweaking the end of the selection).</li>
<li>When you&#8217;re happy with your selection, go to Edit-&gt;Trim</li>
<li>Move the selection to the start of the timeline by going to Tracks-&gt;Align Tracks-&gt;Align to Zero</li>
<li>Go to File-&gt;Export &#8230; , select .mp3 as the format. and hit Save.</li>
<li><a href="http://manual.audacityteam.org/man/Tutorial_-_Editing_an_Existing_File" target="_blank">More thorough instructions from the Audacity team</a></li>
</ol>
</li>
<li>Now open <a href="http://www.openshot.org/" target="_blank">OpenShot</a>.
<ol>
<li>Right-click in the top right panel and choose &#8220;Import Files&#8221; to add the .mp3 clip and an image.</li>
<li>Drag the audio into Track 2.</li>
<li>Drag the image into Track 1.</li>
<li>Right-click on the audio in Track 2 and choose &#8220;Properties&#8221;, so to the &#8220;Length&#8221; tab and copy the value for &#8220;Out&#8221;.</li>
<li>Follow the same steps for the image in Track 1, but paste in the value you copied from the audio</li>
<li>Got to File-&gt;Export Video &#8230;</li>
<li>Give it a name and select where to export it</li>
<li>For Profile, select Web</li>
<li>For Target, select YouTube</li>
<li>Click &#8220;Export Video&#8221;</li>
<li><a href="http://www.openshotusers.com/help/1.3/en/" target="_blank">Instructions with screenshots</a></li>
</ol>
</li>
</ol>
<p>Congratulations, you&#8217;re ready to upload your video to YouTube!</p>
]]></content:encoded>
			<wfw:commentRss>http://andyhill.us/codeblog/2011/11/19/making-a-simple-youtube-video-with-audacity-and-openshot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Granting User Access to /var/www/html</title>
		<link>http://andyhill.us/codeblog/2011/11/05/granting-user-access-to-varwwwhtml/</link>
		<comments>http://andyhill.us/codeblog/2011/11/05/granting-user-access-to-varwwwhtml/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 15:24:08 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://andyhill.us/codeblog/?p=7</guid>
		<description><![CDATA[Probably a no-brainer for many, but I can never remember, and this seems to be best practice: Personally, I would set the ownership of /var/www/html to apache. You can do this by: chown apache /var/www/html Next, I would create a group of let&#8217;s say &#8220;Web admins&#8221;: groupadd webadmins Add the user webadmin to the newly [...]]]></description>
			<content:encoded><![CDATA[<p>Probably a no-brainer for many, but I can never remember, and this seems to be best practice:</p>
<div>
<p>Personally, I would set the ownership of /var/www/html to apache. You can do this by:<code><br />
chown apache /var/www/html</code><br />
Next, I would create a group of let&#8217;s say &#8220;Web admins&#8221;:<code><br />
groupadd webadmins</code><br />
Add the user webadmin to the newly created group:<code><br />
usermod -G webadmins webadmin</code><br />
Add group permissions to the newly created group:<code><br />
chmod g+rw /var/www/html </code></p>
<p>Source:</p>
<p>http://serverfault.com/questions/310325/how-do-i-give-a-user-access-to-var-www-html</p>
<p>I also had to<br />
<code>chgrp webadmins /var/www/html</code></p>
<p><code></code>and log out.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://andyhill.us/codeblog/2011/11/05/granting-user-access-to-varwwwhtml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Anonymous Functions</title>
		<link>http://andyhill.us/codeblog/2011/10/11/php-anonymous-functions/</link>
		<comments>http://andyhill.us/codeblog/2011/10/11/php-anonymous-functions/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 00:58:20 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[lambda]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://andyhill.us/codeblog/?p=5</guid>
		<description><![CDATA[Sweet, but a little awkward. The good news is that PHP supports anonymous/lambda functions (that you can pass around, etc.), the bad news is you pass the function in as a string.OK, I admit the bad news isn&#8217;t that bad, but passing as a string could be a let-down if you&#8217;ve done much JavaScript. http://php.net/manual/en/function.create-function.php [...]]]></description>
			<content:encoded><![CDATA[<p>Sweet, but a little awkward. The good news is that PHP supports anonymous/lambda functions (that you can pass around, etc.), the bad news is you pass the function in as a string.OK, I admit the bad news isn&#8217;t that bad, but passing as a string could be a let-down if you&#8217;ve done much JavaScript.</p>
<p>http://php.net/manual/en/function.create-function.php</p>
<div>
<div><code> &lt;?php<br />
$newfunc = create_function('$a,$b', 'return "ln($a) + ln($b) = " . log($a * $b);');<br />
echo "New anonymous function: $newfunc\n";<br />
echo $newfunc(2, M_E) . "\n";<br />
// outputs<br />
// New anonymous function: lambda_1<br />
// ln(2) + ln(2.718281828459) = 1.6931471805599<br />
?&gt; </code></div>
</div>
<div>All syntax aside, I&#8217;m impressed PHP has had this since June 2000.</div>
<div>http://php.net/releases/index.php</div>
]]></content:encoded>
			<wfw:commentRss>http://andyhill.us/codeblog/2011/10/11/php-anonymous-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

