<?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>The Sheep &#187; Tutorials</title>
	<atom:link href="http://www.thesheep.co.uk/category/blog/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thesheep.co.uk</link>
	<description>Ovine Perspectives On The Digital Age</description>
	<lastBuildDate>Fri, 22 Jul 2011 10:33:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Setting up a local server on OS X Leopard</title>
		<link>http://www.thesheep.co.uk/2009/06/24/setting-up-a-local-server-on-os-x-leopard/</link>
		<comments>http://www.thesheep.co.uk/2009/06/24/setting-up-a-local-server-on-os-x-leopard/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 14:39:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://www.thesheep.co.uk/?p=196</guid>
		<description><![CDATA[<p>This week I&#8217;ve spent quite a few hours trying to set up a local development environment on my new Mac. Although I&#8217;ve used the built in version of Apache 2, much of the other software that comes pre-installed with OS&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>This week I&#8217;ve spent quite a few hours trying to set up a local development environment on my new Mac. Although I&#8217;ve used the built in version of Apache 2, much of the other software that comes pre-installed with OS X is not ideal and needs to be replaced or tweaked. It is also not a bad idea to <a href="http://hivelogic.com/articles/view/using_usr_local">have your server software in /usr/local</a> to avoid it being potentially broken by system updates. This is a brief record of the steps necessary to create a solid server setup that suits me, mainly for running WordPress sites (PHP and MySQL) and Ruby on Rails. It&#8217;s really more of a record for myself if I ever have to do it again &#8211; although no doubt next time it will be on Snow Leopard and everything will be slightly different!</p>
<ol>
<li>We&#8217;ve going to use the built-in version of the Apache web server. To start/stop the web server, go to System Preferences in OS X and select Sharing > Web Sharing.</li>
<li>Move the Apache document root to a more convenient location (my personal &#8216;Sites&#8217; directory): open /etc/apache2/httpd.conf and change the &#8216;DocumentRoot&#8217; variable in 2 places (note: the PHP module should be left commented out, as it is by default). Next enable .htaccess by editing /etc/apache2/users/&lt;username&gt;/&lt;username&gt;.conf and specifying <code>Options All</code> and <code>AllowOverride All</code>. Restart Apache.</li>
<li>Download and install <a href="http://www.entropy.ch/phpbb2/viewtopic.php?t=3937" target="_blank">a more recent version of PHP</a> with more capability than the standard Apple one (GD library, Mcrypt, etc). This installs PHP into the directory /usr/local/php5.</li>
<li>Download and install <a href="http://downloads.mysql.com/archives.php?p=mysql-5.0&amp;v=5.0.77">a version of MySQL</a> server that correlates with that version of PHP (so the PHP MySQL library matches). MySQL is installed into /usr/local/mysql-5.0.77-osx10.5-x86 with a symbolic link from /usr/local/mysql.</li>
<li>Create or edit ~/.bash_login and add this line to the end: <code>export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"</code>. This makes it more convenient to interact with MySQL from the command line, as well as pointing our system to our custom software installations in /usr/local.</li>
<li>To start MySQL from the command line type <code>sudo mysqld_safe</code> (To stop MySQL type <code>mysqladmin -u root -p shutdown</code>)</li>
<li>Set password for MySQL root user: <code>mysqladmin  -u root -p 'mypassword'</code> (Note that the MySQL user is different from the Unix user that the MySQL is running under &#8211; usually _mysql).</li>
<li>To check current users in MySQL, use: <code>SELECT Host, User, Password FROM mysql.user;</code>. Set passwords for all as necessary. Alternatively, to limit access to your personal machine only, create the file /etc/my.cnf as detailed on <a href="http://hivelogic.com/articles/view/installing-mysql-on-mac-os-x">this page</a> (&#8216;A Note About Security&#8217;).</li>
<li>Set passwords for other users/hosts as required &#8211; see instructions half way down <a href="http://pages.cs.wisc.edu/~bolo/notes/mysql.html" target="_blank">this page</a>. Create an &#8216;admin&#8217; user for MySQL so we&#8217;re not using root in the various config files etc. Will need to <a href="http://dev.mysql.com/doc/refman/5.1/en/adding-users.html">grant privileges</a>.</li>
<li>Download and install <a href="http://www.phpmyadmin.net/">PHPMyAdmin</a>. Unzip and rename directory, then place in web document root. Make a file called config.inc.php to put in your blowfish password (any random phrase will do). You can copy libraries/config.default.php if you like.</li>
<li>Make sure you&#8217;ve installed Xcode from the OSX install disk.</li>
<li>Add in MySQL C bindings for Ruby, to make Rails faster &#8211; instructions near the bottom of <a href="http://hivelogic.com/articles/view/installing-mysql-on-mac-os-x">this page</a> (you will need to have Xcode Tools installed in OS X to do this &#8211; use your OS X installation disk if needed)</li>
<li>Follow the <a href="http://hivelogic.com/articles/view/ruby-rails-leopard/">instructions on HiveLogic</a> for installing Ruby and Ruby on Rails into /usr/local.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.thesheep.co.uk/2009/06/24/setting-up-a-local-server-on-os-x-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a YouTube feed to a WordPress template</title>
		<link>http://www.thesheep.co.uk/2009/03/17/adding-a-youtube-feed-to-a-wordpress-template/</link>
		<comments>http://www.thesheep.co.uk/2009/03/17/adding-a-youtube-feed-to-a-wordpress-template/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 16:19:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://www.thesheep.co.uk/?p=151</guid>
		<description><![CDATA[<p>The built in WordPress function <a title="WordPress function reference for fetch_rss()" href="http://codex.wordpress.org/Function_Reference/fetch_rss" target="_blank">fetch_rss()</a> makes it easy to pull in an RSS feed from any other site and display it on your own blog.  The function gives you convenient access to&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>The built in WordPress function <a title="WordPress function reference for fetch_rss()" href="http://codex.wordpress.org/Function_Reference/fetch_rss" target="_blank">fetch_rss()</a> makes it easy to pull in an RSS feed from any other site and display it on your own blog.  The function gives you convenient access to the raw data from the feed, so you can parse it in any way you like. For example, you might want to pull in the feed from a particular YouTube user and display their most recent 3 videos in your sidebar.</p>
<p>The first thing we want to do is visit the user&#8217;s page on YouTube to grab the feed URL for that person. It might be your own account, of course, but there&#8217;s no need to log in, and feeds are publically available from anyone&#8217;s account. Once on a user&#8217;s page, your browser should display an RSS icon: click on it and copy the URL of the feed. It will look something like this:</p>
<p><code>http://gdata.youtube.com/feeds/base/users/MontyPython/uploads?alt=rss&amp;v=2&amp;orderby=published&amp;client=ytapi-youtube-profile<br />
</code><br />
In this case I&#8217;ve grabbed the feed from a channel.</p>
<p>Next open up the WordPress template file for the page you want to display the content on. It might be &#8217;sidebar.php&#8217;, for example. Wherever you want the videos to appear, you need to call the fetch_rss() function as described in the <a href="http://codex.wordpress.org/Function_Reference/fetch_rss" target="_blank">WordPress documentation</a>.</p>
<p><code class="prettyprint">&lt;?php<br />
// Get RSS Feed(s)<br />
include_once(ABSPATH . WPINC . '/rss.php');<br />
$rss = fetch_rss('http://gdata.youtube.com/feeds/base/users/MontyPython/uploads?alt=rss&amp;v=2&amp;orderby=published&amp;client=ytapi-youtube-profile');<br />
$maxitems = 3; //set number of items to display<br />
$items = array_slice($rss-&gt;items, 0, $maxitems);<br />
?&gt;<br />
</code></p>
<p>In order to embed a YouTube Flash movie we could use the <a href="http://www.alistapart.com/articles/flashembedcagematch/">nested objects method</a>, so we have valid HTML, and include some appropriate alternative content (in case the Flash fails to load for some reason). To set this up for each item, all we need from the feed is the ID of the video.</p>
<p>If we examine the RSS feed itself, we find that the video ID is contained in the final part of the &#8216;link&#8217; element. To extract it, we&#8217;ll need to use a tiny bit of PHP to break up the URL string.</p>
<p>Of course we need to repeat this for each item in the feed, so we set up a loop like this:</p>
<p><code class="prettyprint"><br />
&lt;ul&gt;<br />
&lt;?php if (empty($items)) echo '&lt;li&gt;No items&lt;/li&gt;';<br />
else foreach ( $items as $item ) : ?&gt;<br />
&lt;div&gt;<br />
&lt;?php<br />
      $youtubeid = strchr($item['link'],'='); //split off the final bit of the URL beginning with '='<br />
      $youtubeid = substr($youtubeid,1); //remove that equals sign to get the video ID<br />
      //Now embed the flash:<br />
      ?&gt;<br />
      &lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="320" height="265"&gt;<br />
      &lt;param name="movie" value="http://www.youtube.com/v/&lt;?php echo $youtubeid ?&gt;&amp;hl=en&amp;fs=1" /&gt;<br />
      &lt;!--[if !IE]&gt;--&gt;<br />
      &lt;object type="application/x-shockwave-flash" data="http://www.youtube.com/v/&lt;?php echo $youtubeid  ?&gt;&amp;hl=en&amp;fs=1" width="320" height="265"&gt;<br />
      &lt;!--&lt;![endif]--&gt;<br />
      &lt;p&gt;&lt;a href="http://www.youtube.com/v/&lt;?php echo $youtubeid ?&gt;"&gt;View movie&amp;raquo;&lt;/a&gt;&lt;/p&gt;<br />
      &lt;!--[if !IE]&gt;--&gt;<br />
      &lt;/object&gt;<br />
      &lt;!--&lt;![endif]--&gt;<br />
      &lt;/object&gt;<br />
      &lt;/li&gt;<br />
&lt;?php endforeach; ?&gt;<br />
&lt;/ul&gt;</code></p>
<p>This method is pretty easy to adapt for any type of RSS feed you might want to use: Vimeo, Slideshare, Twitter, etc. Of course there are loads of WordPress plugins that can help you embed this stuff, but sometimes a plugin doesn&#8217;t give you exactly the output you need, and it&#8217;s helpful to be able to parse the feed yourself. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thesheep.co.uk/2009/03/17/adding-a-youtube-feed-to-a-wordpress-template/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Using Adobe Illustrator for web design</title>
		<link>http://www.thesheep.co.uk/2009/02/20/using-adobe-illustrator-for-web-design/</link>
		<comments>http://www.thesheep.co.uk/2009/02/20/using-adobe-illustrator-for-web-design/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 15:44:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[illustrator]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.thesheep.co.uk/?p=102</guid>
		<description><![CDATA[<p>The majority of web designers seem to use Photoshop, but Illustrator has some real strengths when it comes to designing web layouts. Moving and resizing elements on the canvas is much faster and more intuitive, and this helps make the&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>The majority of web designers seem to use Photoshop, but Illustrator has some real strengths when it comes to designing web layouts. Moving and resizing elements on the canvas is much faster and more intuitive, and this helps make the process more fluid. Illustrator does have some shortcomings &#8211; mainly its lack of strict adherence to pixel-based measurements. But these can be worked around. In this article I&#8217;m going to discuss some tips and techniques for using Illustrator to design web pages. Personally, I&#8217;ve used both Photoshop and Illustrator to design many web layouts, and Illustrator remains my tool of choice. Fireworks is also worth looking at.</p>
<h3>Snap to pixel</h3>
<p>In Illustrator CS1 and older, getting objects to ‘snap to pixel’ properly was difficult. Even when you set your units to &#8220;pixels&#8221;, positions on the canvas are very sensitive and tend to end up as fractions of a pixel. This introduces anti-aliasing artifacts when exporting the image so that your web graphics don&#8217;t look very &#8216;crisp&#8217;.</p>
<p>To get a ‘snap to pixel’ effect in these older versions of Illustrator, first set up your grid so that you have a grid line every 128px with 128 subdivisions. That in effect gives you a pixel grid, but with a usable number of lines visible. Then turn on &#8220;snap to grid&#8221; under the &#8220;View&#8221; menu. This keeps all your movements and transformations locked in to the nearest pixel, and keeps your graphics nice and crisp. (Thanks to <a href="http://www.corebasis.com" target="_blank">Hennning</a> for first showing me this technique).</p>
<p><img class="alignnone size-full wp-image-141" title="Snap to pixel option" src="http://www.thesheep.co.uk/wp-content/uploads/snap-to-pixel.png" alt="Snap to pixel option" width="240" height="177" /></p>
<p>As of CS2, Adobe introduced a specific ‘snap to pixel’ option, which you can see under the <em>View</em> menu after you select &#8220;Pixel preview&#8221;. This will keep all your objects snapped to the nearest pixel.</p>
<h3>Clean outlines</h3>
<p>By default, a stroke line around an object will follow the centre of the outline. This means that a stroke line of 1 pixel will have 0.5 pixels either side of that line, and we&#8217;ll end up with anti-aliasing artifacts. To solve this, always select &#8220;Align stroke to outside&#8221; or &#8220;Align stroke to inside&#8221; from the Stroke options window.</p>
<p><img class="alignnone size-full wp-image-124" title="Adding a 1px stroke" src="http://www.thesheep.co.uk/wp-content/uploads/pixel-stroke-example1.png" alt="Adding a 1px stroke" width="354" height="135" /></p>
<p>Unfortunately, even when you do this, and have &#8220;snap to pixel&#8221; turned on, Illustrator will randomly introduce an extra 1px anti-alias shade below the top edge of a rectangle. This is one of those annoying Illustrator bugs that (almost) makes you wish you&#8217;d just stuck with using Photoshop. This bug seems to occur in both CS3 an CS4 versions. The only way around this that I know of, if it is absolutely critical, is to draw the stroke separately as very thin rectangles &#8211; see below.<em><strong> [Update: setting the stroke weight to 0.999px solves this problem. Thanks to <a href="#comments">Benjamin McDowell</a> for posting this in the comments.]</strong></em></p>
<h3>Drawing lines</h3>
<p>In theory, the centre of a line lies between two pixels, and hence we get anti-aliasing problems when drawing lines with &#8220;snap to pixel&#8221; selected. Rather than nudging the centre measurement of a line by 0.5 pixels (which will give you a clean line), I prefer to draw lines as very thin rectangles. For example, a 1px horizontal line can be made up of a 1px high rectangle. In a similar way, controllable shading can be achieved by creating thin rectangles filled with a black to white gradient, setting the blending mode to &#8220;multiply&#8221;, and then reducing the opacity as required.</p>
<p><img class="alignnone size-full wp-image-139" title="Shading example" src="http://www.thesheep.co.uk/wp-content/uploads/shading-example1.png" alt="Shading example" width="406" height="173" /></p>
<h3>Use layers</h3>
<p>Unlike Photoshop, by default Illustrator allows any element on the canvas to be selected and moved/modified with a single click. This makes designing more fluid and quicker &#8211; resizing an object requires less clicks. It also makes it important to set up a few different layers, so that you can lock some layers while you work on others. I tend to place some example browser chrome on a top layer (to help get an &#8216;in-context&#8217; preview of the design), a layout grid on a second layer, main content on a third layer, and structural elements like boxes or columns on a &#8216;ground&#8217; layer. But depending on the complexity of the design, you may want to set up more layers &#8211; don&#8217;t forget to name them to help you keep track.</p>
<h3>Use character and paragraph styles</h3>
<p>Another area where Illustrator scores is its ability to define character and paragraph styles. Say you have a full web page design with a fair amount of content: text may appear in different columns, break-out boxes and sidebars. Now say you want to try tweaking the link colour, or changing the font of the headings. Instead of selecting each instance of link text in turn and making the colour adjustment, you can just make a global change to your &#8220;link&#8221; character style. It takes a little longer to set up, but you can end up saving time, especially if you&#8217;re the kind of perfectionist designer who likes to keep fiddling with things.</p>
<h3>Working with bitmaps</h3>
<p>For some things, like editing photos, you&#8217;re going to have to use Photoshop. It&#8217;s often worth &#8216;placing&#8217; PSD files into Illustrator so that transparency works properly. Placing an image (as opposed to just copying and pasting via the clipboard) also means that Illustrator can automatically update the image when you make changes to the file within Photoshop, which can be handy. Note that you can do some quick &#8216;cropping&#8217; work in Illustrator by making a &#8216;Clipping Mask&#8217;.</p>
<h3>Getting help</h3>
<p>There are lots of decent books and online tutorials around, although few of them focus on using Illustrator for web work. I&#8217;ve always preferred to teach myself, using the Adobe help files. A good place to go if you get really stuck is the official <a href="http://www.adobe.com/support/forums/">Adobe support forum</a>. There are some knowledgeable power users there, although don&#8217;t expect an answer right away. Illustrator does also have the odd strange bug every now and again, so if you really can&#8217;t work out what&#8217;s going on, it might not be your fault! 99% of the time though, the answer is there somewhere in the help files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thesheep.co.uk/2009/02/20/using-adobe-illustrator-for-web-design/feed/</wfw:commentRss>
		<slash:comments>40</slash:comments>
		</item>
		<item>
		<title>Shiny buttons in Illustrator</title>
		<link>http://www.thesheep.co.uk/2006/05/11/illustrator-shiny-button-tutorial/</link>
		<comments>http://www.thesheep.co.uk/2006/05/11/illustrator-shiny-button-tutorial/#comments</comments>
		<pubDate>Thu, 11 May 2006 12:48:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[buttons]]></category>
		<category><![CDATA[illustrator]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.thesheep.co.uk/2006/05/11/shiny-buttons-in-illustrator/</guid>
		<description><![CDATA[<p>This is a short tutorial, explaining how to produce the following type of effect in Adobe Illustrator:</p>
<p><img title="Bevelled button" src="http://www.thesheep.co.uk/wp-content/uploads/3.gif" alt="Bevelled button" /></p>
<p>This kind of texture is fairly popular at the moment.  You can use it on buttons, navigation bars, and so on.  I’ve&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>This is a short tutorial, explaining how to produce the following type of effect in Adobe Illustrator:</p>
<p><img title="Bevelled button" src="http://www.thesheep.co.uk/wp-content/uploads/3.gif" alt="Bevelled button" /></p>
<p>This kind of texture is fairly popular at the moment.  You can use it on buttons, navigation bars, and so on.  I’ve adapted the technique so that you have a single <strong>Group</strong> of objects and can easily change the colour of the button with a single click.  No need to mess around with gradient sliders</p>
<p>First, draw a rectangle and apply a <strong>Round Corner</strong> effect.  Then apply an <strong>Inner Glow</strong> effect (Effects &gt; Stylize &gt; Inner Glow).  Set the blend mode to <strong>Screen</strong> and the colour to white.  Then select <strong>center</strong>.  Alter the <strong>Opacity</strong> and <strong>Radius</strong> settings until you get a fairly subtle glow effect that does not quite reach the edges of the rectangle:</p>
<p><img title="Button step 1" src="http://www.thesheep.co.uk/wp-content/uploads/4.gif" alt="Button step 1" /></p>
<p>Next, copy this shape and paste in front. Now remove the <strong>inner glow</strong> effect from the uppermost shape.  Using the <strong>Scissors</strong> tool, carefully click the path of the new shape half-way each vertical side.  This will divide it into 2 halves.  Use the <strong>Direct Selection Tool</strong> to select the top half and delete it:</p>
<p><img title="Button step2" src="http://www.thesheep.co.uk/wp-content/uploads/5.gif" alt="Button step2" /></p>
<p>Lastly, group the 2 shapes before adding your text.  Because the <strong>Inner Glow</strong> effect has a blending mode of <strong>Screen</strong>, you can change the colour of your button very quickly, just by applying a new fill colour to the group.  You might need to adjust the opacity of the <strong>Inner Glow</strong> if you shift from a dark to a light colour.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thesheep.co.uk/2006/05/11/illustrator-shiny-button-tutorial/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

