<?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/"
	>

<channel>
	<title>Nigel McBryde</title>
	<atom:link href="http://nigel.mcbryde.com.au/feed/" rel="self" type="application/rss+xml" />
	<link>http://nigel.mcbryde.com.au</link>
	<description>Warmed by the Drift</description>
	<pubDate>Wed, 18 Aug 2010 08:34:55 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Stacey - a PHP Flat file CMS</title>
		<link>http://nigel.mcbryde.com.au/2010/08/stacey-a-php-flat-file-cms/</link>
		<comments>http://nigel.mcbryde.com.au/2010/08/stacey-a-php-flat-file-cms/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 08:34:55 +0000</pubDate>
		<dc:creator>nigel</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://nigel.mcbryde.com.au/?p=311</guid>
		<description><![CDATA[In my last post I promised to quickly run down my reasons for using the simple, flat file Content Management system Stacey to manage my portfolio.
Why flat file?
As I am sure we are all aware, a traditional CMS is software that allows you to update your content through a user-friendly interface, and generally stores the [...]]]></description>
			<content:encoded><![CDATA[<p>In my last post I promised to quickly run down my reasons for using the simple, flat file Content Management system <a href="http://www.staceyapp.com/" target="_blank">Stacey</a> to manage <a title="Nigel McBryde's Portfolio" href="http://www.mcbryde.com.au/" target="_blank">my portfolio</a>.</p>
<p><strong>Why flat file?</strong></p>
<p>As I am sure we are all aware, a traditional CMS is software that allows you to update your content through a user-friendly interface, and generally stores the content in some sort of database. Reasons to use this style of Content Management System includes being easy to use, they enable your site to be accessible from any browser, and you can leverage already existing code to extend your site&#8217;s functionality easily.</p>
<p>Sounds good, however there are as many downsides, which I have learned over many years of using a diverse range of software packages both commercial and open source. For one, being a technically savvy computer user, there is little advantage for myself to have a web-based interface as all of my development work is done from my home computer or my laptop. An interface can also be quite inflexible, getting a design pixel-perfect is often quite a chore, and while they are more convenient for an editors point of view from a development aspect they are more challenging due to the existence of a database. Finally, and perhaps most importantly, you cannot easily track and manage the information using a version control management tool such as Git.</p>
<p>A flat file system by contrast, stores all content within a simple file system rather than a database. This allows content as well as structure to be tracked and deployed easily. From a pure efficiency standpoint flat file systems are awesome. I can make a change to my content on my local machine using a text editor and <a href="http://daringfireball.net/projects/markdown/" target="_blank">Markdown</a>, push up to my external Git repo, and deploy to my server in <em>seconds</em> without having to touch a database management interface or FTP.</p>
<p>The main thing that I have learned is that while CMS&#8217;s are crucial for some purposes, they are actually overcomplicating and problematic for others. Learning where this line is definitely important.</p>
<p><strong>Why Stacey?</strong></p>
<p>There are a few reasons, because its designed for designers, the developer is Australian (biased I know), is simple to use and extend, and also I just really like the bare-bones, minimalistic style.</p>
]]></content:encoded>
			<wfw:commentRss>http://nigel.mcbryde.com.au/2010/08/stacey-a-php-flat-file-cms/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Portfolio update</title>
		<link>http://nigel.mcbryde.com.au/2010/07/portfolio-update/</link>
		<comments>http://nigel.mcbryde.com.au/2010/07/portfolio-update/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 13:16:05 +0000</pubDate>
		<dc:creator>nigel</dc:creator>
		
		<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://nigel.mcbryde.com.au/?p=297</guid>
		<description><![CDATA[I would like to quickly introduce my new portfolio. I used a simple and elegant content management system called Stacey to structure the information, and I will go into the reasons behind this in a later post. For now please have a look and feel free to give feedback.
]]></description>
			<content:encoded><![CDATA[<p>I would like to quickly introduce my new <a title="Nigel McBryde Portfolio" href="http://www.mcbryde.com.au" target="_self">portfolio</a>. I used a simple and elegant content management system called <a href="http://www.staceyapp.com/" target="_self">Stacey</a> to structure the information, and I will go into the reasons behind this in a later post. For now please have a look and feel free to give feedback.</p>
]]></content:encoded>
			<wfw:commentRss>http://nigel.mcbryde.com.au/2010/07/portfolio-update/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Polaroid</title>
		<link>http://nigel.mcbryde.com.au/2009/03/polaroid/</link>
		<comments>http://nigel.mcbryde.com.au/2009/03/polaroid/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 06:30:08 +0000</pubDate>
		<dc:creator>nigel</dc:creator>
		
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://nigel.mcbryde.com.au/?p=260</guid>
		<description><![CDATA[ 
Found a cool application called polaroid. Check it out.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://nigel.mcbryde.com.au/wp-content/uploads/2009/03/polaroid_tim.jpg"><img class="alignleft size-full wp-image-274" src="http://nigel.mcbryde.com.au/wp-content/uploads/2009/03/polaroid_tim.jpg" alt="polaroid_tim" width="192" height="198" /></a><a href="http://nigel.mcbryde.com.au/wp-content/uploads/2009/03/polaroid_rocks.jpg"><img class="alignleft size-full wp-image-276" src="http://nigel.mcbryde.com.au/wp-content/uploads/2009/03/polaroid_rocks.jpg" alt="polaroid_rocks" width="192" height="197" /></a> <a href="http://nigel.mcbryde.com.au/wp-content/uploads/2009/03/polaroid_lach.jpg"><img class="alignleft size-full wp-image-275" src="http://nigel.mcbryde.com.au/wp-content/uploads/2009/03/polaroid_lach.jpg" alt="polaroid_lach" width="192" height="198" /></a></p>
<p>Found a cool application called <a href="http://www.poladroid.net/">polaroid</a>. Check it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://nigel.mcbryde.com.au/2009/03/polaroid/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Working with SSL in Codeigniter</title>
		<link>http://nigel.mcbryde.com.au/2009/03/working-with-ssl-in-codeigniter/</link>
		<comments>http://nigel.mcbryde.com.au/2009/03/working-with-ssl-in-codeigniter/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 04:49:21 +0000</pubDate>
		<dc:creator>nigel</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://nigel.mcbryde.com.au/?p=239</guid>
		<description><![CDATA[For the best part of 3 months I&#8217;ve been trying to find an elegant way to switch between http:// and https:// for certain pages. I crawled the forums and found a number of solutions. The first was to use the .htaccess file and mod_rewrite to rewrite the url. This solution was fine on one server [...]]]></description>
			<content:encoded><![CDATA[<p>For the best part of 3 months I&#8217;ve been trying to find an elegant way to switch between http:// and https:// for certain pages. I crawled the forums and found a number of solutions. The first was to use the .htaccess file and mod_rewrite to rewrite the url. This solution was fine on one server but I had to switch recently and suddenly it was failing miserably for no reason that I could determine, so I was forced to find another way. As always, finding another way is a _good_ thing, and the way I found is nicer, easier and much more dynamic.</p>
<p>Create a file in application/helper called ssl_helper.php</p>
<pre><code>if (!function_exists('force_ssl'))
{
    function force_ssl()
    {
        $CI =&amp; get_instance();
        $CI-&gt;config-&gt;config['base_url'] =
                 str_replace('http://', 'https://',
                 $CI-&gt;config-&gt;config['base_url']);
        if ($_SERVER['SERVER_PORT'] != 443)
        {
            redirect($CI-&gt;uri-&gt;uri_string());
        }
    }
}

function remove_ssl()
{
    $CI =&amp; get_instance();
    $CI-&gt;config-&gt;config['base_url'] =
                  str_replace('https://', 'http://',
                  $CI-&gt;config-&gt;config['base_url']);
    if ($_SERVER['SERVER_PORT'] != 80)
    {
        redirect($CI-&gt;uri-&gt;uri_string());
    }
}</code></pre>
<p>Load the helper, then in the constructor for any controller that requires ssl, simply insert:</p>
<pre><code>force_ssl();</code></pre>
<p>In every controller that you don&#8217;t want to have ssl put:</p>
<pre><code>if (function_exists('force_ssl')) remove_ssl();</code></pre>
<p>And there you go. I found the force_ssl function on the Codeigniter forum, so all credit goes to the <a href="http://codeigniter.com/forums/viewthread/83154/">original poster</a>. All I did was provide a function to switch back.</p>
]]></content:encoded>
			<wfw:commentRss>http://nigel.mcbryde.com.au/2009/03/working-with-ssl-in-codeigniter/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Comment Trick</title>
		<link>http://nigel.mcbryde.com.au/2009/03/comment-trick/</link>
		<comments>http://nigel.mcbryde.com.au/2009/03/comment-trick/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 23:36:41 +0000</pubDate>
		<dc:creator>nigel</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://nigelblog.dreamhosters.com/?p=232</guid>
		<description><![CDATA[Below is a trick for quickly commenting and uncommenting optional sections of code, something I use often for switching between multiple database setups.
/* Development settings
define(&#8217;DB_NAME&#8217;, &#8216;blag_development&#8217;);
define(&#8217;DB_USER&#8217;, &#8216;username&#8217;);
define(&#8217;DB_PASSWORD&#8217;, &#8216;password&#8217;);  //*/
to
//* Development settings 
define(&#8217;DB_NAME&#8217;, &#8216;blag_development&#8217;);
define(&#8217;DB_USER&#8217;, &#8216;username&#8217;);
define(&#8217;DB_PASSWORD&#8217;, &#8216;password&#8217;);  //*/
You will note that the only change here is the extra / at the start of the top [...]]]></description>
			<content:encoded><![CDATA[<p>Below is a trick for quickly commenting and uncommenting optional sections of code, something I use often for switching between multiple database setups.</p>
<p><code><span class="comment">/* Development settings<br />
define(&#8217;DB_NAME&#8217;, &#8216;blag_development&#8217;);<br />
define(&#8217;DB_USER&#8217;, &#8216;username&#8217;);<br />
define(&#8217;DB_PASSWORD&#8217;, &#8216;password&#8217;);  //*/</span></code><br />
to<br />
<code><span class="comment">//* Development settings </span><br />
define(&#8217;DB_NAME&#8217;, &#8216;blag_development&#8217;);<br />
define(&#8217;DB_USER&#8217;, &#8216;username&#8217;);<br />
define(&#8217;DB_PASSWORD&#8217;, &#8216;password&#8217;);  <span class="comment">//*/</span></code><br />
You will note that the only change here is the extra / at the start of the top line, which turns the block comment into a line comment and breaks the block comment, uncommenting the desired sections. The double slash before the closing */ ensures that the closing block comment does not break the code.</p>
]]></content:encoded>
			<wfw:commentRss>http://nigel.mcbryde.com.au/2009/03/comment-trick/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Javascript Map</title>
		<link>http://nigel.mcbryde.com.au/2009/01/javascript-map/</link>
		<comments>http://nigel.mcbryde.com.au/2009/01/javascript-map/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 04:42:15 +0000</pubDate>
		<dc:creator>nigel</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://nigel.mcbryde.com.au/?p=217</guid>
		<description><![CDATA[Back in 2006 I decided to teach myself some Javascript and one of  my projects for doing this was to create a simple draggable map window. This was about the time that Google maps was starting to gain awareness, which may have been what inspired the exercise. It was a fun activity, great way to [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;"><a href="http://nigel.mcbryde.com.au/wp-content/uploads/2009/01/screenshot1.jpg"><img class="alignleft size-full wp-image-225" src="http://nigel.mcbryde.com.au/wp-content/uploads/2009/01/screenshot1.jpg" alt="screenshot1" width="352" height="416" /></a>Back in 2006 I decided to teach myself some Javascript and one of  my projects for doing this was to create a simple draggable map window. This was about the time that Google maps was starting to gain awareness, which may have been what inspired the exercise. It was a fun activity, great way to exercise my math skills, and taught me about DOM manipulation with Javascript. It was a hard going at the time and although I&#8217;m sure I didn&#8217;t do it in a very efficient, correct, or scalable way I was happy with the outcome. Check out the live demo <a href="http://mcbryde.com.au/map" target="_blank">here</a>.</p>
<p style="text-align: left;"><strong>Notes:</strong></p>
<p style="text-align: left;">The image I used originally was a little boring so I updated it to this cool pixel-art piece by <a href="http://pixeljoint.com/p/6741.htm" target="_blank">Yuriy Gusev</a>.</p>
<p style="text-align: left;">I never coded it to work in Internet Explorer, so you have to view it in FireFox or Chrome for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://nigel.mcbryde.com.au/2009/01/javascript-map/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Document automation</title>
		<link>http://nigel.mcbryde.com.au/2009/01/document-automation/</link>
		<comments>http://nigel.mcbryde.com.au/2009/01/document-automation/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 13:23:29 +0000</pubDate>
		<dc:creator>nigel</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://nigel.mcbryde.com.au/?p=212</guid>
		<description><![CDATA[
I&#8217;m just putting some finishing touches on the content management system for the Growth Graph website which will go live in a couple of weeks. I wanted a system for generating labels, reciepts, and invoices incorperated into the content management system in a way that can be flexibly automated. Right now it&#8217;s only a fairly [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-178" src="http://nigel.mcbryde.com.au/wp-content/uploads/2009/01/admin_header.jpg" alt="admin_header" width="670" height="124" /></p>
<p>I&#8217;m just putting some finishing touches on the content management system for the Growth Graph website which will go live in a couple of weeks. I wanted a system for generating labels, reciepts, and invoices incorperated into the content management system in a way that can be <em>flexibly </em>automated. Right now it&#8217;s only a fairly bare bones functionality that will require server access and some technical skills to operate well, with the interface coming in the next phase of development.</p>
<p>I needed the ability to generate two types of documents:</p>
<ul>
<li>Scalable Vector Graphic (SVG) files for the labels</li>
<li>Office Documents for reciepts and invoices (eg .doc, .pdf)</li>
</ul>
<h2>The labels</h2>
<p>SVG is a language for generating a vector image and because it is basic XML markup it is very easy to make any customized document once you have a template. Simply create a label template with keywords which will be scanned for and then replaced. The scan, replace and download I did in about 7 lines of codeigniter PHP. Have a look at the layout of <a href="http://nigel.mcbryde.com.au/wp-content/uploads/2009/01/label_template.jpg">my label template</a> for an example, fitted exactly to the size of my label printer.</p>
<h2>The office documents</h2>
<p>I decided to try something I had been thinking about for a while and had some success implementing in Java; using an open XML document format so that I could work with the document in a similar way to that described above. The choice of document format was between the new Microsoft docx and the OpenOffice odt. Odt looked simpler so I went with it, though when it comes down to it both are just zip files containing a bunch of XML and styles. All you need to do to work with such files is to change the extension to &#8216;.zip&#8217;, open it with an archive tool and remove the &#8216;content.xml&#8217; and paste that into a folder. A program can then copy the original office document and then replace the xml file with a new one with the keywords replaced.</p>
<p>The trick was then to then set this up with a large number of orders with a number of documents, then compile all these documents into a single zip file and push it down the pipes (SSL certified and encrypted for sensitive customer data) to a computer with a program that will pull it all back out again and print it. This simple system, kickstarted daily with a cronjob, will allow me to walk into the office to a pile of orders from the day before, ready to be shipped.</p>
]]></content:encoded>
			<wfw:commentRss>http://nigel.mcbryde.com.au/2009/01/document-automation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New Year updates</title>
		<link>http://nigel.mcbryde.com.au/2009/01/new-year-updates/</link>
		<comments>http://nigel.mcbryde.com.au/2009/01/new-year-updates/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 05:28:48 +0000</pubDate>
		<dc:creator>nigel</dc:creator>
		
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://nigel.mcbryde.com.au/?p=159</guid>
		<description><![CDATA[I just wanted to post about a bunch of small changes made to the site recently, changes of the kind that would never be noticed unless they were pointed out.

The code for the navigation bar at the top of the page has been updated. When writing the original code I never gave myself enought time [...]]]></description>
			<content:encoded><![CDATA[<p>I just wanted to post about a bunch of small changes made to the site recently, changes of the kind that would never be noticed unless they were pointed out.</p>
<ul>
<li>The <a href="http://nigel.mcbryde.com.au/wp-content/themes/think/lib/js/nav.js" target="_blank">code</a> for the navigation bar at the top of the page has been updated<strong>.</strong> When writing the original code I never gave myself enought time to clean, document, or refactor the code properly so I had been meaning to get this done for a while now.</li>
<li>I have just updated the blogging platform (<a href="http://wordpress.org/">wordpress</a>). The 2.7 version of wordpress came out some time ago, and I had been reluctant to upgrade. The current version had been working for me very nicely, and I had no real motivation to upgrade because it seemed like a bit of a chore. I discovered recenlty a wordpress plugin called <a href="http://www.zirona.com/software/wordpress-instant-upgrade/" target="_blank">instantupgrade </a>which basically does the job for you in a matter of seconds. It worked a treat, and though there will be no difference on the front end, I can now enjoy the benefits of the greatly improved back end user-interface. Very nice!</li>
<li>I have also put up some of my layout drafts for both this blog and the Growth Graph website. See them at my <a href="http://nigelmcbryde.deviantart.com/gallery/" target="_blank">Deviant Art Gallery</a>.</li>
</ul>
<p>Also, note that the navbar clicked over for the first time. Happy new year!</p>
]]></content:encoded>
			<wfw:commentRss>http://nigel.mcbryde.com.au/2009/01/new-year-updates/feed/</wfw:commentRss>
		</item>
		<item>
		<title>String theory</title>
		<link>http://nigel.mcbryde.com.au/2008/12/string-theory/</link>
		<comments>http://nigel.mcbryde.com.au/2008/12/string-theory/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 08:57:48 +0000</pubDate>
		<dc:creator>nigel</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://nigel.mcbryde.com.au/?p=112</guid>
		<description><![CDATA[I realised the other day that my knowledge of the most basic unit of php, the humble string, was incomplete! Unbeknownst to me here exists an alternative syntax. Introduced in php 4 the Heredoc syntax is a much easier way of dealing with large strings.
$huh = 'theoretical physics';
echo &#60;&#60;&#60;EOT
String theory is a still-developing approach to [...]]]></description>
			<content:encoded><![CDATA[<p>I realised the other day that my knowledge of the most basic unit of php, the humble string, was incomplete! Unbeknownst to me here exists an <em>alternative syntax.</em> Introduced in php 4 the Heredoc syntax is a much easier way of dealing with large strings.<br />
<code>$huh = 'theoretical physics';<br />
echo &lt;&lt;&lt;EOT<br />
String theory is a still-developing approach to $huh, whose original building blocks are one-dimensional extended objects called strings.<br />
EOT;</code>Like with double quotes php will parse the given string looking for variables and other syntax, replacing them as it goes.<br />
For the sake of completeness Nowdoc was included in php 5.3, being to single quotes what Heredoc is to double quotes. In other words, Nowdoc allows you to print a string without the fuss and overhead of parsing it first.<br />
<code>echo &lt;&lt;&lt;'EOT'</code>Throw some single quotes around the EOT and away you go! See the <a href="http://au.php.net/language.types.string" target="_blank">php manual</a> for more.</p>
<p>Peace</p>
]]></content:encoded>
			<wfw:commentRss>http://nigel.mcbryde.com.au/2008/12/string-theory/feed/</wfw:commentRss>
		</item>
		<item>
		<title>deviantART Portfolio</title>
		<link>http://nigel.mcbryde.com.au/2008/11/deviantart-portfolio/</link>
		<comments>http://nigel.mcbryde.com.au/2008/11/deviantart-portfolio/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 02:56:30 +0000</pubDate>
		<dc:creator>nigel</dc:creator>
		
		<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://nigel.mcbryde.com.au/?p=84</guid>
		<description><![CDATA[I&#8217;ve just started up a deviantART account where, in lieu of an actual portfolio for now, I&#8217;ll post all of my work.
Check it out here.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just started up a deviantART account where, in lieu of an actual portfolio <em>for now</em>, I&#8217;ll post all of my work.</p>
<p>Check it out <a href="http://nigelmcbryde.deviantart.com/gallery/" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nigel.mcbryde.com.au/2008/11/deviantart-portfolio/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
