<?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>Ian Hoar – Passion for Technology – Geeking Out &#187; tips</title>
	<atom:link href="http://www.ianhoar.com/category/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ianhoar.com</link>
	<description>Technology, Web, Toys, Games, Design, Entertainment, Gadgets, &#38; Geeking Out</description>
	<lastBuildDate>Mon, 16 Jan 2012 03:51:52 +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>Creating subdomains and custom server names with MAMP</title>
		<link>http://www.ianhoar.com/2011/10/26/creating-subdomains-and-custom-server-names-with-mamp/</link>
		<comments>http://www.ianhoar.com/2011/10/26/creating-subdomains-and-custom-server-names-with-mamp/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 03:29:49 +0000</pubDate>
		<dc:creator>Ian Hoar</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[MAMP]]></category>
		<category><![CDATA[subdomains]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.ianhoar.com/?p=4515</guid>
		<description><![CDATA[My server of choice is Apache, but I&#8217;m no web administrator, so I use MAMP a great quick install Apache, MySQL and PHP stack. Recently I have found the need for local subdomains like dev.localhost. With a local subdomain you can more accurately simulate your live environment because you can link absolutely to the root [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-4536" title="MAMP Apache" src="http://www.ianhoar.com/wp-content/uploads/2011/10/MAMP-Apache.png" alt="MAMP Apache" width="200" height="200" />My server of choice is Apache, but I&#8217;m no web administrator, so I use <a href="http://www.mamp.info">MAMP</a> a great quick install Apache, MySQL and PHP stack. Recently I have found the need for local subdomains like <strong>dev.localhost</strong>. With a local subdomain you can more accurately simulate your live environment because you can link absolutely to the root of your server. These simple directions are specific to the MAMP configuration, but the same steps can be used on any Apache WAMP and LAMP setups with the exception of the location of the configuration file, so lets get started.</p>
<p><span id="more-4515"></span>Open the finder and go to:</p>
<p><strong>Applications/MAMP/conf/apache/</strong></p>
<p>The file you want to edit is <strong>httpd.conf</strong>, if you are not using MAMP you can search for this file and then follow the directions below.</p>
<p>Open the httpd.conf in the editor of your choice. Once you have it open search for &#8220;<strong>Listen 80</strong>&#8220;. Paste the example below into your config being careful to either paste over Listen 80 or do not copy the Listen 80 part from the example below. These directions are assuming a default MAMP httpd.conf. Replace <strong>username</strong> with your own username.</p>
<pre class="brush: bash; title: ; notranslate">
Listen 80

NameVirtualHost *
&lt;VirtualHost *&gt;
ServerName dev.localhost
DocumentRoot /Users/username/Sites/dev
&lt;Directory /&gt;
Options FollowSymLinks
AllowOverride None
&lt;/Directory&gt;
&lt;Directory /Users/username/Sites/dev&gt;
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
&lt;/Directory&gt;
&lt;/VirtualHost&gt;

&lt;VirtualHost *&gt;
ServerName coolsite
DocumentRoot /Users/username/Sites/coolsite
&lt;Directory /&gt;
Options FollowSymLinks
AllowOverride None
&lt;/Directory&gt;
&lt;Directory /Users/username/Sites/coolsite&gt;
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
&lt;/Directory&gt;
&lt;/VirtualHost&gt;

&lt;VirtualHost *&gt;
ServerName localhost
DocumentRoot /Users/username/Sites/
&lt;Directory /&gt;
Options FollowSymLinks
AllowOverride None
&lt;/Directory&gt;
&lt;Directory /Users/username/Sites/&gt;
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
&lt;/Directory&gt;
&lt;/VirtualHost&gt;
</pre>
<p>So what we have here is three different server names and paths. You can use subdomains like <strong>dev.localhost</strong> or you can even use a full name like <strong>coolsite</strong>. The reason we specify <strong>localhost</strong> and point it to the root of the sites folder is so localhost still works properly when you type it in the browser.</p>
<p>There is one step left. Open the terminal from your <strong>Applications/Utilities</strong> directory in the finder or search for it in spotlight. You will need to edit your <strong>hosts file</strong>, I use the VI editor, but if you haven&#8217;t used VI before, I recommend using Nano instead.</p>
<p>Type one of the following into the terminal.</p>
<pre class="brush: bash; title: ; notranslate">
$ sudo vi /private/etc/hosts
</pre>
<p>or</p>
<pre class="brush: bash; title: ; notranslate">
$ sudo nano /private/etc/hosts
</pre>
<p>The <strong>sudo</strong> will prompt you for your password, enter it and the file should open. If you don&#8217;t use sudo and enter your password you will not be able to save your changes. You should now see your host file, look for the line <strong>127.0.0.1 localhost</strong>. Enter the info below being careful not to change anything else in your hosts file, it may be empty or it could have something other programs or people have put in there.</p>
<pre class="brush: bash; title: ; notranslate">
127.0.0.1 localhost
127.0.0.1 dev.localhost
127.0.0.1 coolsite
</pre>
<p>As you can see these correspond with the names you entered in the httpd.conf file. Now you will need to stop and start your server via MAMP or command line. Once you have stopped and started the MAMP stack, your new server names should load when typed into the browser. This is a great way for testing your sites and in some cases may be the only way to test them. You can use any names you wish and setup as many server names as you wish.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ianhoar.com/2011/10/26/creating-subdomains-and-custom-server-names-with-mamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery: How to get links to work in toggled or dynamic content</title>
		<link>http://www.ianhoar.com/2011/09/09/jquery-how-to-get-links-to-work-in-toggled-or-dynamic-content/</link>
		<comments>http://www.ianhoar.com/2011/09/09/jquery-how-to-get-links-to-work-in-toggled-or-dynamic-content/#comments</comments>
		<pubDate>Sat, 10 Sep 2011 01:03:36 +0000</pubDate>
		<dc:creator>Ian Hoar</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[stopPropagation]]></category>
		<category><![CDATA[toggle]]></category>

		<guid isPermaLink="false">http://www.ianhoar.com/?p=4473</guid>
		<description><![CDATA[jQuery still never ceases to amaze me. The developers of this fantastic library seem to have thought of everything, and the only real challenge for us end users is hunting through the API. Recently I was tasked with creating slide out toggle boxes that had links embedded within them. The problem was that the animation [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-4409" title="jQuery" src="http://www.ianhoar.com/wp-content/uploads/2011/06/jquery_logo.png" alt="jQuery" width="200" height="193" />jQuery still never ceases to amaze me. The developers of this fantastic library seem to have thought of everything, and the only real challenge for us end users is hunting through the API. Recently I was tasked with creating slide out toggle boxes that had links embedded within them. The problem was that the animation would be triggered before the links, thus rending them useless. Luckily like many things with jQuery the fix is simple and I will demonstrate with two examples.</p>
<p><span id="more-4473"></span></p>
<h2>The problem</h2>
<pre class="brush: jscript; title: ; notranslate">

$jQuery('#toggle-test').toggle(function() {
  $jQuery(this).stop(true, true).animate({width : 500});
}, function() {
  $jQuery(this).stop(true, true).animate({width : 300});
});
</pre>
<div id="toggle-test">Here is a block of content <a href="http://www.ianhoar.com">with an inline link</a> that is a fully toggleable div element, but the link does not actually work.</div>
<p>As you can see in the example above, when clicking the link the toggle animation is triggered instead of the link destination.</p>
<h2>The solution</h2>
<pre class="brush: jscript; title: ; notranslate">
$jQuery('#toggle-test2').toggle(function() {
  $jQuery(&quot;a&quot;).click(function(e) {
    e.stopPropagation();
  });
  $jQuery(this).stop(true, true).animate({width : 500});
}, function() {
  $jQuery(this).stop(true, true).animate({width : 300});
});
</pre>
<div id="toggle-test2">Here is a block of content <a href="http://www.ianhoar.com">with an inline link</a> that is a fully toggleable div element and a working link.</div>
<p>The difference with the second example is that we have added a click event within the toggle and added the <a href="http://api.jquery.com/event.stopPropagation/"><strong>stopPropagation()</strong> method</a>. This &#8220;Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event&#8221; thus allowing the link to take it&#8217;s normal course of action.</p>
<p>A more practical use of this would be clickable slide out boxes with links embedded or even a close button on a toggleable element. These are just some of the uses for <strong>stopPropagation()</strong>, so keep it handy in your arsenal of jQuery tools.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ianhoar.com/2011/09/09/jquery-how-to-get-links-to-work-in-toggled-or-dynamic-content/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Maps api and iPad/iPhone zoom and scale issues when orientation is changed</title>
		<link>http://www.ianhoar.com/2011/07/12/google-maps-api-and-ipadiphone-zoom-and-scale-issues-when-orientation-is-changed/</link>
		<comments>http://www.ianhoar.com/2011/07/12/google-maps-api-and-ipadiphone-zoom-and-scale-issues-when-orientation-is-changed/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 03:48:08 +0000</pubDate>
		<dc:creator>Ian Hoar</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Smartphones]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[metadata]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.ianhoar.com/?p=4475</guid>
		<description><![CDATA[I recently bought an iPad and I&#8217;m absolutely loving it. It also happened to coincide with an exciting project that I&#8217;m working on that requires the Google maps API to work on an iPad. The project required a full screen map, but when switching from landscape to portrait or vice versa the zoom level would [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1866" title="Apple Logo" src="http://www.ianhoar.com/wp-content/uploads/2008/09/apple_chrome_logo.png" alt="Apple Logo" width="200" height="245" />I recently bought an iPad and I&#8217;m absolutely loving it. It also happened to coincide with an exciting project that I&#8217;m working on that requires the Google maps API to work on an iPad. The project required a full screen map, but when switching from landscape to portrait or vice versa the zoom level would be off. The Google maps controls would also be off the page, page graphics were also blurry due to being zoomed, even the Google Map itself was blurry. After much tweaking, fiddling and scratching my head, the fix turned out to be quite simple to fix.</p>
<p><span id="more-4475"></span>This quick tutorial will not go into the details of how to use the Google maps API, for that I refer you to the <a href="http://code.google.com/apis/maps/documentation/javascript/tutorial.html">starter tutorial</a> which is missing the fix needed to make the maps display properly in the iPad. This issue also affects the iPhone and should fix any problems there too. After thinking it was a CSS issue and fiddling with the CSS for over an hour I stumbled across more metadata options. In the Google example linked above, it shows a metadata name attribute of  &#8220;viewport&#8221; with content attribute values of &#8220;initial-scale=1.0, user-scalable=no&#8221;. You need a bit more than this for the iPad and iPhone. See below.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no&quot; /&gt;
</pre>
<p>The most important value is <strong>maximum-scale=1.0</strong><strong></strong>, <strong></strong><strong>width=device-width</strong> is just in there for good measure.  Basically this stops Safari from scaling or zooming your viewport when the orientation is changed. One note, sometimes the Safari browser won&#8217;t forget the way it was displaying before you made your changes, a quick stop in <strong>options -&gt; Safari</strong> and you will find a clear cache option.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ianhoar.com/2011/07/12/google-maps-api-and-ipadiphone-zoom-and-scale-issues-when-orientation-is-changed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE6 is dead! &#8230; No really, I mean it this time!</title>
		<link>http://www.ianhoar.com/2011/06/17/ie6-is-dead-no-really-i-mean-it-this-time/</link>
		<comments>http://www.ianhoar.com/2011/06/17/ie6-is-dead-no-really-i-mean-it-this-time/#comments</comments>
		<pubDate>Sat, 18 Jun 2011 03:43:14 +0000</pubDate>
		<dc:creator>Ian Hoar</dc:creator>
				<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.ianhoar.com/?p=4452</guid>
		<description><![CDATA[How many times have we heard that IE6 is dead or even it&#8217;s funeral announced? The fact of the matter is that IE6 is not dead until your clients say so, or you just stop taking on clients who demand support for it. As with so many web projects, it&#8217;s often not your choice anyway, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-4453" title="IE6 is dead!" src="http://www.ianhoar.com/wp-content/uploads/2011/06/ie_dead.png" alt="IE6 is dead!" width="200" height="181" />How many times have we heard that IE6 is dead or even <a href="http://ie6funeral.com/">it&#8217;s funeral announced</a>? The fact of the matter is that IE6 is not dead until your clients say so, or you just stop taking on clients who demand support for it. As with so many web projects, it&#8217;s often not your choice anyway, but we can still try and nudge them along with a decision to axe IE6. Charging more money, removing fantastic features from your mockups, or showing clients web stats are some methods that can be used to steer people away from this ancient browser. Google has also added one more tool to our arsenal and I recently got to use it on a project that was self destructing in IE6.</p>
<p><span id="more-4452"></span></p>
<p>It&#8217;s called the IE upgrade warning and it&#8217;s pretty slick and super easy to set up. All you need to do is <a href="http://code.google.com/p/ie6-upgrade-warning/">download the zip file from Google&#8217;s IE upgrade warning page</a>. Extract and upload the included goodies to your server and add this snippet into the page.</p>
<pre class="brush: jscript; title: ; notranslate">&lt;!--[if lte IE 6]&gt;&lt;script src=&quot;js/ie6/warning.js&quot;&gt;&lt;/script&gt;&lt;script&gt;window.onload=function(){e(&quot;js/ie6/&quot;)}&lt;/script&gt;&lt;![endif]--&gt;</pre>
<p>You will also need to upgrade the paths to point to your JavaScript directory. Once you do so, you should get a pretty little box like the one shown below when ancient IE browsers arrive at your site.</p>
<p><img class="size-full wp-image-4456 aligncenter" title="ie6 upgrade warning" src="http://www.ianhoar.com/wp-content/uploads/2011/06/ie_upgrade_warning.png" alt="ie6 upgrade warning" width="668" height="277" /></p>
<p>I know a lot of us could probably think of more colourful things to say in this message, but it&#8217;s probably just best to leave it alone. You can also <a href="http://code.google.com/p/ie6-upgrade-warning/w/list">get loads of translation files</a> too! So the next time you think about dumbing down the user experience or spending 25% more time trying to make a site work in IE6, maybe this handy little script is the answer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ianhoar.com/2011/06/17/ie6-is-dead-no-really-i-mean-it-this-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clearing the jQuery animation queue</title>
		<link>http://www.ianhoar.com/2011/06/05/clearing-the-jquery-animation-queue/</link>
		<comments>http://www.ianhoar.com/2011/06/05/clearing-the-jquery-animation-queue/#comments</comments>
		<pubDate>Sun, 05 Jun 2011 05:45:39 +0000</pubDate>
		<dc:creator>Ian Hoar</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.ianhoar.com/?p=4220</guid>
		<description><![CDATA[Ever see sites where a jQuery animation happens over and over when you rollover or click it multiple times. It&#8217;s almost as if the animations are stacking on top of one another in a queue and executing one by one, and guess what? That&#8217;s exactly what&#8217;s happening. Not to worry though, there is a simple [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-4409" title="jQuery" src="http://www.ianhoar.com/wp-content/uploads/2011/06/jquery_logo.png" alt="jQuery" width="200" height="193" />Ever see sites where a jQuery animation happens over and over when you rollover or click it multiple times. It&#8217;s almost as if the animations are stacking on top of one another in a queue and executing one by one, and guess what? That&#8217;s exactly what&#8217;s happening. Not to worry though, there is a simple and easy way to fix this.</p>
<p><span id="more-4220"></span></p>
<p>Below we have four examples, two jQuery toggles and two jQuery hovers. The first toggle and the first hover do not employ the <strong>stop()</strong> function while the proceeding ones do. Try them out for yourself.</p>
<h2>4 examples</h2>
<div id="examples">
<div id="example1">click with no stop</div>
<div id="example2">click with stop</div>
<div id="example3">hover with no stop</div>
<div id="example4">hover with stop</div>
</div>
<h2>No stop() function used</h2>
<pre class="brush: jscript; title: ; notranslate">
var height = $('#example1').height();
$('#example1').toggle(function() {
     $(this).animate({'height' : '100px'}, 'slow');
},
function() {
     $(this).animate({'height' : height}, 'slow');
});

$('#example3').hover(function() {
     $(this).animate({'height' : '100px'}, 'slow');
},
function() {
     $(this).animate({'height' : height}, 'slow');
});
</pre>
<p>The above examples first get the height of the example1 id, this height is then used for resetting all the examples to their original height after the first animation.</p>
<p>The snippet then sets the height the <strong>#example1</strong> element to 100px when toggled/clicked and then back to the original height when toggled again. The same logic is applied to <strong>#example3</strong> only with a hover instead.  If you rapidly click the first and third examples above you will see the animations queue up and continue repeating until finished. It is more noticeable with rollovers, and this is probably not a desirable behavior in most situations.</p>
<h2>Examples 2 and 4 use the jQuery stop function</h2>
<pre class="brush: jscript; title: ; notranslate">
$('#example2').toggle(function() {
     $(this).stop(true, true).animate({'height' : '100px'}, 'slow');
},
function() {
     $(this).stop(true, true).animate({'height' : height}, 'slow');
});
$('#example4').hover(function() {
     $(this).stop(true, false).animate({'height' : '100px'}, 'slow');
},
function() {
     $(this).stop(true, true).animate({'height' : height}, 'slow');
});
</pre>
<p>As you can see it&#8217;s pretty simple to fix, but you also have to be careful with the <strong>stop()</strong> function as sometimes you can get undesirable flicker effects.</p>
<h2>Understanding the stop() function</h2>
<p>The stop function takes two Boolean values, both of which default to false.</p>
<p><strong>.stop( [ clearQueue ], [ jumpToEnd ] )</strong></p>
<p>The first value <strong>clearQueue</strong> will stop the animation from stacking or queuing up each animation. The <strong>jumpToEnd</strong> value tells whether to finish or jump to the end of the animation sequence. You will often need to play around with these values to see what works best. As you can see in the hover example, the mouse over clears the queue but continues to animate, while the mouse out clears the queue and jumps to the end of the animation. If these values are all left to true in this example you can get some flickering effects.</p>
<p>Remember that the jQuery <strong>stop()</strong> function can be used on any animation function, which includes functions like <strong>slideUp()</strong> and <strong>SlideDown()</strong>. Happy coding.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ianhoar.com/2011/06/05/clearing-the-jquery-animation-queue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3 easy methods to create dotted or dashed lines in Photoshop</title>
		<link>http://www.ianhoar.com/2011/05/28/3-easy-methods-to-create-dotted-or-dashed-lines-in-photoshop/</link>
		<comments>http://www.ianhoar.com/2011/05/28/3-easy-methods-to-create-dotted-or-dashed-lines-in-photoshop/#comments</comments>
		<pubDate>Sun, 29 May 2011 03:56:58 +0000</pubDate>
		<dc:creator>Ian Hoar</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.ianhoar.com/?p=4346</guid>
		<description><![CDATA[Dotted or dashed lines can be a great design element and easy to achieve with a bit of CSS, but creating a lot of them in Photoshop mockups can be time consuming and frustrating. There are 3 simple ways to create dotted or dashed lines in Photoshop. The first one is the way a lot [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-4381" title="Photoshop" src="http://www.ianhoar.com/wp-content/uploads/2011/05/ps5_logo.png" alt="Photoshop" width="200" height="200" />Dotted or dashed lines can be a great design element and easy to achieve with a bit of CSS, but creating a lot of them in Photoshop mockups can be time consuming and frustrating. There are 3 simple ways to create dotted or dashed lines in Photoshop. The first one is the way a lot of people probably do it and that&#8217;s by doing it with the pencil tool dot by dot and then duplicating the layer. This is slow but there are ways to speed up the process. The 2nd method is achieved by using the brush palette spacing settings. The 3rd method is uses custom patterns. This tutorial will cover all three methods with the Mac/Windows shortcut keys needed to speed up the process.</p>
<p><span id="more-4346"></span></p>
<h2>Method 1: Dot by dot</h2>
<p>The dot by dot method is exactly as it sounds, grab a brush and draw your line out. Depending on your layout this could take forever and end up being less than perfect if you make a mistake. A quick way to speed up the process is by duplicating and merging the layers as you go.</p>
<p>Start with a blank canvas of 500&#215;500 pixels. Go to your layers window and <strong>create a new layer</strong>. Now zoom in about 500% and create two horizontal dashes or dots with the pen tool (<strong> b </strong>). Once you have completed this switch to the move tool (<strong>v</strong>). Now drag your two dots while holding down the (<strong> alt </strong>) key, this will turn your move tool into a double arrow which means you are duplicating the layer. As you drag the layer line it up so the spacing is correct with the previous two dots. You should now have 4 dots/dashes. Once you have lined them up merge them ( <strong>command/control e</strong> ). Now repeat the whole process again, each time you will double the length of your dotted/dashed line. If you use this method, although clunky, you can created many lines very quickly and then trim them to your desired size with the marquee tool. If you need a vertical line all you have to do is rotate (<strong> command/control t</strong> ) the layer while holding the ( <strong>shift ) </strong>key to get a perfectly straight vertical line.</p>
<p><img class="alignleft size-full wp-image-4364" title="Layers Palette" src="http://www.ianhoar.com/wp-content/uploads/2011/05/layers_palette.png" alt="Layers Palette" width="223" height="198" />Need to change the colour? No problem, select the dashed/dotted lines layer in your layers palette and <strong>click &#8220;Lock transparent pixels&#8221;</strong>. Now select your brush tool (<strong> b </strong>) and increase the size ( <strong>] </strong>) to a large enough brush to paint over the dots/dashes quickly. Select the colour you wish to use and scribble over top of your lines.</p>
<p>This method while not overly eloquent is often the easiest method for a quick dashed line. If you need to use many dotted/dashed lines you might want to look at one of the other methods below.</p>
<h2>Method 2: Brush palette</h2>
<p><img class="size-full wp-image-4367 alignright" title="Brushes" src="http://www.ianhoar.com/wp-content/uploads/2011/05/brushes.png" alt="Brushes" width="376" height="460" />The brush method is fairly fast. Create a new 500&#215;500 pixel canvas. Open your brushes ( <strong>F5</strong> ) palette and select the 1 px brush. Uncheck <strong>Shape Dynamices</strong>, then select <strong>Brush Tip Shape</strong>. Slide the <strong>Spacing</strong> slider to the far right and then hold <strong>shift</strong> while drawing a line. You should have a perfect dotted line.</p>
<p>You can mess around with the spacing and roundness options, but there is only so much you can do with the default brushes, if you use rounded brushes are will get rounded dots, which may or may not be what you want. If you need larger dashes you can create your own brush. Say you want a 10&#215;8 dash, all you have to do is created a 10&#215;8 square dash and crop the canvas to that size. A quick way is to trim the document in the image menu. (<strong> Image -&gt; Trim&#8230; and select ok </strong>).</p>
<p>Once you have your brush ready go to the edit menu and define a brush. ( <strong>Edit -&gt; Define Brush Preset&#8230;</strong> ). Name it can click ok. When you return to the brushes menu it should be selected. Now if you apply the spacing settings to this brush you should have a much thicker dashed line.</p>
<p>The brush method is probably one of the most robust methods for creating dotted/dashed lines in photoshop.</p>
<h2>Method 3: Pattern palette</h2>
<p>The pattern method is similar in some ways to the brush method. This is by far the most complex of the 3 methods, but if you plan on changing the size of dotted boxes a lot then this method is the most flexible. When I create Photoshop mockups for web, I use a lot of layer shapes for sidebars, boxes, headers and what not and constantly nudge them into place with the arrow keys and the direct selection tool. With this method you will apply a pattern via the styles to a shape layer and then work with the vector mask to only show the edges of the pattern. Once completed you will now have a dotted or dashed line that you can move and nudge with the direct selection tool as much as you like without ever worrying about recreating the dotted lines again.</p>
<p><img class="alignleft size-full wp-image-4371" title="2x2 pixels" src="http://www.ianhoar.com/wp-content/uploads/2011/05/2x2.png" alt="2x2 pixels" width="339" height="358" />For this example we will create a 1 pixel dotted line, but this will work with thicker lines too. Create a new 2&#215;2 document, add a new layer to it and hide the background layer so the image is completely transparent. Now put one pixel in the top left corner. Your document should look like the zoomed in example to the left. If you were to create a 3 pixel dash, your document would be 6&#215;6 with a 3 pixel black box in the top left corner.</p>
<p>Now go to the edit menu and define a pattern. ( <strong>Edit -&gt; Define Pattern&#8230;</strong> ). You are ready to create your box shape now. Create a large new document ( <strong>command/control N</strong> ) to play around with. Select the rectangle tool ( <strong>u</strong> ) and create a rectangular shape.</p>
<p>Now <img class="alignright size-full wp-image-4373" title="Layers Palette" src="http://www.ianhoar.com/wp-content/uploads/2011/05/layers_palette21.png" alt="Layers Palette" width="222" height="192" />select the newly created shape and reduce it&#8217;s fill to 0%. The difference between Opacity and Fill is that Fill will hide the shape but not the Blending Options that you will be applying next. You can leave this a solid colour too, but make sure it&#8217;s not the same colour as your pattern, otherwise you will not see the dotted line. Now right click your new shape layer and select <strong>Blending Options&#8230;</strong></p>
<p>In the blending options click <strong>Pattern Overlay</strong> and then select your pattern in the <strong>Pattern: </strong> section. Your pattern should be the last one added. Click <strong>OK</strong>.</p>
<p><img class="aligncenter size-full wp-image-4374" title="Blending Options" src="http://www.ianhoar.com/wp-content/uploads/2011/05/blending_options.png" alt="Blending Options" width="596" height="455" /></p>
<p>Now you should have a box full of 1 pixel dots. Select the shape tool again ( <strong>u</strong> ) and make sure <strong>Shape layers</strong> and <strong>Subtract from shape area</strong> are selected in the toolbar as shown below.</p>
<p><img class="aligncenter size-full wp-image-4378" title="Toolbar" src="http://www.ianhoar.com/wp-content/uploads/2011/05/toolbar.png" alt="Toolbar" width="406" height="52" /></p>
<p><img class="alignleft size-full wp-image-4377" title="Layers Palette" src="http://www.ianhoar.com/wp-content/uploads/2011/05/layers_palette3.png" alt="Layers Palette" width="221" height="144" />Now select the <strong>Vector mask</strong> of  your shape in the layers palette and draw a mask over your shape. The key here is to draw it right to the edges. You can use the <strong>Direct Selection Tool </strong>( <strong>a </strong>) to tweak your anchor points.</p>
<p><img class="alignright size-full wp-image-4380" title="Dotted Box" src="http://www.ianhoar.com/wp-content/uploads/2011/05/box.png" alt="Dotted Box" width="107" height="105" />You should now have a nice box with dotted lines like the one to the right.  You can continue to use the Direct Selection Tool by selecting the entire edge of the shape to manipulate this rectangle without worrying about the borders again. If you wanted the border only on one side then you would manipulate the inner vector mask so that it covered the top, right and bottom sides of the rectangle.</p>
<p>Although this method is more time consuming than the first two, it&#8217;s also very powerful if you are going to have a lot of dotted or dashed boxes in several layouts. Now you can just duplicate this one over and over and resize it without worrying about re-drawing the dots/dashes. As mentioned this can also be used for straight lines, just make sure the other sides of the rectangle are masked. Remember that the pattern is the colour of your border, so if you want a different colour you need to change the pattern colour.</p>
<p>If you have other tips on how to achieve the same examples as above with different methods, I would love to hear about them in the comments below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ianhoar.com/2011/05/28/3-easy-methods-to-create-dotted-or-dashed-lines-in-photoshop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firebug for IE</title>
		<link>http://www.ianhoar.com/2011/05/15/firebug-for-ie/</link>
		<comments>http://www.ianhoar.com/2011/05/15/firebug-for-ie/#comments</comments>
		<pubDate>Mon, 16 May 2011 04:45:14 +0000</pubDate>
		<dc:creator>Ian Hoar</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[add-on]]></category>
		<category><![CDATA[Firebug]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[web tools]]></category>

		<guid isPermaLink="false">http://www.ianhoar.com/?p=4347</guid>
		<description><![CDATA[Tonight I stumbled across Firebug Lite and was ecstatic to find that all the features I use the most are available not just for IE, but pretty much any modern browser. There are other debuggers out there, but I know a lot of people really love Firebug. This fantastic tool really lets you get under [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-4349" title="firebug" src="http://www.ianhoar.com/wp-content/uploads/2011/05/firebug.png" alt="" width="200" height="160" />Tonight I stumbled across <a href="http://getfirebug.com/firebuglite">Firebug Lite</a> and was ecstatic to find that all the features I use the most are available not just for IE, but pretty much any modern browser. There are other debuggers out there, but I know a lot of people really love Firebug. This fantastic tool really lets you get under the hood and see what&#8217;s going on, it&#8217;s saved me countless hours, but what would save me even more time and effort is if it was available for the browser where 95% my problems occur; Internet Explorer. Firebug was also number one on my post <em>&#8220;<a href="http://www.ianhoar.com/2010/11/28/14-killer-web-design-and-development-tools-for-the-mac/">14 killer web design and development tools for the Mac</a>&#8220;</em><em>.</em></p>
<p><span id="more-4347"></span></p>
<p>FireBug Lite has the Inspector which is that button that lets you click on any part of the web page and see what&#8217;s going on. It&#8217;s especially helpful when troubleshooting layout issues with JavaScript or jQuery where you can&#8217;t actually see the CSS or HTML that is generated after the page loads.</p>
<p><a href="http://getfirebug.com/firebuglite#Stable">Firebug Lite comes in a few flavours</a>, a bookmarklet, a live link and a local link. <strong>You can test out Firebug Lite right now! I have embedded it right into this blog post</strong>. Look for a <strong>little bug in the bottom right hand corner</strong> of your browser window and click it, voilà! Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ianhoar.com/2011/05/15/firebug-for-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When Mac OS X Exposé and screenshot capture stop working!</title>
		<link>http://www.ianhoar.com/2011/04/12/when-mac-os-x-expose-and-screenshot-capture-stop-working/</link>
		<comments>http://www.ianhoar.com/2011/04/12/when-mac-os-x-expose-and-screenshot-capture-stop-working/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 03:23:00 +0000</pubDate>
		<dc:creator>Ian Hoar</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Mac OS X bugs]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.ianhoar.com/?p=4338</guid>
		<description><![CDATA[You may have experience this before, you are working away and suddenly Exposé, screen shot capture or hot corners stops working! It is an extremely frustrating bug I have experience for some time on Mac OS X, and up until recently only a reboot would remedy it. This is not something I have experienced on [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-1866 alignleft" title="Apple Logo" src="http://www.ianhoar.com/wp-content/uploads/2008/09/apple_chrome_logo.png" alt="" width="200" height="245" />You may have experience this before, you are working away and suddenly Exposé, screen shot capture or hot corners stops working! It is an extremely frustrating bug I have experience for some time on Mac OS X, and up until recently only a reboot would remedy it. This is not something I have experienced on all Macs either, and unfortunately I don&#8217;t know what is causing it, but I have found a fix that&#8217;s made life a little easier.</p>
<p><span id="more-4338"></span>I do a lot of screen captures using Command-Shift-4, and when it stops working while I have all kinds of files open, a reboot is a real productivity killer. I have tried killing the finder and dock using the terminal to no avail. One process that will fix this issue, although not ideal it&#8217;s better than a reboot.</p>
<p>Click the Apple icon in your top menu and <strong>select sleep</strong>. A few seconds later <strong>hit space bar</strong>; this seems to restore Exposé and screen capture functionality. This method should also fix disabled hot corners, although I have not tested it. Although putting your Mac into sleep mode and awaking it a few seconds later is much better than a reboot, a real fix would be much appreciated, so if you have a better solution or know what&#8217;s causing this I would love to hear about it in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ianhoar.com/2011/04/12/when-mac-os-x-expose-and-screenshot-capture-stop-working/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using custom CSS and Javascript in WordPress posts</title>
		<link>http://www.ianhoar.com/2011/04/02/using-custom-css-and-javascript-in-wordpress-posts/</link>
		<comments>http://www.ianhoar.com/2011/04/02/using-custom-css-and-javascript-in-wordpress-posts/#comments</comments>
		<pubDate>Sun, 03 Apr 2011 00:46:07 +0000</pubDate>
		<dc:creator>Ian Hoar</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.ianhoar.com/?p=4279</guid>
		<description><![CDATA[Today while writing The secrets to using custom web fonts I ran into a bit of a snag. I wanted to show several CSS driven examples within the post, but the WordPress editor would remove anything I added. I have dealt with this issue in the past, usually in a clunky manner or even hosted [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-4312" title="Using custom CSS and Javascript in WordPress posts" src="http://www.ianhoar.com/wp-content/uploads/2011/04/tools.png" alt="Using custom CSS and Javascript in WordPress posts" width="200" height="147" />Today while writing <a href="http://www.ianhoar.com/2011/04/02/the-secrets-to-using-custom-web-fonts/">The secrets to using custom web fonts</a> I ran into a bit of a snag. I wanted to show several CSS driven examples within the post, but the WordPress editor would remove anything I added. I have dealt with this issue in the past, usually in a clunky manner or even hosted separate example pages. This time though I really wanted the font examples to show up within the actual page content and I didn&#8217;t want to add more styles to my WordPress theme. The method I used is remarkably easy and can be implemented in about two or three minutes.</p>
<p><span id="more-4279"></span></p>
<p>For custom CSS and JavaScript within the post, the best place to put these snippets is embedded right into the HTML head of that post. This is super easy to do with WordPress custom fields and a slight modification to your WordPress theme.</p>
<h2>What are custom fields?</h2>
<p><img class="alignright size-full wp-image-4315" title="Custom Field Screen Options" src="http://www.ianhoar.com/wp-content/uploads/2011/04/custom_field_screen_options.png" alt="Custom Field Screen Options" width="257" height="184" />If you don&#8217;t know what custom fields are in WordPress then step aboard, they are another powerful tool to add to your arsenal and easy to understand. The first step is making sure they are displayed on your <strong>Edit Post</strong> admin page. Create a new post and look to the top right corner of you admin interface. You should see <strong>Screen Options</strong>. Click it and then make sure <strong>Custom Fields</strong> is ticked in the <strong>Show on screen</strong> check box options. Now if you look below your post you should see a panel called Custom Fields.</p>
<h2>A quick update to your theme</h2>
<p>Either download your header.php file or use the WordPress editor to paste the snippet of code below into it. The snippet below should go right before your closing <strong>&lt;/head&gt;</strong> tag.</p>
<pre class="brush: php; title: ; notranslate">&lt;?php
if (is_single()) {
     if ($custom_header = get_post_meta($post-&gt;ID, 'custom_header', true)) {
     echo $custom_header;
     }
}
?&gt;</pre>
<p>This example allows you to post any type of data into your page head and allows you to specify the type of tag such as <strong>link style</strong> or <strong>script</strong>. The code above says: is this a single page? If so get the custom field named <strong>custom_header</strong> and echo/print it out. Now you are done and can save/upload the file to your server.</p>
<p>Now in your custom fields panel enter a new custom field of custom_header and add the styles or JavaScript you need. In the example below you would then add .myCustomStyle to your post in the HTML tab. I find using <strong>span</strong> tags in the editor is the best way to add custom classes.</p>
<p><img class="size-full wp-image-4308 aligncenter" title="Custom Fields" src="http://www.ianhoar.com/wp-content/uploads/2011/04/custom_fields.png" alt="Custom Fields" width="681" height="344" /></p>
<p>You can add any kind of custom code into the header using the same method. Read more about <a href="http://codex.wordpress.org/Using_Custom_Fields">custom fields</a> in the <a href="http://codex.wordpress.org/Using_Custom_Fields">WordPress codex</a>.</p>
<h2>My custom CSS isn&#8217;t showing up</h2>
<p>If your CSS classes seem to be having no affect it&#8217;s probably because they are being overridden by your own theme CSS. Adding the <strong>!important</strong> declaration to any problem styles will fix this issue forcing them to override the style that is overriding your custom style, see the example below.</p>
<pre class="brush: css; title: ; notranslate">font-size:20px !important;
color:#1f1f1f !important;
</pre>
<p>That&#8217;s all there is to it, happy coding.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ianhoar.com/2011/04/02/using-custom-css-and-javascript-in-wordpress-posts/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Creating email newsletter margins with tables</title>
		<link>http://www.ianhoar.com/2011/03/27/creating-email-newsletter-margins-with-tables/</link>
		<comments>http://www.ianhoar.com/2011/03/27/creating-email-newsletter-margins-with-tables/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 01:08:20 +0000</pubDate>
		<dc:creator>Ian Hoar</dc:creator>
				<category><![CDATA[Email]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[email newsletters]]></category>
		<category><![CDATA[Gmail]]></category>
		<category><![CDATA[Outlook]]></category>

		<guid isPermaLink="false">http://www.ianhoar.com/?p=4250</guid>
		<description><![CDATA[This may seem painfully obvious to some, especially the more seasoned old school table based web designers out there, but I&#8217;m still amazed at how many email newsletters don&#8217;t render properly in my inbox. Remember when it comes to email newsletters tables are king and web standards go out the window! It sucks, but that&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-4260" title="Creating email newsletter margins with tables" src="http://www.ianhoar.com/wp-content/uploads/2011/03/tool_kit-e1301273715243.png" alt="Creating email newsletter margins with tables" width="200" height="200" />This may seem painfully obvious to some, especially the more seasoned old school table based web designers out there, but I&#8217;m still amazed at how many email newsletters don&#8217;t render properly in my inbox. Remember <strong>when it comes to email newsletters tables are king and web standards go out the window!</strong> It sucks, but that&#8217;s the way it is, so lets move on.</p>
<p><span id="more-4250"></span></p>
<h2>Use tables everywhere</h2>
<p>And I do mean everywhere, I can&#8217;t stress this enough, <strong>tables are your friend</strong> when it comes to email newsletters. They will ease much suffering, so use them everywhere. The all mighty <strong>spacer gif is your next best friend</strong> when it comes to table based design, and <strong>style=&#8221;display:block&#8221; is your third best friend</strong>. Here&#8217;s why.</p>
<h2>Margins don&#8217;t work in email newsletters!</h2>
<p>Margins are one of the most important css styles used today along with padding. Some email clients strip out margins and padding can be very flaky in others, so what are you to do? You can start by not using them at all. Don&#8217;t bother trying to style your paragraph tags either, I always stress letting them default to whatever the email client likes to do with them. Forcing them to do what you want will probably look wonky in some mail clients. Leave them alone and don&#8217;t bother with margins or padding, it&#8217;s less work for you and your email newsletters will look better for it. You will never have the control you have with web pages.</p>
<p>Suppose we want this example below.</p>
<p><img class="aligncenter size-full wp-image-4254" title="Email Newsletter" src="http://www.ianhoar.com/wp-content/uploads/2011/03/email_newsletter.jpg" alt="Email Newsletter" width="710" height="560" /></p>
<p>In a normal webpage this is a padding div with text and a second div floated right with CSS margins and a paragraph of text  for the caption. In the email world it looks like this.</p>
<p><img class="aligncenter size-full wp-image-4256" title="email newsletter with tables" src="http://www.ianhoar.com/wp-content/uploads/2011/03/email_newsletter_table.jpg" alt="email newsletter with tables" width="710" height="580" /></p>
<p>Red represents an outer table and green represents an inner table. In a real world example of a robust email newsletter you would most likely have far more nested tables then this, but this illustrates our need for tables. Each corner table has a 20&#215;20 pixel, and the inner green table is aligned to the right. A great tool to illustrate this in real time with your own work is the <a href="https://addons.mozilla.org/en-us/firefox/addon/web-developer/">Web Developer Firefox addon</a> by <a href="http://chrispederick.com/">Chris Pederick</a>, which allows you to outline your tables within the browser amongst many other things.</p>
<h2>Table based layout tips</h2>
<p>Remember that a spacer gif should be a 10&#215;10 pixel by default and then stretched to the desired size even if that size is less than 10&#215;10. <a href="http://www.ianhoar.com/2007/10/20/outlook-2007-when-is-200-pixels-not-200-pixels/">A 1&#215;1 pixel will not stretch properly in some versions of Outlook</a> due to a very strange bug.</p>
<p>Each spacer gif should also have an inline style of <strong>style=&#8221;display:block&#8221;</strong>. Many email clients like Gmail will leave white space below all your images making your layout look messy. This same rule applies to visual images, especially if the email is image heavy as you will have white lines caused by space below all the images if you forget to add this to all your images.</p>
<p>When using tables don&#8217;t forget <a href="http://www.ianhoar.com/2010/06/27/outlook-2007-losing-font-family-declaration/">how fonts work with different email clients</a>. Newer versions Outlook for example will not cascade your fonts properly when used in tables, and clients like Gmail will rip out your embedded styles. The solution to this is to use both methods only once eliminating the need to splash font family and font sizes throughout your email newsletters.</p>
<p>With patience it&#8217;s possible to make email newsletters that work in many email clients and are somewhat clean at the same time. Look at email newsletters as yet another exciting challenge to conquer and you might not pull all your hair out. Happy coding.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ianhoar.com/2011/03/27/creating-email-newsletter-margins-with-tables/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

