<?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>Paul Randall &#187; coding</title>
	<atom:link href="https://paulrandall.com/category/coding/feed/" rel="self" type="application/rss+xml" />
	<link>https://paulrandall.com</link>
	<description>Experimenting for a living.</description>
	<lastBuildDate>Sat, 15 Mar 2025 15:32:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.41</generator>
	<item>
		<title>CSS Shorthand</title>
		<link>https://paulrandall.com/2011/08/18/css-shorthand/</link>
		<comments>https://paulrandall.com/2011/08/18/css-shorthand/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 11:20:59 +0000</pubDate>
		<dc:creator><![CDATA[Paul]]></dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://prandall.com/?p=450</guid>
		<description><![CDATA[CSS shorthand is to me a no brainer and it’s use can have huge benefits – some of which include smaller file sizes, less code to read and it makes files quicker and easier to comprehend and maintain. In this post I’m going to be talking about box styling – any CSS effects that can [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>CSS shorthand is to me a no brainer and it’s use can have huge benefits – some of which include smaller file sizes, less code to read and it makes files quicker and easier to comprehend and maintain.</p>
<p>In this post I’m going to be talking about box styling – any CSS effects that can be implemented on all 4 sides of an element. This can include:</p>
<p><span id="more-450"></span></p>
<ul>
<li>padding</li>
<li>margins</li>
<li>borders</li>
</ul>
<p>There are 4 different ways of ways of applying styles to the sides of an element. The most conventional is the longest version which styles the sides clockwise from top, right, bottom and left. You can remember this as TrouBLe. This method allows you to set a different style on all 4 sides.</p>
<p><code>element{padding: [top] [right] [bottom] [left]}</code></p>
<p>Using 3 figures allows you to style the top, with left and right at the same time, followed by the bottom. This is useful if you require the same size on the left and right, but a different size for top and bottom.</p>
<p><code>element{padding: [top] [left/right] [bottom]}</code></p>
<p>Styling both the top and bottom, and the left and right sides can be done using 2 figures. This can be used when the top and bottom sizes are the same and the left and right sizes are the same.</p>
<p><code>element{padding: [top/bottom] [left/right]}</code></p>
<p>The last possibility is where all sides have the same size declaration. This can be achieved by using just one value.</p>
<p><code>element{padding: [top/bottom/left/right]}</code></p>
<h3>Bonus Tip</h3>
<p>When using 0 as a value, it doesn’t matter whether it is a pixel, em or any other measure so whenever using 0, just declare it on its own.</p>
]]></content:encoded>
			<wfw:commentRss>https://paulrandall.com/2011/08/18/css-shorthand/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tracking Outbound Links Using Google Analytics</title>
		<link>https://paulrandall.com/2011/07/27/tracking-outbound-links-using-google-analytics/</link>
		<comments>https://paulrandall.com/2011/07/27/tracking-outbound-links-using-google-analytics/#comments</comments>
		<pubDate>Wed, 27 Jul 2011 16:09:48 +0000</pubDate>
		<dc:creator><![CDATA[Paul]]></dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[link]]></category>

		<guid isPermaLink="false">http://prandall.com/?p=447</guid>
		<description><![CDATA[Having just set up a new site, called Typography Links on tumblr, I wanted to know how many people actually click on the links to the sites that I post. Having used tumblr for the first time, I didn&#8217;t know of any way to track this, and although I could use a URL shortening service [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Having just set up a new site, called <a href="http://typographylinks.com">Typography Links</a> on tumblr, I wanted to know how many people <em>actually</em> click on the links to the sites that I post.</p>
<p>Having used tumblr for the first time, I didn&#8217;t know of any way to track this, and although I could use a URL shortening service like bit.ly, i&#8217;ve never been a huge fan, as they mask the location you are being directed to.</p>
<p><span id="more-447"></span></p>
<p>So what I came up with was an amalgamation of two pieces of JavaScript, that seems to have done the trick:</p>
<p><code><br />
function recordOutboundLink(link, category, action) {<br />
	try{<br />
		var pageTracker = _gat._getTracker("UA-XXXXXXXX-X");<br />
		pageTracker._trackEvent(category, action);<br />
		setTimeout('document.location = "' + link.href + '"', 100)<br />
	} catch(err) {}<br />
}</p>
<p>$(document).ready(function() {<br />
	$('a').each(function() {<br />
		var a = new RegExp('/' + window.location.host + '/');<br />
		if(!a.test(this.href)) {<br />
			$(this).click(function(event) {<br />
				recordOutboundLink(this, 'Outbound Links', this.text);<br />
				return false;<br />
			});<br />
		}<br />
	});<br />
});<br />
</code></p>
<p>So in short, this code checks through the webpage for any outbound links (you could narrow this down to particular items simply by altering the jQuery selector) and posts an event to Google Analytics, before then forwarding the user on.</p>
<p>My two code sources came from an analytics help article <a href="http://www.google.com/support/analytics/bin/answer.py?answer=55527">How do I manually track clicks on outbound links?</a> and <a href="http://css-tricks.com/snippets/jquery/open-external-links-in-new-window/">Open External Links In New Window</a>.</p>
<p>Now, I know that these can be optimised, but to be honest, it seems to work, and I didn&#8217;t want to spend too much time developing the code for this tumblr site.</p>
<p>These events then appear in analytics under events, and are marked as &#8216;Outbound Links&#8217; as that what it was called in the JS.</p>
<p>I&#8217;ve certainly found it useful, and I hope that you might too.</p>
]]></content:encoded>
			<wfw:commentRss>https://paulrandall.com/2011/07/27/tracking-outbound-links-using-google-analytics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Everything that can be invented has been invented</title>
		<link>https://paulrandall.com/2010/08/02/everything-that-can-be-invented-has-been-invented/</link>
		<comments>https://paulrandall.com/2010/08/02/everything-that-can-be-invented-has-been-invented/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 20:45:26 +0000</pubDate>
		<dc:creator><![CDATA[Paul]]></dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[competition]]></category>
		<category><![CDATA[thoughts]]></category>
		<category><![CDATA[ideas]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[websites]]></category>

		<guid isPermaLink="false">http://prandall.com/?p=373</guid>
		<description><![CDATA[&#8220;Everything that can be invented has been invented&#8221; Quote anecdotally misattributed to Charles H. Duell, Commisioner, US Patent Office, 1899 Apparantly a misquote, sometimes the web can feel like this at times. You work on a idea you have just thought of, only to find it already exists. Whilst working on something for http://10k.aneventapart.com/ &#8211; [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>&#8220;Everything that can be invented has been invented&#8221;</strong></p>
<p><span><em>Quote anecdotally misattributed to Charles H. Duell, Commisioner, US Patent Office, 1899</em></span></p>
<p>Apparantly a <a href="http://www.myoutbox.net/posass.htm">misquote</a>, sometimes the web can feel like this at times. You work on a idea you have just thought of, only to find it already exists.</p>
<p>Whilst working on something for <a href="http://10k.aneventapart.com/">http://10k.aneventapart.com/</a> &#8211; an event where you can submit a little web app which is no larger than 10k, I did a bit of googling to find the exact same thing has already been built.</p>
<h2>Colour Palette Creator</h2>
<p>After seeing <a href="http://www.stuffandnonsense.co.uk/archives/creating_colour_palettes.html">Andy Clarke&#8217;s post ages ago about creating colour palettes</a>, I thought it would be a great little tool to have &#8211; and the 10k event was the perfect opportunity to make it. But I was beaten to it: <a href="http://slayeroffice.com/tools/color_palette/">http://slayeroffice.com/tools/color_palette/</a></p>
<h3>And again&#8230;</h3>
<p>A while ago I had the idea of a neverending book idea, where everyone can add a sentence to continue the book. Yep, already been done.</p>
<p>The same goes for website designs. I saw a blog design with the identical look to one of the rejected mockups for this blog. I couldn&#8217;t believe it. I didn&#8217;t take mine further than the PSD stage; good job too.</p>
<h3>Why am complaining?</h3>
<p>Most of my &#8216;ideas&#8217; are just that &#8211; they never get past a quick doodle in the Moleskine. I should be grateful these people are building my ideas!</p>
<h3>Back to the drawing board</h3>
<p>So once again, I am thinking of things to make for the event. Lets build it quick before anyone else does!</p>
]]></content:encoded>
			<wfw:commentRss>https://paulrandall.com/2010/08/02/everything-that-can-be-invented-has-been-invented/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Language Agnostic Programming</title>
		<link>https://paulrandall.com/2010/06/15/language-agnostic-programming/</link>
		<comments>https://paulrandall.com/2010/06/15/language-agnostic-programming/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 11:42:42 +0000</pubDate>
		<dc:creator><![CDATA[Paul]]></dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[thoughts]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://prandall.com/?p=360</guid>
		<description><![CDATA[Having coded in many languages, and recently when using MooTools instead of jQuery, i&#8217;ve come to realise that most actual programming is pretty language agnostic. What I mean is that most languages do the same thing, just very differently, but it is how you contruct your code that makes you a good programmer Chances are, [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Having coded in many languages, and recently when using MooTools instead of jQuery, i&#8217;ve come to realise that most <strong>actual</strong> programming is pretty language agnostic. What I mean is that most languages do the same thing, just very differently, but it is how you contruct your code that makes you a good programmer</p>
<p>Chances are, if you are good at jQuery you will be pretty good at MooTools (after learning the new declarations etc). The same goes for in a larger extent SQL/MySQL/Oracle or ASP/PHP/Ruby etc.</p>
<p><span id="more-360"></span></p>
<p>This stems from when I was at college and we would write psuedo-code, programming without any actually code. Something like this:</p>
<p><code><br />
if number is greater than or equal to 10 then<br />
write "congratulations, you are a winner!"<br />
</code></p>
<p>Now this very basic bit of programming isn&#8217;t very complex, but when building up larger bits of code, the skill comes in how you construct your code, not what language you write it in.</p>
<p><em>note: I am still a huge fan of jQuery, but MooTools does look pretty awesome as well. Perhaps I&#8217;ll write my own little comparison once I&#8217;ve used it a bit more.</em></p>
]]></content:encoded>
			<wfw:commentRss>https://paulrandall.com/2010/06/15/language-agnostic-programming/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Kitchen Sink of HTML</title>
		<link>https://paulrandall.com/2009/10/16/the-kitchen-sink-of-html/</link>
		<comments>https://paulrandall.com/2009/10/16/the-kitchen-sink-of-html/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 19:10:13 +0000</pubDate>
		<dc:creator><![CDATA[Paul]]></dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[downloads]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://prandall.com/?p=207</guid>
		<description><![CDATA[Whenever I start a new project, I seem to be repeating myself when it comes to adding, and styling basic content: Headers, Lists and Tables etc. So I decided to create a &#8216;Kitchen Sink&#8217; of markup and basic styling, using some content from the great HTML-Ipsum.com plus a few extra bits. If you don&#8217;t currently [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Whenever I start a new project, I seem to be repeating myself when it comes to adding, and styling basic content: Headers, Lists and Tables etc.</p>
<p>So I decided to create a &#8216;Kitchen Sink&#8217; of markup and basic styling, using some content from the great <a href="http://html-ipsum.com/">HTML-Ipsum.com</a> plus a few extra bits.</p>
<p><span id="more-207"></span></p>
<p>If you don&#8217;t currently use something like this already, I do urge to add it to your next new website, because even if you don&#8217;t include a table, or list at the moment, you (or your client via WYSIWYG) may do in the future.</p>
<p>The document is actually HTML5 and UTF-8, but you can copy and paste the HTML/CSS however you like. I also tend to add a reset style inside a global stylesheet to save downloading two documents. I&#8217;d love hear how you layout or comment your CSS and whether you split them into different files such as layout and typography too.</p>
<h2>Open <a href="https://paulrandall.com/downloads/kitchensink.htm">kitchensink.htm</a></h2>
<p><em>Note: If you have any additional code or CSS which you think should go into the document, add a comment below. Thanks.</em></p>
]]></content:encoded>
			<wfw:commentRss>https://paulrandall.com/2009/10/16/the-kitchen-sink-of-html/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>
