<?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>Web Design &#187; Web Design</title> <atom:link href="http://patjack.co.uk/category/web-design/feed/" rel="self" type="application/rss+xml" /><link>http://patjack.co.uk</link> <description>Patrick Robertson</description> <lastBuildDate>Sun, 29 Apr 2012 09:13:21 +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>Shortening URLs in-house</title><link>http://patjack.co.uk/shortening-urls-in-house/</link> <comments>http://patjack.co.uk/shortening-urls-in-house/#comments</comments> <pubDate>Thu, 27 May 2010 21:21:01 +0000</pubDate> <dc:creator>Patrick</dc:creator> <category><![CDATA[SEO]]></category> <category><![CDATA[Web Design]]></category> <category><![CDATA[google]]></category> <category><![CDATA[htaccess]]></category> <category><![CDATA[html]]></category> <category><![CDATA[php]]></category><guid
isPermaLink="false">http://patjack.co.uk/?p=427</guid> <description><![CDATA[All websites now use URL extensions that redirect for easy to remember URLs. A recent example is Google&#8217;s http://google.com/pacman &#8211; a simple / and one word is much easier to remember than say /google_pacman.html (which is still keeping it simple!) (I&#8217;m sure if you looked into it, the files aren&#8217;t actually stored in a /pacman [...]]]></description> <content:encoded><![CDATA[<p>All websites now use URL extensions that redirect for easy to remember URLs.</p><p>A recent example is Google&#8217;s <a
href="http://google.com/pacman">http://google.com/pacman</a> &#8211; a simple / and one word is much easier to remember than say /google_pacman.html (which is still keeping it simple!)<br
/> (I&#8217;m sure if you looked into it, the files aren&#8217;t actually stored in a /pacman folder either <img
src='http://patjack.co.uk/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</p><p>There <em>are</em> URL shortening methods out there, such as <a
href="http://bit.ly">http://bit.ly</a> and <a
href="http://tiny.cc">http://tiny.cc</a>, but I feel these don&#8217;t give you enough power for customisation. And what if you have your own domain that you want to use?!<br
/> <span
id="more-427"></span><br
/> I&#8217;ve made my own simple &#8216;Redirect Setup Script&#8217; that enables you to create redirects with the click of a button.<br
/> You can view a demo here: <a
href="http://patjack.co.uk/newurls">http://patjack.co.uk/newurls</a> (note this doesn&#8217;t actually set up any redirects on my site <img
src='http://patjack.co.uk/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ) and see how easy it is.</p><p>My method uses PHP that appends the redirect to your root .htaccess file, and uses mod_rewrite. An alternative method would be to use a meta redirect, which I&#8217;ve included in the downloadable folder for those that might not have mod_rewrite on their servers. The downside to the meta redirect is that you need to actually create the folder and index.html file, the .htaccess method just uses the root .htaccess file.</p><p>To swap between using the .htaccess mod_rewrite method and the meta re-direct method, just open up &#8216;process.php&#8217; and change the $use_htaccess from <span
style="color: #33d019;">TRUE</span> to <span
style="color: #ff0000;">FALSE</span>.</p><p>The script also uses REGEX to make sure you don&#8217;t use some silly extension, or input an invalid URL.</p><p>To use, just download the folder from <a
href="http://patjack.co.uk/files/redirect_script.zip">here</a></p><h3>A quick example</h3><p>I&#8217;ve set up a redirect for when I have a chocolate cake craving but don&#8217;t want to bake a whole cake. To see my secret, click through to <a
href="http://patjack.co.uk/cake">http://patjack.co.uk/cake</a>. Mmmmm&#8230;</p><p>Download: <a
href="http://patjack.co.uk/files/redirect_script.zip">Script.zip</a></p><p>Here&#8217;s what gets appended to your root .htaccess and the index.html files respectively</p><h4>.htaccess</h4><p><code><br
/> RedirectMatch /".$_YOUR_EXTENSION."/.* ".$_URL_GOES_HERE." [R=301,L]<br
/> RedirectMatch /".$_YOUR_EXTENSION." ".$_URL_GOES_HERE." [R=301,L]";<br
/> </code><br
/> There&#8217;s a need for two redirects to catch both cases where you may browse to example.com/extension (with no slash) example.com/extension/ (with a slash) or anything else &#8211; example.com/extension/index.html</p><h4>index.html</h4><p><code><br
/> &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;<br
/> &lt;head&gt;<br
/> &lt;title&gt;Redirect&lt;/title&gt;<br
/> &lt;meta http-equiv="refresh" content="0;URL=$_URL_GOES_HERE" /&gt;<br
/> &lt;/head&gt;<br
/> &lt;body&gt;<br
/> &lt;/body&gt;<br
/> &lt;/html&gt;<br
/> </code></p> ]]></content:encoded> <wfw:commentRss>http://patjack.co.uk/shortening-urls-in-house/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Batch compress all files in a folder with YUI Compressor</title><link>http://patjack.co.uk/batch-compress-all-files-in-a-folder-with-yui-compressor/</link> <comments>http://patjack.co.uk/batch-compress-all-files-in-a-folder-with-yui-compressor/#comments</comments> <pubDate>Mon, 24 May 2010 16:07:51 +0000</pubDate> <dc:creator>Patrick</dc:creator> <category><![CDATA[SEO]]></category> <category><![CDATA[Web Design]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[compress]]></category> <category><![CDATA[css]]></category> <category><![CDATA[google]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[script]]></category> <category><![CDATA[terminal]]></category><guid
isPermaLink="false">http://patjack.co.uk/?p=413</guid> <description><![CDATA[I&#8217;ve recently read up on the importance of site performance for search engine optimisation (SEO). Google is saying that this year (2010) it may start using the speed your site loads as a factor in determining where your site shows up in its results list. One great way of decreasing the load times of your [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve recently read up on the importance of site performance for search engine optimisation (SEO).</p><p>Google is saying that this year (2010) it may start using the speed your site loads as a factor in determining where your site shows up in its results list.</p><p>One great way of decreasing the load times of your site is to compress the CSS and Javascript.<br
/> <span
id="more-413"></span><br
/> Before&#8230;<br
/> <img
src="http://patjack.co.uk/wp/wp-content/uploads/2010/05/uncompressed-300x137.png" alt="Uncompressed Javascript File" title="Uncompressed Javascript File" width="300" height="137" class="aligncenter size-medium wp-image-415" /><br
/> After&#8230;<br
/> <img
src="http://patjack.co.uk/wp/wp-content/uploads/2010/05/compressed-300x62.png" alt="Compressed Javascript File" title="Compressed Javascript File" width="300" height="62" class="aligncenter size-medium wp-image-417" /></a></p><p>There are several methods out there, but Yahoo&#8217;s YUI Compressor is supposed to be the best.<br
/> The compressor is a java (.jar) file that you need to run from the command prompt or terminal. The biggest flaw in it&#8217;s design is that you can only compress one file at a time.</p><p>Here comes the solution!</p><p>I&#8217;ve created a small bash script (.sh) that you can double click to convert all the javascript / css files in a folder (and all folders recursively)</p><p>here it is:<br
/> <code><br
/> #!/bin/sh<br
/> for file in `find . -name "*.js"`<br
/> do<br
/> echo "Compressing $file …"<br
/> java -jar min.jar --type js -o $file $file<br
/> done<br
/> </code></p><p>The file&#8217;s pretty self explanatory; it finds all the files ending in .js (you can change this to .css for CSS files) and performs the compress action on each file.</p><p>To get this to work, you must make the script executable (download mine at the end of this post) and have the YUI Compressor file in the same directory as the batch.sh script (note that it needs to be called min.jar)</p><p>From terminal, you just need to go to the directory with the javascript files in and type<br
/> <code>./batch.sh</code><br
/> to run the script.<br
/> <img
src="http://patjack.co.uk/wp/wp-content/uploads/2010/05/processing.png" alt="YUI Compressor compressing javascript files in a folder" title="YUI Compressor compressing javascript files in a folder" width="550px" class="alignnone size-full wp-image-420" /></p><p>et voila!</p><h3 style="color:#ff6600">Update &#8211; an ever better option</h3><p>If you put the batch.sh file in your /usr/local/bin folder then you&#8217;ll be able to use the command anywhere from within terminal (it must be chmodded a+x) I&#8217;ve made a file called &#8216;yuicompress&#8217; which means, if placed in the /usr/local/bin folder (you need root access) you can type &#8216;yuicompress&#8217; in terminal to get the command to work!</p><p>Type<br
/> <code><br
/> yuicompress arg<br
/> </code><br
/> where arg is either &#8216;css&#8217; or &#8216;js&#8217; (no quotes) to compress CSS or JavaScript respectively.<br
/> The one thing you need to do with this new script is place the min.jar (or compressor.jar as I&#8217;ve renamed it) in a global place. I chose ~/Library/Application Support/YUICompressor/compressor.jar</p><p>Download the files below and place the yuicompress in /usr/local/bin, and the YUICompress folder in ~/Library/Application Support/YUICompressor/compressor.jar to get this to work from any older on your Mac/Unix box <img
src='http://patjack.co.uk/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>Downloads:<br
/> Script: <a
href="http://patjack.co.uk/files/batch.sh">Batch Convert for YUI Compressor</a><br
/> YUI Compressor: <a
href="http://patjack.co.uk/files/min.jar">YUI Compressor .jar file</a><br
/> Chmodded yuicompress script &amp; YUICompressor folder: <a
href=&#8221;http://patjack.co.uk/files/yuicompress.zip</p> ]]></content:encoded> <wfw:commentRss>http://patjack.co.uk/batch-compress-all-files-in-a-folder-with-yui-compressor/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Preloading images with css</title><link>http://patjack.co.uk/preloading-images-with-css/</link> <comments>http://patjack.co.uk/preloading-images-with-css/#comments</comments> <pubDate>Thu, 25 Sep 2008 07:03:02 +0000</pubDate> <dc:creator>Patrick</dc:creator> <category><![CDATA[Web Design]]></category> <category><![CDATA[css]]></category> <category><![CDATA[html]]></category> <category><![CDATA[images]]></category> <category><![CDATA[javascript]]></category><guid
isPermaLink="false">http://tyddynadda.co.uk/design/?p=71</guid> <description><![CDATA[The order in which images load when viewing a website fis always a tricky thing to get right. Usually, if you have any sort of javascript gallery for viewing images, these images will load first (as javascript normally loads first). This is always a pain if the main layout images have not yet loaded &#8211; [...]]]></description> <content:encoded><![CDATA[<p>The order in which images load when viewing a website fis always a tricky thing to get right. Usually, if you have any sort of javascript gallery for viewing images, these images will load first (as javascript normally loads first). This is always a pain if the main layout images have not yet loaded &#8211; you&#8217;ll get the javascript gallery appearing with none of the layout images.</p><p>There are plenty of solutions out there to set the order of image loading, and most solutions use javascript. Now to me, this is like trying to fight fire with fire; solving the problem of certain javascript images loading first with yet more javascript. But what&#8217;s wrong with javascript, surely a little more won&#8217;t harm anyone.<br
/> Well, javascript means more work for the client&#8217;s computer and makes loading times (only a fraction) slower. Also, if you&#8217;re not that familiar with javascript, is can be quite daunting to keep adding this.object(); and that.var=10; to your code.</p><p>I&#8217;ve come up with a far simpler and easier method to solve the problem using only valid CSS and good old HTML.<br
/> <span
id="more-71"></span><br
/> My trick uses the <strong>display:none;</strong> style.</p><p>What you need to do is add the img tag:</p><div
class="code"><code>&lt;img src="images/my_image.jpg style="display:none;" alt="My brilliant image" /&gt;</code></div><p>straight after the opening &lt;body&gt; tag. This will be the first thing your browser picks up, meaning it should be the first thing your browser loads (even though it&#8217;s not displayed!) Now when the image crops up again later on in the source, it will have already been loaded into the cache and can be displayed instantly.</p><p>A simple, valid, cross-browser compliant solution.</p> ]]></content:encoded> <wfw:commentRss>http://patjack.co.uk/preloading-images-with-css/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Integrating thickbox with imageflow</title><link>http://patjack.co.uk/integrating-thickbox-with-imageflow/</link> <comments>http://patjack.co.uk/integrating-thickbox-with-imageflow/#comments</comments> <pubDate>Tue, 05 Aug 2008 07:07:05 +0000</pubDate> <dc:creator>Patrick</dc:creator> <category><![CDATA[Web Design]]></category> <category><![CDATA[imageflow]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[thickbox]]></category><guid
isPermaLink="false">http://tyddynadda.co.uk/design/?p=4</guid> <description><![CDATA[Update: Modified to work with version 1.3 of imageflow - a simple hack If you already use thickbox on your site, there&#8217;s a simple way to integrate it with the ImageFlow script by Finn Rudolph. Imageflow is a mimic of Apple&#8217;s cover flow for Mac OS X and iTunes, and combining it with Thickbox is [...]]]></description> <content:encoded><![CDATA[<h2 style="color:#FF0000;">Update: Modified to work with version 1.3 of imageflow</h2><h2>- a simple hack</h2><p>If you already use thickbox on your site, there&#8217;s a simple way to integrate it with the <a
href="http://imageflow.finnrudolph.de/">ImageFlow</a> script by Finn Rudolph.</p><p>Imageflow is a mimic of Apple&#8217;s cover flow for Mac OS X and iTunes, and combining it with Thickbox is similar to QuickLook for the Mac.<br
/> <span
id="more-4"></span></p><h2>Step 1</h2><p>Make sure you have the thickbox.js, jquery.js and thickbox.css scripts uploaded to your server, and referenced in the head of your web page.</p><div
class="code"><code>&lt;script type="text/javascript" src="/js/jquery.js"&gt;&lt;/script&gt;<br
/> &lt;script type="text/javascript" src="/js/thickbox.js"&gt;&lt;/script&gt;<br
/> &lt;link rel="stylesheet" type="text/css" href="/styles/thickbox.css" media="screen" /&gt;</code></div><h2>Step 2</h2><p>Change the longdesc attribute for each image in the imageflow div to:</p><div
class="code"><code>javascript:tb_show( 'caption',  'images/image.jpg', 'slideshow1' )</code></div><p>where &#8216;caption&#8217; is the caption of the image and &#8216;images/image.jpg&#8217; is the URL of the image. Unfortunately the &#8216;slideshow1&#8242; &#8211; gallery option doesn&#8217;t seem to work with this implementation. I&#8217;m looking into it, but in the mean time if you have any ideas let me know!</p><p></p><h2>Step 3</h2><p>Small CSS fixes: Open thickbox.css, and change the z-index of #TB_window to  10200 (higher than 10002). The z-index of the #scrollbar and #slider in imageflow.css are 10001 and 10002 respectively. #TB_window must have a z-index higher than both of these.</p><p>Change the z-index of #TB_overlay to 10199. This is to make sure the (grey) background is on top of the slider and scrollbar as well.</p><h2>Step 4</h2><p>There is no step 4 <img
src='http://patjack.co.uk/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br
/> You can preview my hack <a
href="http://patjack.co.uk/websites/">here</a></p><p>OR &#8211; to make your life even easier &#8211; you can download the whole package <a
href="http://patjack.co.uk/files/imageflow1.3_thickbox.zip">here</a> [106Kb]<br
/> <span
style="color:#ff000">** Version 1.3</span></p><p>I&#8217;m here for support, and will try to update to the latest version of Imageflow whenever it&#8217;s released. If you appreciate my work, then please do donate &#8211; it&#8217;s definitely not &#8216;free&#8217; for me to do all this time-consuming stuff <img
src='http://patjack.co.uk/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><div
style="text-align: right; margin-top: -20px;"><form
action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input
type="hidden" name="cmd" value="_donations"> <input
type="hidden" name="business" value="7MJHCZAQF5KEU"> <input
type="hidden" name="lc" value="GB"> <input
type="hidden" name="item_name" value="Quicksilver 1Password Plugin"> <input
type="hidden" name="currency_code" value="USD"> <input
type="hidden" name="bn" value="PP-DonationsBF:btn_donate_LG.gif:NonHosted"> <input
type="image" src="https://www.paypal.com/en_GB/i/btn/btn_donate_LG.gif" style="border:none;" name="submit" alt="PayPal - The safer, easier way to pay online."> <img
alt="Donate to Quicksilver 1Password Plugin" style="border:none;" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1"><br
/></form></div> ]]></content:encoded> <wfw:commentRss>http://patjack.co.uk/integrating-thickbox-with-imageflow/feed/</wfw:commentRss> <slash:comments>34</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)

Served from: patjack.co.uk @ 2012-05-19 12:10:07 -->
