<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <title>Blog | Steve Lacey - Web Developer &amp; Designer</title>
  <link>http://stevelacey.net/</link>
  <language>en-gb</language>
  <description>Web Developer at Wired Media in Bristol.</description>
  <copyright>Copyright © Steve Lacey 2012</copyright>
  <docs>http://www.rssboard.org/rss-specification</docs>
  <webMaster>steve@stevelacey.net (Steve Lacey)</webMaster>
   <image>
      <title>Steve Lacey - Blog</title>
      <url>http://stevelacey.net/images/logo.png</url>
      <link>http://stevelacey.net/</link>
   </image>
        <item>
       <title>Progressive Enhancement</title>
       <description>
         <![CDATA[
           What?
-----

Gone are the days where we can persist to use the excuse “I’m doing it
this way so it works in IE6”.

These awesome new tools were designed for you, and they’re never going
to get better or have decent uptake unless we start using them, now.

We now have standards to work to, and should be utilising them and
degrading their functionality, not writing crap JavaScript just because
we’re certain that will work even if it takes longer to write, is harder
to maintain and generally a mess.

How?
----

There are loads of tools emerging that allow us to make use of these
emerging technologies and backport them to the last-generation browsers-
giving our users who choose to use a modern browser a great experience
whilst not disabling our interfaces for those using older technology.

### Shim

Up until IE9, Internet Explorer rejects all unknown elements, preventing
their styling, the [HTML5 Shim by Remy Sharp][] solves that.

### Feature Detection

User-agent sniffing is poor, for a wealth of reasons, feature detection
is the future, and [Modernizr][] is a great tool for doing it; and there
are many other backporting tools built upon it.

### Backporting Selectors

There is still spurious support for various CSS2 selectors in Internet
Explorer, let alone CSS3. [Selectivizr][] uses JavaScript to add support
for a more comprehensive set of selectors for any browsers that lack
them.

### Polyfills

Polyfilling is a term [coined by Remy Sharp][] in 2010:

> A polyfill, or polyfiller, is a piece of code (or plugin) that
> provides the technology that you, the developer, expect the browser to
> provide natively. Flattening the API landscape if you will.

Polyfills are particularly useful when utilising any of the new
JavaScript API’s such as geolocation or websockets. Where the
functionality is either pretty much fully supported, or completely
absent; giving room for a full fallback implementation.

A good resource is the wide selection of [fallbacks including shims and
polyfills][] recommended by [Paul Irish][].

  [HTML5 Shim by Remy Sharp]: http://remysharp.com/2009/01/07/html5-enabling-script
  [Modernizr]: http://modernizr.com
  [Selectivizr]: http://selectivizr.com
  [coined by Remy Sharp]: http://remysharp.com/2010/10/08/what-is-a-polyfill
  [fallbacks including shims and polyfills]: https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills
  [Paul Irish]: http://paulirish.com         ]]>
       </description>
       <link>http://stevelacey.net/blog/progressive-enhancement.html</link>
       <guid>http://stevelacey.net/blog/progressive-enhancement.html</guid>
       <pubDate>2011-04-03T00:00:00+01:00</pubDate>
     </item>
        <item>
       <title>JavaScript Frameworks</title>
       <description>
         <![CDATA[
           Which to choose?
----------------

There are two *major* JavaScript frameworks being used in industry:

### [jQuery][]

> jQuery is a fast and concise JavaScript Library that simplifies HTML
> document traversing, event handling, animating, and Ajax interactions
> for rapid web development. jQuery is designed to change the way that
> you write JavaScript.

### [MooTools][]

> MooTools is a compact, modular, Object-Oriented JavaScript framework
> designed for the intermediate to advanced JavaScript developer. It
> allows you to write powerful, flexible, and cross-browser code with
> its elegant, well documented, and coherent API.

If you want to read further into the topic of which framework is right
for you, I’d recommend reading [Aaron Newton’s thoughts on the
matter][].

I admire MooTools’ approach of enhancing existing JavaScript
functionality- and it’ll definitely be something I look into for future
projects, but for the purpose of this session we’ll be focusing on
jQuery.

jQuery
------

### Getting it onto your website

You could download the latest copy and keep it locally.. but a
recommended practice is to use the copy maintained by Google as part of
their AJAX API:

`http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js`

The version number can be as
granular as you like, I often use 1 so that I get all the latest
updates, but stuff can break if a significant change is made, it’s
probably better advice to use one decimal place versioning, meaning you
get all bugfixes for that major version and minor feature releases.

The main advantages to using their API are:

1.  Updates.
2.  Bugfixes.
3.  Caching. Lots of developers do this, a majority of your users
    probably already have this file cached from another websites usage
    of the API. Meaning faster loading.

Looking for the jQuery UI hosted script?

`http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js`

### Selectors

`$("a img")`

`$("header .logo")`

`$("footer #copyright")`

#### More?

`$("input:first")`

`$("ul li:gt(5)")`

`$("p:contains('Some text')")`

#### MOAR!?

[http://api.jquery.com/category/selectors][]

### Events

These are key to deciding when things should happen. One you’ll need to
get familiar with is:

    $(document).ready(function() {
      ...
    });

This is called when the DOM is fully loaded, if you were to execute DOM
alterations prior to this event, you’d only capture whatever has been
loaded thus far.

Others are fairly self explanatory:

    $("a#logo").click(function() {
      alert("Don't click my logo!");
    });

### Animation

There are shed loads of animation methods built into jQuery:

-   [slideUp][]
-   [slideDown][]
-   [slideToggle][]
-   [fadeIn][]
-   [fadeOut][]
-   [fadeToggle][]
-   and even more available via plugins and [jQuery UI][].

### Callbacks

    $("ul").slideUp(200, function() {
      // I'm the callback, executed when the ul has finished sliding up
    });

    $("p").fadeOut(1000, function() {
      $("p.other").fadeIn(1000, function() {
        // I'm a nested callback, executed when p is faded out and p.other is faded in.
      });
    });

    $("a").click(function(event) {
      // I'm a callback executed when you click an anchor. (well.. any anchor in this case)
      $(this).siblings("p").slideDown();
      event.preventDefault(); // I don't want the anchor to act like normal! (Ask me if you want to know why not to use return false;)
    });

If you want to do a lot of stuff with a node, and stay
<abbr title="Don't Repeat Yourself">DRY</abbr>, you might want to wrap
stuff up, repeating similar selectors is lame.

    $("ul li").each(function() {
      $(this).find("a").click(function() {
        // do stuff
      });
      
      $(this).find("p").css("color", "red");
    });

### Debugging

As with every language ever, get an error, at any cost. Stop guessing.
Tools for doing so:

Webkit Inspector is built into Chrome and Safari, and is pretty
excellent- right click on anything and click inspect element to see how
your DOM is looking. To get JavaScript errors click on the console tab..

If you’re a FireFox fan, [Firebug][] is even more awesome; use that, if
you’re a Chromer, it isn’t really worth it- the Chrome version is no
match to the FireFox version or webkit inspector.

Regardless of which tool you’re using as a console. In your JavaScript
make use of **console.log** to push out the values of things when stuff
isn’t working, it’ll dump whatever you pass to it into your inspector or
FireBug console.

Exercises
---------

### Basic Animations

Do some simple event based animations, how about a button that fades or
slides a div in and out? Here’s some markup to get you started:

    <!doctype html>
    <html>
      <head>
        <title>Animation Example</title>
        <link rel="stylesheet" href="css/animation.css"/>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
        <script src="js/animation.js"></script>
      </head>
      <body>
        <button>I'M A BUTTON</button>
        <div>I'M A DIV</div>
      </body>
    </html>

And some style:

    body {
      padding: 200px;
    }

    button, div {
      display: block;
      width: 200px;
      font: 20px arial;
      text-align: center;
      line-height: 200px;
    }

    button {
      background: #e46217;
      float: left;
    }

    div {
      background: #237bff;
      float: right;
    }

#### Hints

-   You’ll want to apply the [click][] event when the document is ready.
-   You could expand on any animations you do by [changing the text
    too][].

#### Finished Example

[Basic Animations][]

### Twitter Feed Scraper

Build a really basic scraper of the Twitteer Search API.

#### Hints

-   You’ll want it to start scraping when the document is ready.
-   If only there was some [documentation of how to use the Twitter
    Search API][].
-   You’ll probably want to use AJAX, if only [jQuery had a method for
    that][].
-   JavaScript Object Notation (JSON) requires no additional parsing by
    JavaScript.
-   Twitter isn’t on cems.uwe.ac.uk, so this is cross-domain… **JSONP**
    is a hack around doing cross-domain AJAX… lucky that jQuery natively
    supports that **dataType**.
-   You’d want tweets in the DOM so users can see them, perhaps you
    could [prepend][] each list item to an unordered list you add to
    body?
-   To keep polling for tweets you’ll want to push your code out to a
    function, then make it recursive with a delay; try sticking
    **setTimeout(’getTweets()’, 2000);** at the end of it ;) don’t
    forget to call the function for the first time when the document is
    ready.
-   You can do all this in <30 lines of jQuery.

#### Finished Example

[Basic Twitter Feed Scraper][]

Onwards!
--------

Hopefully having had a play, you have the key understand to take this
forward, the key to using frameworks is documentation, and jQuery has
shed loads ([http://api.jquery.com][]). jQuery is all based around these
core concepts, so you should be able to see patterns when using new
functionalities, I don’t know this stuff, I’m guessing most of the time-
there’s no magic involved, jQuery is logical and readable and with a bit
of practice you’ll find it easy.

  [jQuery]: http://jquery.com
  [MooTools]: http://mootools.net
  [Aaron Newton’s thoughts on the matter]: http://jqueryvsmootools.com
  [http://api.jquery.com/category/selectors]: http://api.jquery.com/category/selectors/
  [slideUp]: http://api.jquery.com/slideUp
  [slideDown]: http://api.jquery.com/slideDown
  [slideToggle]: http://api.jquery.com/slideToggle
  [fadeIn]: http://api.jquery.com/fadeIn
  [fadeOut]: http://api.jquery.com/fadeOut
  [fadeToggle]: http://api.jquery.com/fadeToggle
  [jQuery UI]: http://jqueryui.com/demos/animate
  [Firebug]: http://getfirebug.com
  [click]: http://api.jquery.com/click
  [changing the text too]: http://api.jquery.com/text
  [Basic Animations]: /examples/javascript-frameworks/animation
  [documentation of how to use the Twitter Search API]: http://apiwiki.twitter.com/w/page/22554756/Twitter-Search-API-Method:-search
  [jQuery had a method for that]: http://api.jquery.com/jQuery.ajax
  [prepend]: http://api.jquery.com/prepend
  [Basic Twitter Feed Scraper]: /examples/javascript-frameworks/twitter
  [http://api.jquery.com]: http://api.jquery.com/         ]]>
       </description>
       <link>http://stevelacey.net/blog/javascript-frameworks.html</link>
       <guid>http://stevelacey.net/blog/javascript-frameworks.html</guid>
       <pubDate>2011-04-01T00:00:00+01:00</pubDate>
     </item>
        <item>
       <title>Version Control</title>
       <description>
         <![CDATA[
           <h2>
	Why is it awesome?</h2>
<ul>
	<li>
		Track changes.</li>
	<li>
		Never lose code again. Seriously.</li>
	<li>
		Revert stuff when you dick it.</li>
	<li>
		Collaborate as part of a team, without conflict, even when working on the same file(s).</li>
	<li>
		Deploy stuff easily, and without having to remember what you&#39;ve changed.</li>
	<li>
		Open-Source your projects, look awesome.</li>
	<li>
		Make something cool, open, and encourage contribution, free code.</li>
	<li>
		Every agency ever uses it. If they don&#39;t. They&#39;re doing it wrong.</li>
</ul>
<h2>
	What are the options?</h2>
<ul>
	<li>
		<a href="http://subversion.apache.org">Subversion</a> (SVN)
		<ul>
			<li>
				A bit legacy, likes to break and yell TREE CONFLICT at your face.</li>
			<li>
				Still used for major codebases like Wordpress and the Symfony Project.</li>
			<li>
				The majority are migrating away from it. But it&#39;s still useful if you want to contribute or utilise the above.</li>
		</ul>
	</li>
	<li>
		<a href="http://git-scm.com">Git</a>
		<ul>
			<li>
				Distributed.</li>
			<li>
				Pretty hard to dick.</li>
			<li>
				Quite approachable.</li>
			<li>
				Github.</li>
		</ul>
	</li>
	<li>
		<a href="http://mercurial.selenic.com">Mercurial</a>
		<ul>
			<li>
				Distributed.</li>
			<li>
				Looks cool.</li>
			<li>
				Supported by Github also.</li>
			<li>
				Considered it when migrating away from SVN at work.. went with Git.</li>
		</ul>
	</li>
</ul>
<h2>
	So how do I use it?</h2>
<p>
	Command line will always be the fastest way, and isn&#39;t too scary once you&#39;ve got used to it.</p>
<p>
	If you&#39;re on a Mac; Git Tower looks <strike>cool</strike> pretty. Don&#39;t ask me how to use it though; I&#39;d be guessing.</p>
<h3>
	Repository</h3>
<p>
	.git</p>
<h3>
	Staging Area</h3>
<p>
	Every file change that you want to commit goes into the staging area at some point. Adding or removing puts stuff in the staging area. You can see what&#39;s in it when you do &#39;git status&#39;.</p>
<p>
	You can dynamically stage stuff and commit it all at once by adding the &#39;a&#39; flag to your commit:</p>
<p>
	<code>git commit &ndash;am &quot;Blah blah added some new buttons and stuff.&quot;</code></p>
<p>
	That would commit all the files that git already knows about that have changed (so no untracked files).</p>
<p>
	You also don&#39;t have to commit the whole stage at once. You can add file paths (space-delimitated) to most commands:</p>
<p>
	<code>git commit &ndash;m &quot;OMG some images!&quot; images/flowers/* images/trees images/logo.png</code></p>
<h3>
	Some scenarios</h3>
<p>
	I&#39;ve added a feature, and nothing else, all these files need to go up!</p>
<p>
	<code>git add . // Unix basics, &#39;.&#39; Remember?<br />
	git status // Check what&#39;s going up<br />
	git commit &ndash;m &quot;My awesome new feature that does x. YAY.&quot;</code></p>
<p>
	Done.</p>
<p>
	<code>git commit &ndash;m &quot;I made some changes to the config and junk.&quot; includes/config.php</code></p>
<p>
	Done.</p>
<p>
	I want my code on Github so people see it and think &quot;WOW, YOU&#39;RE AWESOME&quot;</p>
<p>
	Having committed some stuff. Push.</p>
<h3>
	Argh I need to configure Github!</h3>
<p>
	Note: You&#39;ll need to copy an SSH public key from your environment to Github, so that it knows it&#39;s yours and its okay to accept code from it.</p>
<p>
	How?</p>
<p>
	<a href="http://help.github.com/win-set-up-git/">help.github.com/win-set-up-git</a></p>
<p>
	Follow the bit starting at:</p>
<p>
	Next: Set Up SSH Keys</p>
<p>
	3. Generate a new SSH key.</p>
         ]]>
       </description>
       <link>http://stevelacey.net/blog/version-control.html</link>
       <guid>http://stevelacey.net/blog/version-control.html</guid>
       <pubDate>2011-03-31T00:00:00+01:00</pubDate>
     </item>
        <item>
       <title>Command Line Basics</title>
       <description>
         <![CDATA[
           <h2>
	Configuring your environment</h2>
<div>
	<p>
		To access milly&#39;s CLI you&#39;ll be needing an SSH client, if you&#39;re on a Mac, that&#39;ll do, go to terminal and use the ssh function. If you&#39;re on Windows, man up and get a Mac.. or download&nbsp;<a href="http://chiark.greenend.org.uk/~sgtatham/putty">Putty</a>.</p>
	<p>
		To login, go to:&nbsp;cemsusername@milly</p>
	<p>
		Command line interfaces (CLI) have different &#39;shells&#39;, which are basically CLI environments. UWE&#39;s milly server is based on Solaris; which uses some crazy shell, bash has a more common set of functions and more scripts readily available in the &#39;path&#39; (Git and Vim for example). To set up your CLI environment to use bash execute these two commands, which will copy some configuration files from my account to your home (unix) directory.</p>
	<p><code>cp /nas/students/s/slacey/unix/.cshrc ~</code></p><p><code> cp /nas/students/s/slacey/unix/.bashrc ~</code></p>
	<p>
		Restart putty and you should be in bash. You should be able see &quot;username@milly&quot; rather than &quot;&gt;&quot; now and if you execute &#39;git&#39; you should get the Git help screen rather than &quot;command not found&quot;.</p>
	<p>
		Now for some basics:</p>
	<h2>
		Traversing</h2>
	<p>
		Getting around you&#39;ll need to know some of the characters used for navigating via command line. These cascade across all lines of web work, you&#39;ll know a few of them:</p>
	<table style="border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; ">
		<tbody>
			<tr>
				<td style="border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; ">
					Currenct Directory</td>
				<td style="border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; ">
					.</td>
			</tr>
			<tr>
				<td style="border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; ">
					Parent Directory</td>
				<td style="border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; ">
					..</td>
			</tr>
			<tr>
				<td style="border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; ">
					Wildcard, match everything</td>
				<td style="border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; ">
					*</td>
			</tr>
			<tr>
				<td style="border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; ">
					Home Directory (aka your unix directory)</td>
				<td style="border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; ">
					~</td>
			</tr>
			<tr>
				<td style="border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; ">
					Root</td>
				<td style="border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; ">
					/</td>
			</tr>
		</tbody>
	</table>
	<p>
		Get used to the &#39;cd&#39; (change directory) function, you&#39;ll be using it a lot. After logging in, you&#39;ll be in your home directory (unix drive), so for example from here you could:</p>
	<p>
		<code>cd public_html (go to public_html)</code></p>
	<p>
		<code>cd ../windows (go to your Windows directory)</code></p>
	<p>
		<code>cd . (move to the current directory... where you already are... pointless)</code></p>
	<p>
		<code>cd / (go to root... where there&#39;s some stuff, you&#39;re not allowed to touch any of it)</code></p>
	<p>
		<code>cd ../../../../ (go to... somewhere...)</code></p>
	<p>
		Bash tab completion is awesome. Who likes typing stuff? It&#39;s dull. If you&#39;ve started typing a path, and there&#39;s only one file or directory that matches what you&#39;ve typed so far, hit tab, and it&#39;ll complete it for you.. if not, hit it again and bash will recommend what possible matches there are. Don&#39;t type everything out manually. You&#39;ll get RSI.</p>
	<h2>
		Listing files</h2>
	<div>
		<p>
			List files with &#39;ls&#39;, it has a few options too, you specify those with a dash.</p>
		<table style="border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; ">
			<tbody>
				<tr>
					<td style="border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; ">
						Long format</td>
					<td style="border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; ">
						ls -l</td>
				</tr>
				<tr>
					<td style="border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; ">
						\w Hidden files</td>
					<td style="border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; ">
						ls -a</td>
				</tr>
				<tr>
					<td style="border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; ">
						Long format, \w hidden files</td>
					<td style="border-top-color: rgb(211, 211, 211); border-right-color: rgb(211, 211, 211); border-bottom-color: rgb(211, 211, 211); border-left-color: rgb(211, 211, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; ">
						ls -la</td>
				</tr>
			</tbody>
		</table>
	</div>
	<h2>
		Permissions</h2>
	<div>
		&ldquo;chmod&rdquo; is the command line tool that you use to set permissions on files. It stands for change mode and allows you to fine tune who can access the files and to what level.<br />
		<br />
		First, let&rsquo;s see what it can do. Chances are you won&rsquo;t understand what&rsquo;s going on but I&rsquo;ve often found that it&rsquo;s easier to learn about something if you know what it can achieve first.<br />
		<br />
		To see what the current permissions of a file run &ldquo;ls -l&rdquo; at the command line:</div>
	<div>
		<img alt="CLI Permissions" src="/images/uploads/564x279/cli-permissions.png" style="width: 564px; height: 279px; " /></div>
	<div>
		<div>
			The boxed area is the permissions for each file. d at the beginning indicates a directory, following this there are three groups of three letters, these indicate the permissions for different user groups&mdash;we&rsquo;ll get on to that later.<br />
			<br />
			By the way, if you wanted to know what all the other stuff means, here goes:<br />
			<br />
			Access Permissions | Files Contained (1 if it is a file) | Owner | Group Owner | Size | Date Last Modified | File Name</div>
		<div>
			&nbsp;</div>
	</div>
	<div>
		<img alt="Directory Listing 755" src="/images/uploads/564x207/directory-listing-755.png" style="width: 564px; height: 207px; " /></div>
	<div>
		<div>
			Accessing the folder in Apache, we can see our folder. What if we want to keep it private?</div>
	</div>
	<div>
		<img alt="CLI Change Permissions" src="/images/uploads/430x267/cli-changing-permissions.png" style="width: 430px; height: 267px; " /></div>
	<div>
		<div>
			Here is an extreme case, we change the permissions of the file to 000 (nobody can read the file, write to it or execute it&mdash;ouch).</div>
	</div>
	<div>
		<img alt="Directory Listing 000" src="/images/uploads/578x190/directory-listing-000.png" style="width: 578px; height: 190px; " /></div>
	<div>
		<div>
			And as if by magic, we can no longer see it. If we try to access the folder directly:</div>
	</div>
	<div>
		<img alt="Forbidden" src="/images/uploads/530x139/forbidden.png" style="width: 530px; height: 139px; " /></div>
	<div>
		<div>
			<p>
				There&rsquo;s two ways of setting permissions. By letters (symbolic) or numbers (numeric). The possible values are listed in the table below.</p>
			<table>
				<colgroup>
					<col width="51" />
					<col width="76" />
					<col width="172" />
				</colgroup>
				<tbody>
					<tr>
						<td>
							#</td>
						<td>
							Symbolic</td>
						<td>
							Permissions</td>
					</tr>
					<tr>
						<td>
							7</td>
						<td>
							rwx</td>
						<td>
							Full</td>
					</tr>
					<tr>
						<td>
							6</td>
						<td>
							rw</td>
						<td>
							Read and Write</td>
					</tr>
					<tr>
						<td>
							5</td>
						<td>
							rx</td>
						<td>
							Read and Execute</td>
					</tr>
					<tr>
						<td>
							4</td>
						<td>
							r</td>
						<td>
							Read Only</td>
					</tr>
					<tr>
						<td>
							3</td>
						<td>
							wx</td>
						<td>
							Write and Execute</td>
					</tr>
					<tr>
						<td>
							2</td>
						<td>
							w</td>
						<td>
							Write Only</td>
					</tr>
					<tr>
						<td>
							1</td>
						<td>
							x</td>
						<td>
							Execute Only</td>
					</tr>
					<tr>
						<td>
							0</td>
						<td>
							&nbsp;</td>
						<td>
							None</td>
					</tr>
				</tbody>
			</table>
		</div>
	</div>
</div>
<div>
	<h3>
		Syntax</h3>
	<h4>
		Numeric</h4>
	<p>
		chmod [numeric] [folder/filename]<br />
		<br />
		The numeric notation expects three numbers:</p>
	<table>
		<tbody>
			<tr>
				<td style="text-align: right; ">
					7</td>
				<td style="text-align: center; ">
					7</td>
				<td>
					7</td>
			</tr>
			<tr>
				<td style="text-align: right; ">
					File Owner</td>
				<td style="text-align: center; ">
					Group</td>
				<td>
					Other Users</td>
			</tr>
		</tbody>
	</table>
	<h4>
		Symbolic</h4>
	<p>
		chmod [user group]+[symbolic] [folder/filename]<br />
		<br />
		The symbolic notation expects some letters (the permissions) and some more letters (who it&rsquo;s targeting)<br />
		<br />
		File Owner (u) =&gt; Group (g) =&gt; Others (o) =&gt; All (a)<br />
		<br />
		So if you want to do the equivalent of a numeric &ldquo;777&rdquo; you would do:<br />
		<br />
		chmod a+rwx my_awesome_folder<br />
		<br />
		Here&rsquo;s an example of a variety of folder permissions and how they look:</p>
	<p>
		<img alt="Mixed Permissions" src="/images/uploads/403x273/mixed-permissions.png" style="width: 403px; height: 273px; " /></p>
</div>
         ]]>
       </description>
       <link>http://stevelacey.net/blog/command-line-basics.html</link>
       <guid>http://stevelacey.net/blog/command-line-basics.html</guid>
       <pubDate>2011-03-29T00:00:00+01:00</pubDate>
     </item>
        <item>
       <title>Spotify</title>
       <description>
         <![CDATA[
           <p>
	Never download music again!.. or at least that&#39;s what I&#39;m going to do. It&#39;s not often I come across an application that changes the way I live as dramatically as Spotify&nbsp;does.</p>
<p>
	Spotify is basically a streaming application, but different to any I&#39;ve ever seen before. Their database contains a massive selection of songs, all of which are available to you at the click of a mouse. The quality of the service is so extraordinary you won&#39;t even notice a delay, the bitrate of the music streamed is around 160kbps and I challenge anyone to notice any difference to playing music from your hard drive.</p>
<p>
	The service is funded by non-intrusive advertising in the form of audio ads that play every 20 or so songs and a banner that appears in the application every now and again. If these are annoying you, you can also opt to pay a quid for a day pass, or a monthly membership.</p>
<p>
	As long as record labels continue their support of the application (and don&#39;t get their artists removed from the service... Metallica) I think Spotify could be revolutionary to the way we listen to music.</p>
<p>
	At the moment Spotify is only available on PC/Mac but they are planning for expansion onto the Symbian platform as well as other systems, presumably including the iPhone. With it&#39;s built-in Last.fm and <acronym title="Windows Live Messenger">WLM</acronym> integration and the ability to share your playlists with your friends via simple HTTP links; Spotify is the perfect little music app and I definitely recommend you to have a go with it. <a href="spotify:user:stevelacey:playlist:5UYC01rjX4MgBzAn3QWgvA">I only have one playlist at the moment, click here to add it.</a></p>
<p>
	Presently Spotify is invite-only unless you pay for a premium account. I have 5 invites left so feel free to drop me a message if you want to grab one.</p>
         ]]>
       </description>
       <link>http://stevelacey.net/blog/spotify.html</link>
       <guid>http://stevelacey.net/blog/spotify.html</guid>
       <pubDate>2009-02-08T00:00:00+00:00</pubDate>
     </item>
        <item>
       <title>Christmas PAL Session</title>
       <description>
         <![CDATA[
           <p>
	It's the last session before Christmas, as part of the festive cheer I have hidden 7 Santa's and a Snowman on my site. Whoever spots them all and post there location as a comment on this post first wins a box of celebrations! (The Santa on this post doesn't count!) Good Luck!</p>
         ]]>
       </description>
       <link>http://stevelacey.net/blog/christmas-pal-session.html</link>
       <guid>http://stevelacey.net/blog/christmas-pal-session.html</guid>
       <pubDate>2008-12-15T00:00:00+00:00</pubDate>
     </item>
        <item>
       <title>Stockazon</title>
       <description>
         <![CDATA[
           <p>
	It&#39;s been a long time since my last article, so I thought I&#39;d post a quick update. A few weeks ago I was approached by a&nbsp;developer I&#39;ve known for a few years who wanted me to design a new website for his next project &#39;Stockazon&#39;.</p>
<p>
	The concept is basically for a website that distributes SMS text messages to users alerting them when new stock arrives in on Amazon items that they&#39;re watching. Users can buy &#39;credits&#39; from Stockazon via PayPal and search and add items to their basket via the website.</p>
<p>
	The website is still very much in development but you can check out the progress by clicking the image to the right, once completed I&#39;ll also add it to the Portfolio page. I am working on purely the front-end of the site, all the graphics, HTML and CSS. The back-end has already been developed by the owner so my only task is to make the website functional and appealing to users.</p>
<p>
	In other news I&#39;ve been busy enjoying the summer, it&#39;s good to have a break from Uni; but I&#39;m also looking forward to going back in September. I&#39;ve now signed up to the PAL (Peer Assisted Learning) Scheme, and will be trained in late September, so next year I will be paid to run PAL Sessions with 1st Year Students who are taking the &#39;Introduction to the Web&#39; module that I did last year. I feel this will be a positive experience for me and assist with improving my communication skills and should hopefully make it easier for me to find a work placement opportunity next year.</p>
<p>
	I&#39;ve still got big plans for the improvement and expansion of Easy Freebie, it&#39;s just an issue of getting around to doing it. I want to update all the sites to a new design, link them all to a central offers database and add a whole bunch of new exciting features. Once all that is complete I will be investing some serious money in advertising and be running a selection promotions exclusive to <a href="http://www.exceem.co.uk/forums/index-ref-4028.html" rel="external">eXceem</a> members.</p>
<p>
	If you have any suggestions for the Stockazon design, please leave a comment below and I&#39;ll get right on it. You may also notice the new feature I&#39;ve added, if you enter your E-Mail address when posting, you&#39;ll receive an alert when someone else leaves a response!</p>
         ]]>
       </description>
       <link>http://stevelacey.net/blog/stockazon.html</link>
       <guid>http://stevelacey.net/blog/stockazon.html</guid>
       <pubDate>2008-08-15T00:00:00+01:00</pubDate>
     </item>
        <item>
       <title>The Planet</title>
       <description>
         <![CDATA[
           <p>
	<a href="http://www.theplanet.com"><img alt="ThePlanet.com" src="/images/uploads/233x54/the-planet-1.png" style="float: right; padding: 0 0 20px 20px" /></a>Apologies for the downtime of the site over the last couple of days; it was caused by an explosion in Houston, Texas at <a href="http://www.theplanet.com" rel="external">ThePlanet.com&#39;s</a> datacentre which knocked out over 9000 websites including my own. It took me a while to establish what had caused the problem, mainly because I&#39;m down a hierarchy of 2 other companies before I get to <a href="http://www.theplanet.com" rel="external">ThePlanet</a> (<a href="http://www.surespace.net" rel="external">SureSpace.net</a> that purchases reseller hosting from <a href="http://www.hostnine.com" rel="external">HostNine.com</a> who rent space from <a href="http://www.theplanet.com" rel="external">ThePlanet.com</a>). The explosion was caused by an electrical fire in one of the rooms of the facility, the blast was powerful enough to take down 3 walls in an equipment room but fortunately no-one was injured and none of the servers were damaged. The downtime lasted around 36 hours, as they fought to restore power after being re-allowed access to the facility by fire services. I was writing a blog at the time of the accident at about 7pm BST Saturday and was quite aggravated by the sudden downtime; but I am at least pleased that everything has now been repaired and that no data was lost.</p>
         ]]>
       </description>
       <link>http://stevelacey.net/blog/the-planet.html</link>
       <guid>http://stevelacey.net/blog/the-planet.html</guid>
       <pubDate>2008-06-02T00:00:00+01:00</pubDate>
     </item>
        <item>
       <title>BBC Website Overspend</title>
       <description>
         <![CDATA[
           <p>
	<a href="http://www.bbc.co.uk"><img alt="BBC" src="/images/uploads/135x38/bbc.png" style="background: #000; float: right; margin: 0 0 20px 20px; padding: 4px;" title="BBC" /></a>In the news this week is the apparent overspend by the BBC on the development of their new website.</p>
<p>
	Now I would certainly not be the first to acknowledge that the new website is the pinnacle of what we as developers look for in modern web design, pretty much everything about it is fantastic. But should it have really cost &pound;85.1 million to do it? <a href="http://www.bbc.co.uk"><img alt="BBC Home" src="/images/uploads/260x125/bbc-homepage-1.png" style="float: left; margin: 15px 0 10px 0;" title="BBC Home" /></a> There are many reports in the tabloids at the moment claiming the BBC overspent by as much as &pound;36 million (Source: <a href="http://www.guardian.co.uk/media/2008/may/29/bbc.digitalmedia">The Guardian</a>); however the figure I&#39;m more likely to be convinced by is what was stated by Dame Patricia Hodgson that the BBC exceeded their budget by approximately &pound;3.5 million.</p>
<p>
	Either way I find it hard to believe that the amount paid was worth it, I know I certainly would be a very happy man if I were working for the BBC web development team and got handed an amount as substantial as what some of the team must have got.</p>
<p>
	There is no doubt in my mind that the new website is brilliant, the whole look and feel of the site is above and beyond the old one. The use of whitespace is much improved; the whole design feels a lot less cluttered and they made the somewhat logical step to abandon compatibility with legacy screen resolutions. The new BBC iPlayer is astounding; It certainly comes in use when I want to quench my thirst for Dr Who when usually I have missed the show on Saturday evenings. In addition to this, the BBC News site is so much more user-friendly now, I can spend a lot of time browsing it now that I don&#39;t get aggravated by the small fixed width, left-aligned design. <a href="http://news.bbc.co.uk"><img alt="BBC News" src="/images/uploads/260x125/bbc-news.png" style="float: right; margin: 10px 0;" title="BBC News" /></a> The interactivity of the new site is also a big selling point in my opinion. I&#39;m a big fan of AJAX, which is used a lot around the new site, allowing the user to fully customise their experience on the site easily without reloading the page; and also allowing the BBC to obtain more information about how their users navigate their site and therefore develop around those needs. The simple use of pastel colours and slight gradient also contributes to making the design near perfect and a complete joy to use.</p>
         ]]>
       </description>
       <link>http://stevelacey.net/blog/bbc-website-overspend.html</link>
       <guid>http://stevelacey.net/blog/bbc-website-overspend.html</guid>
       <pubDate>2008-06-02T00:00:00+01:00</pubDate>
     </item>
        <item>
       <title>Save the Developers</title>
       <description>
         <![CDATA[
           <p>
	Well it&#39;s finally complete! If you&#39;ve been keeping up with the random posts I&#39;ve been making on here over the last week or so you&#39;ll have noticed the development of this blog which is now pretty much ready for use. There may be some tiny issues over the next month or so and features I may add such as a fixed position for images in posts or &#39;trackbacks&#39; and a &#39;tag cloud&#39; but the basic system is good to go. If you&#39;re one of the people that for some reason still uses Internet Explorer, you may notice some graphical issues around the blog e.g. on the comments section; I will fix these at some point but it&#39;s not high on my priorities as IE has been known to cause me to have somewhat mental breakdowns at the wrath of the ignorant way it interprets XHTML &amp; CSS. This brings me onto a website I found a month or so ago on my friend <a href="http://www.byrion.com" rel="external">Byrion&#39;s website</a>:</p>
<div style="text-align: center;">
	<a href="http://www.savethedevelopers.org" rel="external"><img alt="Save the Developers" src="/images/uploads/600x122/save-the-developers.png" /></a></div>
<p>
	<a href="http://www.savethedevelopers.org" rel="external">Save the Developers</a> is a website dedicated to the promotion of upgrading your browser if you are still using the now legacy browser, Internet Explorer 6, to at least Internet Explorer 7 or even better an alternative browser such as FireFox, Opera or Safari. Developers can join the movement to promote this as standard so that no longer will we have to toil developing various &#39;holly hacks&#39; and other IE6-only scripting in order to be fully compatible, by simply adding a script to their site which will alert any users that visit who are using legacy browsers. Join the cause!</p>
         ]]>
       </description>
       <link>http://stevelacey.net/blog/save-the-developers.html</link>
       <guid>http://stevelacey.net/blog/save-the-developers.html</guid>
       <pubDate>2008-05-29T00:00:00+01:00</pubDate>
     </item>
     <atom:link href="http://stevelacey.net/blog/feed.rss" rel="self" type="application/rss+xml" />
</channel>
</rss>
