<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: Automatthew's Code Snippets</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Fri, 25 Jul 2008 12:41:07 GMT</pubDate>
    <description>DZone Snippets: Automatthew's Code Snippets</description>
    <item>
      <title>mzscheme 352 Portfile (to get Arc working on OS X)</title>
      <link>http://snippets.dzone.com/posts/show/5056</link>
      <description># $Id$&lt;br /&gt;&lt;br /&gt;PortSystem 1.0&lt;br /&gt;&lt;br /&gt;name            mzscheme&lt;br /&gt;version         352&lt;br /&gt;categories      lang scheme&lt;br /&gt;platforms       darwin&lt;br /&gt;maintainers     nomaintainer&lt;br /&gt;description     MzScheme is an implementation of the Scheme programming language&lt;br /&gt;long_description    ${description}&lt;br /&gt;&lt;br /&gt;homepage        http://www.plt-scheme.org/software/mzscheme/&lt;br /&gt;set subdir      ${version}/mz/&lt;br /&gt;master_sites \&lt;br /&gt;  http://download.plt-scheme.org/bundles/${subdir} \&lt;br /&gt;  http://plt.cs.uchicago.edu/bundles/${subdir} \&lt;br /&gt;  http://www.cs.utah.edu/plt/download/${subdir} \&lt;br /&gt;  ftp://archive.informatik.uni-tuebingen.de/unix/language/plt/${subdir} \&lt;br /&gt;  ftp://infogroep.be/pub/plt/bundles/${subdir} \&lt;br /&gt;  http://gd.tuwien.ac.at/languages/scheme/plt/${subdir}&lt;br /&gt;distfiles       mz-${version}-src-unix.tgz&lt;br /&gt;checksums       md5 218bad0defbdbb72d94d8a3fb4fa6545&lt;br /&gt;&lt;br /&gt;depends_lib     port:jpeg \&lt;br /&gt;                port:libpng \&lt;br /&gt;                port:libiconv&lt;br /&gt;&lt;br /&gt;worksrcdir		plt/src&lt;br /&gt;&lt;br /&gt;post-patch {&lt;br /&gt;	reinplace "s|collects|share/mzscheme|g" \&lt;br /&gt;		${worksrcpath}/mzscheme/src/startup.ss \&lt;br /&gt;		${worksrcpath}/mzscheme/src/startup.inc&lt;br /&gt;	reinplace "s|~/Library/PLT Scheme/|${prefix}/share/mzscheme/|g" \&lt;br /&gt;		${worksrcpath}/mzscheme/src/file.c&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;configure.env	CFLAGS="-I${prefix}/include" \&lt;br /&gt;				CPPFLAGS="-I${prefix}/include" \&lt;br /&gt;				LDFLAGS="-L${prefix}/lib"&lt;br /&gt;&lt;br /&gt;destroot.destdir	prefix=${destroot}${prefix}&lt;br /&gt;post-destroot	{&lt;br /&gt;	file delete -force ${destroot}${prefix}/install \&lt;br /&gt;		${destroot}${prefix}/share/man&lt;br /&gt;	file rename ${destroot}${prefix}/collects \&lt;br /&gt;		${destroot}${prefix}/share/mzscheme&lt;br /&gt;	xinstall -m 755 -d ${destroot}${prefix}/share/doc/ \&lt;br /&gt;		${destroot}${prefix}/share/mzscheme/${version}/&lt;br /&gt;	system "cd ${destroot}${prefix}/share/mzscheme/${version} &amp;&amp; ln -s .. collects"&lt;br /&gt;	file rename ${destroot}${prefix}/man \&lt;br /&gt;		${destroot}${prefix}/share/man&lt;br /&gt;	file rename ${destroot}${prefix}/doc \&lt;br /&gt;		${destroot}${prefix}/share/doc/mzscheme&lt;br /&gt;	file delete -force ${destroot}${prefix}/lib/buildinfo&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;</description>
      <pubDate>Wed, 30 Jan 2008 17:08:23 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5056</guid>
      <author>automatthew (Matthew King)</author>
    </item>
    <item>
      <title>Generate WEP hex key from plaintext</title>
      <link>http://snippets.dzone.com/posts/show/5026</link>
      <description># pad the plaintext to 64 characters, then get an MD5 digest&lt;br /&gt;# 128 bits, duh.&lt;br /&gt;&lt;br /&gt;require 'digest/md5'&lt;br /&gt;&lt;br /&gt;def pad(text)&lt;br /&gt;   v = text * (1 + (64 / text.length))&lt;br /&gt;   v[0,64]&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;def wep_key(text)&lt;br /&gt;   Digest::MD5.hexdigest(pad(text))&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</description>
      <pubDate>Tue, 22 Jan 2008 15:29:58 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5026</guid>
      <author>automatthew (Matthew King)</author>
    </item>
    <item>
      <title>Environment-specific configuration in Merb</title>
      <link>http://snippets.dzone.com/posts/show/4116</link>
      <description>// this goes at the bottom of dist/conf/merb_init.rb&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;case Merb::Server.config[:environment]&lt;br /&gt;when 'development'&lt;br /&gt;  # do some stuff&lt;br /&gt;when 'production'&lt;br /&gt;  # do other stuff&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 08 Jun 2007 02:16:25 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4116</guid>
      <author>automatthew (Matthew King)</author>
    </item>
    <item>
      <title>Mac OS X launchd plist to run PHP fcgi</title>
      <link>http://snippets.dzone.com/posts/show/4115</link>
      <description>&lt;code&gt;&lt;br /&gt;&lt;?xml version='1.0' encoding='UTF-8'?&gt;&lt;br /&gt;&lt;!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN&lt;br /&gt;http://www.apple.com/DTDs/PropertyList-1.0.dtd &gt;&lt;br /&gt;&lt;plist version='1.0'&gt;&lt;br /&gt;	&lt;dict&gt;&lt;br /&gt;	&lt;key&gt;Label&lt;/key&gt;&lt;string&gt;com.automatthew.php&lt;/string&gt;&lt;br /&gt;	&lt;key&gt;ProgramArguments&lt;/key&gt;&lt;br /&gt;	&lt;array&gt;&lt;br /&gt;	        &lt;string&gt;/opt/php/bin/php&lt;/string&gt;&lt;br /&gt;	        &lt;string&gt;-b 127.0.0.1:9000&lt;/string&gt;&lt;br /&gt;	        &lt;string&gt;-q&lt;/string&gt;&lt;br /&gt;	&lt;/array&gt;&lt;br /&gt;	&lt;key&gt;EnvironmentVariables&lt;/key&gt;&lt;br /&gt;	&lt;dict&gt;&lt;br /&gt;	        &lt;key&gt;PHP_FCGI_CHILDREN&lt;/key&gt;&lt;br /&gt;	        &lt;string&gt;4&lt;/string&gt;&lt;br /&gt;	&lt;/dict&gt;&lt;br /&gt;	&lt;key&gt;Debug&lt;/key&gt;&lt;false/&gt;&lt;br /&gt;	&lt;key&gt;Disabled&lt;/key&gt;&lt;false/&gt;&lt;br /&gt;	&lt;key&gt;OnDemand&lt;/key&gt;&lt;false/&gt;&lt;br /&gt;	&lt;key&gt;RunAtLoad&lt;/key&gt;&lt;false/&gt;&lt;br /&gt;&lt;/dict&gt;&lt;br /&gt;&lt;/plist&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 07 Jun 2007 19:51:36 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4115</guid>
      <author>automatthew (Matthew King)</author>
    </item>
  </channel>
</rss>
