<?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>Blog.ubrious &#187; Because I&#8217;ll Forget</title>
	<atom:link href="http://blog.ubrio.us/category/because-ill-forget/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ubrio.us</link>
	<description>An Ordinary Web Developer's Blog</description>
	<lastBuildDate>Thu, 19 Jan 2012 00:44:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>GitHub theme for SyntaxHighlighter Wordpress plugin</title>
		<link>http://blog.ubrio.us/code/github-theme-for-syntaxhighlighter-wordpress-plugin/</link>
		<comments>http://blog.ubrio.us/code/github-theme-for-syntaxhighlighter-wordpress-plugin/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 01:20:49 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Because I'll Forget]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/?p=187</guid>
		<description><![CDATA[I did a very stupid thing. I automatically updated my syntaxhighlighter plugin (which is excellent by the way) through the wordpress admin panel. I also forgot that I had made a custom theme and added a few more matchers to the ruby brush, which were subsequently overwritten in the update. Bummer.
So. Here is the theme, [...]]]></description>
			<content:encoded><![CDATA[<p>I did a very stupid thing. I automatically updated my <a href='http://wordpress.org/extend/plugins/syntaxhighlighter/' onclick="pageTracker._trackPageview('/outgoing/wordpress.org/extend/plugins/syntaxhighlighter/?referer=');">syntaxhighlighter plugin</a> (which is excellent by the way) through the wordpress admin panel. I also forgot that I had made a custom theme and added a few more matchers to the ruby brush, which were subsequently overwritten in the update. Bummer.</p>
<p>So. Here is the theme, should I ever do that again, or if you aren&#8217;t a big fan of the default themes.</p>
<h3>Adding a new theme to SyntaxHighlighter</h3>
<p>If you are use version 2.2.0 of the plugin you can run this patch against it (<a href='http://file.ubrio.us/wordpress/add_github_theme.patch' onclick="pageTracker._trackPageview('/outgoing/file.ubrio.us/wordpress/add_github_theme.patch?referer=');">Add GitHub theme patch</a>). To use the patch just run:</p>
<p><code><span>$></span>patch syntaxhighlighter.php add_github_theme.patch</code></p>
<p>Or you can simply open it up and duplicate how the default themes are in there.</p>
<h3>Grab the GitHub SyntaxHighlighter  Theme</h3>
<p><a href='http://gist.github.com/148782' onclick="pageTracker._trackPageview('/outgoing/gist.github.com/148782?referer=');"> GitHub SyntaxHighlighter theme (Gist)</a> (It isn&#8217;t 100%, but it looks pretty nice for Ruby code)</p>
<h4>Heres how it looks</h4>
<div class='wp-caption alignleft'>
<img src='http://file.ubrio.us/wordpress/github_syntaxhighlighter_theme.png' /></p>
<p class='wp-caption-text'>GitHub Theme</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/code/github-theme-for-syntaxhighlighter-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making find and tar play nicely</title>
		<link>http://blog.ubrio.us/nix/making-find-and-tar-play-nicely/</link>
		<comments>http://blog.ubrio.us/nix/making-find-and-tar-play-nicely/#comments</comments>
		<pubDate>Thu, 27 Sep 2007 21:45:35 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Because I'll Forget]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Nix]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[tar]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/because-ill-forget/because-ill-forget-1023/</guid>
		<description><![CDATA[Because I&#8217;ll forget #1023
Problem
Use Linux&#8217;s &#8220;find&#8221; command to hunt recursively through the current directory tree and find all matching files. While this is simple enough, I&#8217;m an idiot and tend to delete important files when drinking working too much &#8212; which we all know sucks. It would be nice to have it take all found [...]]]></description>
			<content:encoded><![CDATA[<h3>Because I&#8217;ll forget #1023</h3>
<p><strong>Problem</strong></p>
<p>Use Linux&#8217;s &#8220;find&#8221; command to hunt recursively through the current directory tree and find all matching files. While this is simple enough, I&#8217;m an idiot and tend to delete important files when <del>drinking</del> working too much &#8212; which we all know sucks. It would be nice to have it take all found files, tar them up and move it to the trash.</p>
<p><strong>Solution</strong></p>
<p>The evil, but oh-so-useful <code>xargs</code> command is your saving grace. While I hate using xargs its damn useful. If you take the output of find and pipe it into <code>tar</code> then pipe THAT into <code>rm</code> you get the job done. </p>
<p><strong>Example</strong></p>
<p>This is just a simple hack I&#8217;ve put together which seems to work and is relatively simple. (done as a bash function)</p>
<pre class='prettyprint'>
frm(){
	find . -name "$1" | xargs tar rvf "$1.tar" | xargs rm -rfv &#038;&#038; mv $1.tar ~/.trash
}
</pre>
<p>I just needed this because I had to wipe all <code>./.svn</code> directories so i just typed <code>frm .svn</code> and it created a .svn.tar and moved that to ~/.trash. Good stuff <img src='http://blog.ubrio.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/nix/making-find-and-tar-play-nicely/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP5 With GD Support on OS X</title>
		<link>http://blog.ubrio.us/php/php5-with-gd-support-on-os-x/</link>
		<comments>http://blog.ubrio.us/php/php5-with-gd-support-on-os-x/#comments</comments>
		<pubDate>Tue, 21 Aug 2007 02:39:15 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Because I'll Forget]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[gd]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/because-ill-forget/php5-with-gd-support-on-os-x/</guid>
		<description><![CDATA[Because I&#8217;ll Forget #15901:
Firstly, let me just say that compiling PHP has never been this difficult before. It shouldn&#8217;t be difficult at all actually. So heres the basic run down: I need SOAP, GD, SimpleXML and a few other miscellaneous extensions to make all my dev apps work properly &#8212; this went smoothly on the [...]]]></description>
			<content:encoded><![CDATA[<h3>Because I&#8217;ll Forget #15901:</h3>
<p>Firstly, let me just say that compiling PHP has never been this difficult before. It shouldn&#8217;t be difficult at all actually. So heres the basic run down: I need SOAP, GD, SimpleXML and a few other miscellaneous extensions to make all my dev apps work properly &#8212; this went smoothly on the ppc laptop, and I (stupidly) assumed that the Intel would be even easier. My first couple attempts were splattered with GD errors driving me to the brink of insanity as I scrambled up all the pre-requisites. Finally, I had all dependencies met and the configure script STILL would not quit barfing on me. I gave up and finally just installed PHP without GD support (naturally ruining the one project I&#8217;m working on currently). I gave up, until I felt feisty enough to give it another shot.</p>
<p>The configure script was choking on a linking error (<strong>GD build test failed. Please check the config.log for details.</strong>) and kept telling me to hunt config.log for some answers. It turns out that ./configure was attempting to link with shell variables that were empty. </p>
<p>Looks something like &#8220;<code>-L: directory name missing</code>&#8220;.</p>
<p><strong>The solution</strong></p>
<p>Hacking my way through the configure file you get to the culprit. </p>
<p><code class='prettyprint'>LIBS=" -L$GD_LIB $GD_SHARED_LIBADD  $LIBS"</code></p>
<p>Turns out that <code>echo $GD_LIB</code> is blank and being a major pain in the ass. To fix this, just edit the line to look more like: <code>LIBS=" $GD_SHARED_LIBADD  $LIBS"</code>. After that, try a <code>make clean</code>, <code>rm config.cache</code> and try to compile again.  Hopefully this will save you a couple hours of hating life.</p>
<p><strong>Resources:</strong></p>
<ul>
<li><a href="http://www.phpmac.com/articles.php?view=3" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.phpmac.com/articles.php?view=3&amp;referer=');">http://www.phpmac.com/articles.php?view=3</a> &#8212; good instructions for getting those GD dependencies.</li>
<li><a href="http://www.phpmac.com/articles.php?view=159" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.phpmac.com/articles.php?view=159&amp;referer=');">http://www.phpmac.com/articles.php?view=159</a> &#8212; more insight from the same site</li>
<li><a href="http://www.afp548.com/article.php?story=20041104230209410" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.afp548.com/article.php?story=20041104230209410&amp;referer=');">http://www.afp548.com/article.php?story=20041104230209410</a> &#8212; more about GD dependencies, and a little more insight into problems</li>
<li><a href="http://www.thescripts.com/forum/thread670263.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.thescripts.com/forum/thread670263.html?referer=');">http://www.thescripts.com/forum/thread670263.html</a> &#8212; explains the final solution in more depth</li>
</ul>
<p><strong>My Configure Script</strong><br />
<small>It might be beefed up in the future, but I&#8217;m just relieved to have it compiled &#038; working right now &#8212; I&#8217;m exhausted</small></p>
<pre class='prettyprint'>
./configure --prefix=/usr/local/php5 \
 --mandir=/usr/share/man \
 --infodir=/usr/share/info \
 --sysconfdir=/etc \
 --enable-cli \
 --enable-soap \
 --with-ldap=/usr \
 --with-xml \
 --with-libxml-dir=/usr/local \
 --with-zlib \
 --with-zlib-dir=/usr \
 --with-openssl \
 --enable-exif \
 --enable-ftp \
 --enable-mbstring \
 --enable-mbregex \
 --enable-dbx \
 --enable-sockets \
 --with-curl=/usr \
 --with-mysql=/usr/local/mysql \
 --with-mysqli=/usr/local/mysql/bin/mysql_config \
 --with-apxs \
 --with-gd \
 --with-jpeg-dir=/usr \
 --with-png-dir=/usr \
 --with-freetype-dir=/usr \
 --with-xpm-dir=/usr
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/php/php5-with-gd-support-on-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to make a PCRE TextMate snippet</title>
		<link>http://blog.ubrio.us/because-ill-forget/how-to-make-a-pcre-textmate-snippet/</link>
		<comments>http://blog.ubrio.us/because-ill-forget/how-to-make-a-pcre-textmate-snippet/#comments</comments>
		<pubDate>Wed, 15 Aug 2007 15:25:36 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Because I'll Forget]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/because-ill-forget/how-to-make-a-pcre-textmate-snippet/</guid>
		<description><![CDATA[Because I&#8217;ll Forget #1099:
Problem
Create a TextMate snippet that will build a label for a given input textbox using Human Cased words from an underscored name attribute.
Solution
TextMate snippets support Perl Regexps which is a beautiful, albeit scary, thing. Start by making the label in direct relation to the input tag&#8217;s &#8220;name.&#8221; The label&#8217;s &#8220;for&#8221; attribute should [...]]]></description>
			<content:encoded><![CDATA[<h3>Because I&#8217;ll Forget #1099:</h3>
<p><strong>Problem</strong><br />
Create a TextMate snippet that will build a label for a given input textbox using Human Cased words from an underscored name attribute.</p>
<p><strong>Solution</strong><br />
TextMate snippets support Perl Regexps which is a beautiful, albeit scary, thing. Start by making the label in direct relation to the input tag&#8217;s &#8220;name.&#8221; The label&#8217;s &#8220;for&#8221; attribute should stay the same as the input&#8217;s &#8220;name,&#8221; but the actual text displayed between the label should be in Human format (ie: Uppercase first letter only, and spaces instead of &#8220;_&#8221;). Heres the final result:</p>
<pre class='prettyprint'>
&lt;label for="$2">${2/([a-z]){1}([a-z0-9]+)|(_)/(?3: :\U$1\L$2)/gi}&lt;/label> &lt;input type="${1:text}" name="${2:input}"${TM_XHTML}>
$0
</pre>
<p><strong class='note'>*</strong>The line broke early, where the substitution for the &#8220;_&#8221; to &#8221; &#8221; should be <code>(?3: :{rest of the code here}</code><br />
There is probably a more elegant solution, but this works for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/because-ill-forget/how-to-make-a-pcre-textmate-snippet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create icon sets in OS X</title>
		<link>http://blog.ubrio.us/osx/how-to-create-icon-sets-in-os-x/</link>
		<comments>http://blog.ubrio.us/osx/how-to-create-icon-sets-in-os-x/#comments</comments>
		<pubDate>Wed, 15 Aug 2007 00:54:35 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Because I'll Forget]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[icons]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/because-ill-forget/how-to-create-icon-sets-in-os-x/</guid>
		<description><![CDATA[Because I&#8217;ll Forget #1023:
Problem
I know how to _USE_ icon sets and set my icons*. My issue is that I want to take a folder of, say, *.PNG files and make the icon reflect the contents. I did some digging, and the solution is pretty simple &#8212; AND elegant.
Solution
There is a relatively unknown program, at least [...]]]></description>
			<content:encoded><![CDATA[<h3>Because I&#8217;ll Forget #1023:</h3>
<p><strong>Problem</strong><br />
I know how to _USE_ icon sets and set my icons*. My issue is that I want to take a folder of, say, *.PNG files and make the icon reflect the contents. I did some digging, and the solution is pretty simple &#8212; AND elegant.</p>
<p><strong>Solution</strong><br />
There is a relatively unknown program, at least it was to me, called &#8220;sips.&#8221; To take the generic PNG icon and replace it with a small thumbnail of the actual image you simply run <code>sips -i {image.ext}</code> from the command line. Beautiful!</p>
<p><strong>Example</strong></p>
<ol>
<li>Open a shell</li>
<li>cd {folder full of icons here}</li>
<li><code>find . -name "*.{ext}" -exec sips -i '{}' \;</code></li>
<li>Wait&#8230;</li>
<li>Start at the top of this page with how to change icons</li>
</ol>
<p><strong>Resources</strong></p>
<ul>
<li><a href="http://forums.macosxhints.com/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/forums.macosxhints.com/?referer=');">http://forums.macosxhints.com/</a></li>
</ul>
<hr noshade/>
<small>*opt-cmd-i anything, select source, copy icon, select desc, paste</small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/osx/how-to-create-icon-sets-in-os-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

