<?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>Woody Hayday &#124; Blog</title>
	<atom:link href="http://blog.woodylabs.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.woodylabs.com</link>
	<description>An exploration of life, technology and writing</description>
	<lastBuildDate>Wed, 25 Jan 2012 07:08:55 +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>1and1 Web Hosting &amp; Git &#8211; Installing it for singular dev</title>
		<link>http://blog.woodylabs.com/2012/01/1and1-web-hosting-git-installing-it-for-singular-dev/</link>
		<comments>http://blog.woodylabs.com/2012/01/1and1-web-hosting-git-installing-it-for-singular-dev/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 15:43:30 +0000</pubDate>
		<dc:creator>Woody</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Technology]]></category>
		<category><![CDATA[1and1]]></category>
		<category><![CDATA[ghetto first version]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://blog.woodylabs.com/?p=833</guid>
		<description><![CDATA[I have a new project in the works and I thought it about time to get a verioning setup working beyond locally, I don&#8217;t want to use a PaaS (like Cloud control) though for this one as its Top Secret (for now.) Yeah Yeah I know, shared web hosting, 1and1 &#8211; not so secret eh? [...]<hr /><a href="http://blog.woodylabs.com">Visit Woody Haydays Blog</a><hr />]]></description>
			<content:encoded><![CDATA[<p>I have a new project in the works and I thought it about time to get a verioning setup working beyond locally, I don&#8217;t want to use a PaaS (like Cloud control) though for this one as its Top Secret (for now.) Yeah Yeah I  know, shared web hosting, 1and1 &#8211; not so secret eh? Well behind a .htaccess passworded directory is better than sitting on AWS via a PaaS, it is, believe me.</p>
<p>The benefit of using GIT in the way below is that it maintains version history AS WELL as offering a managed host, i.e. it deals with uploading as well as versioning (in 1 git bash push.)</p>
<p>So here&#8217;s the scenario &#8211; there&#8217;s one of you, or maybe a few core founders/dev&#8217;s and you want to use GIT to version control your developments of a new web app or site. You already have a shared hosting account with 1and1 which works fine up to 20k hits a day or so, is there really need to have the thing scalable on demand from day one? No? Great, read on. If you REQUIRE scalability off the bat (I bet you don&#8217;t, really) then go find a PaaS/jump on AWS, for now here&#8217;s how to get GIT versioning (with automatic publication) working on your 1and1 shared hosting.</p>
<p>Firstly go read <a href="http://toroid.org/ams/git-website-howto" target="_blank" rel="nofollow">this</a>, its a great guide that pretty much* got me there (95% of the credit to Abhijit), there&#8217;s just a few changes to get it to work on 1and1. </p>
<h4>How I did it: GIT on 1and1</h4>
<p>Load up your FTP, get to the root of your hosting and make your main site dir, in this case we will call it AppDev1:<br />
<code>/AppDev1</code><br />
Next make two directories underneath it: &#8220;repo&#8221; and &#8220;live&#8221;, I shall explain these after you have made them:<br />
<code>/AppDev1/live<br />
/AppDev1/repo</code><br />
What these two are going to do is give you a live &#8220;root&#8221; for your web app/site as well as a GIT repository (which stores all the changes.) By separating them you keep everything simple. [live = web root folder, repo (or whatever you call it) = git bare repository.]</p>
<p>Next locally (on your machine) create a folder which you want to develop in:<br />
<code>C:/EpicNewApp</code></p>
<p>&#8230;And load up GIT BASH (assume you have) and enter the following:<br />
<code>cd "C:/EpicNewApp";<br />
git init;</code></p>
<p>Next go ahead and load your SSH client (putty) and log into your 1and1 Account (there is guidance on 1and1 under SSH accounts, if you need it.) Once logged in enter the following:</p>
<p><code>cd "/AppDev1/repo"<br />
git init --bare<br />
cat > hooks/post-receive<br />
#!/bin/sh<br />
GIT_WORK_TREE="../live" git checkout -f<br />
chmod +x hooks/post-receive</code></p>
<p><strong>*note</strong>: This differs from the aforementioned guide in the address entered under GIT_WORK_TREE, this is the only way I could get this setup to work on 1and1.</p>
<p>You can also simply stick these lines into a file called post-receive and upload the file to the &#8220;hooks&#8221; folder of your new bare repository (repo), if you are so inclined. </p>
<p>That&#8217;s it, your done with the SSH, now you can bind a remote location in GIT BASH (replace the obvious:)<br />
<code>$ git remote add web "ssh://u99999999@yourMain1and1Domain.com/~/AppDev1/repo/"</code><br />
&#8230;And go ahead and push to 1and1 (you will need your SSH password to do so.)<br />
<code>$ git push web +master:refs/heads/master</code><br />
All being well this should have pushed a version to your /AppDev1/repo folder and also updated the live files as per your changes!</p>
<p>Happy Ghetto Versioning!</p>
<p><strong>Note</strong>: As per comments, removed .git reference from link, thanks Ano.</p>
<div class="shr-publisher-833"></div>]]></content:encoded>
			<wfw:commentRss>http://blog.woodylabs.com/2012/01/1and1-web-hosting-git-installing-it-for-singular-dev/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Recent Projects, Top Freelancer People Per Hour</title>
		<link>http://blog.woodylabs.com/2011/12/recent-projects-top-freelancer-on-people-per-hour/</link>
		<comments>http://blog.woodylabs.com/2011/12/recent-projects-top-freelancer-on-people-per-hour/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 09:45:57 +0000</pubDate>
		<dc:creator>Woody</dc:creator>
				<category><![CDATA[Looking Back]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Technology]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[freelance]]></category>
		<category><![CDATA[freelancing]]></category>
		<category><![CDATA[people per hour]]></category>

		<guid isPermaLink="false">http://blog.woodylabs.com/?p=826</guid>
		<description><![CDATA[It was a busy November, but it paid off &#8211; completed a good few projects for some great clients, and whats more I won no# 1 Top Freelancer @ people per hour! You can read more about some of my recent projects here, although there&#8217;s only a few case studies up, the most public of [...]<hr /><a href="http://blog.woodylabs.com">Visit Woody Haydays Blog</a><hr />]]></description>
			<content:encoded><![CDATA[<div align="center"><a href="http://www.peopleperhour.com/toprankedfreelancers.php?month=1320105600" target="_blank"><img class="aligncenter" title="I am Top 1 of 169,000 freelancers for November!" src="http://www.woodyhayday.com/pph/pph-TopFreelancer.png" alt="I am Top 1 of 169,000 freelancers for November!" width="150" height="110" border="0" /></a></div>
<p>It was a busy November, but it paid off &#8211; completed a good few projects for some great clients, and whats more I won no# 1 Top Freelancer @ people per hour!</p>
<p>You can read more about some of my recent projects <a href="http://www.woodyhayday.com/pph/">here</a>, although there&#8217;s only a few case studies up, the most public of the projects was a great life planning app that I built to first iteration, you can check it out (DO IT NOW!) @ <a href="http://www.5years.me" target="_blank">5years.me</a> &#8211; built in the cloud on PaaS, behind the scenes I have also helped develop a social media analytics platform that is a marketeers wet dream, maybe as it gets properly released I will divulge more on that. Needless to say November was a great month of good work for great clients &#8211; off the radar now until my big project in early 2012 <img src='http://blog.woodylabs.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<div align="center"><a href="http://www.woodyhayday.com/pph/php-mysql-jquery-web-application-built-cloudcontrol.png" target="_blank"><img src="http://www.woodyhayday.com/pph/life-planning-web-app-built-in-the-cloud-php-jquery-mysql-schema.png" width="640" height="320" alt="Life Planning Web App Built in the cloud (cloudcontrolled.com)" border="0" /></a></div>
<div class="shr-publisher-826"></div>]]></content:encoded>
			<wfw:commentRss>http://blog.woodylabs.com/2011/12/recent-projects-top-freelancer-on-people-per-hour/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IP to Location Alternative: Javascript &#8211; Using JS to find Browser Country / Location not from IP</title>
		<link>http://blog.woodylabs.com/2011/12/ip-to-location-alternative-javascript-using-js-to-find-browser-country-location-not-from-ip/</link>
		<comments>http://blog.woodylabs.com/2011/12/ip-to-location-alternative-javascript-using-js-to-find-browser-country-location-not-from-ip/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 09:04:41 +0000</pubDate>
		<dc:creator>Woody</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[explorations]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[location]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[timezones]]></category>

		<guid isPermaLink="false">http://blog.woodylabs.com/?p=821</guid>
		<description><![CDATA[Know your audience? Got google analytics aggregating their details? Great, good for you! But doe&#8217;s that add any value in the short term? Improve THEIR browsing experience? In the long run you should use analytics to achieve better sites (although many don&#8217;t) &#8211; but for now, right here you can still add some of the [...]<hr /><a href="http://blog.woodylabs.com">Visit Woody Haydays Blog</a><hr />]]></description>
			<content:encoded><![CDATA[<p>Know your audience? Got google analytics aggregating their details? Great, good for you! But doe&#8217;s that add any value in the short term? Improve THEIR browsing experience? In the long run you should use analytics to achieve better sites (although many don&#8217;t) &#8211; but for now, right here you can still add some of the future frill. Take this situation: You want to show different content/additional content to each nationalities (maybe aim for a few &#8211; US, UK, AUS) &#8211; Did you know that adding a national flag that a user can associate with may increase sales up to 20%, or More? Go read Ca$hvertising. In any case if your sitting comfortably, take a look below for the how to!</p>
<div align="center"><img src="http://farm1.staticflickr.com/122/303184034_9ac842c4e1.jpg" width="500" height="358" alt="Mars Landers on Map"><br />
Javascript &#8211; Using JS to find Browser Country / Location not from IP <a href="http://www.flickr.com/photos/toasty/303184034/" title="Mars Landers on Map by ToastyKen, on Flickr" rel="nofollow" target="_blank" style="font-size:10px">Photo by ToastyKen</a>
</div>
<p><span id="more-821"></span></p>
<h4>Common solutions to identifying a users locale/localizing/localising a web client:</h4>
<p>Using PHP / ASP.NET take the users IP and feed into an ip to location service (geo ip) to find a country from ip.<br />
<strong>Pro&#8217;s:</strong> Server-side off the bat, can cache a database of IP&#8217;s (although would you?)<br />
<strong>Con&#8217;s:</strong> Adds another 2 hops to at least initial page load, IP location service&#8217;s can cost or be faulty</p>
<p>Using the request headers (again server-side) to identify an &#8220;accepted language&#8221; and then guestimating their location (taking en-US&#8230;for example.)<br />
<strong>Pro&#8217;s:</strong> Server-side to start with, no extra hops/calls required, this data is already available whether you use it or not, more useful for language (although limited)<br />
<strong>Con&#8217;s:</strong> Unreliable &#8211; mostly because of a few of the BIG browsers default to en-US for all english users, often international users might learn to use a browser in English anyway &#8211; defeating the point</p>
<h4>Another solution (work in progress:)</h4>
<p>A step towards a proper solution, and in my case a solution for MY original problem, is to at least work out their TIMEZONE. What? I hear you say, why the timezone? Well if you know, for example using analytics data, that your user base is 40% US, 50% UK and 10% rest of the world you can at least make a START by dealing with the two major constituents of your audience. I can envisage A more complete solution though, by combining the use of request headers accepted language AND the following Javascript timezone detection:</p>
<p>Searching around a bit I found <a href="http://unmissabletokyo.com/country-detector.html" target="_blank" rel="nofollow">this</a> which showed a lot of promise. This javascript works out the users Operating System time offset, and from that you can define which timezone they are in. Useful, if like me you know your users in a specific timezone are likely to be in one country, not particularly if they are possibly in multiple countries within a timezone. </p>
<h4>A solution / exploration &#8211; location detection in javascript</h4>
<p>The following Javascript gives you both indicators, using navigator.language/systemlanguage it detects the browser&#8217;s language, and then using an expanded upon version of the above script it will provide you with the possible countries from the users OS timezone offset. How useful this is to you is depending on the application, but check it out &#8211; build some fantastic solution off of it, then show me, because I probably won&#8217;t get round to it!</p>
<pre class="brush: jscript; title: ; notranslate">
var langCode = navigator.language || navigator.systemLanguage;
var lang = langCode.toLowerCase(); lang = lang.substr(0,2);

var dateObject = new Date(); //this timezone offset calc taken from http://unmissabletokyo.com/country-detector.html
var timeOffset = - dateObject.getTimezoneOffset() / 60;
var c = &quot;&quot;; //this will ultimately end up as a country/csv of possible countries
switch (timeOffset) { //I expanded upon this switch, adding all the possible countries
	case 0:
	 c = 'Algeria, Ascension Island, Burkina Faso, Faeroe Islands, Ghana, Guinea Republic, Iceland, Ireland, Ivory Coast, Liberia, Mali, Morocco, Sao Tome &amp; Principe, Senegal, Sierra Leone, St Helena, The Gambia, Togo, United Kingdom'; break;

	case 1:
	 c = 'Albania, Andorra, Angola, Australia, Austria, Belgium, Benin, Bosnia, Cameroon, Central Africa Republic, Chad, Congo, Croatia, Czech Republic, Democratic Republic of Congo (Zaire), Denmark, Equatorial Guinea, France, Gabon, Germany, Gibraltar, Guam, Hungary, Italy, Liechtenstein, Luxembourg, Macedonia (Fyrom), Malta, Mariana Islands, Marshall Islands, Micronesia, Monaco, Netherlands, Niger, Nigeria, Norway, Papua New Guinea, Poland, Portugal, San Marino, Serbia, Slovak Republic, Slovenia, Spain, Sweden, Switzerland, Tunisia'; break;

	case -1:
	 c = 'Cape Verde Islands, Cook Islands, French Polynesia, Guinea Bissau, USA'; break;

	case 11:
	 c = 'New Caledonia, Solomon Islands, Vanuatu'; break;

	case -11:
	 c = 'Niue Island, Samoa (American), Samoa (Western), USA'; break;

	case 11.5:
	 c = 'Norfolk Island'; break;

	case 12:
	 c = 'Fiji Islands, Kiribati, Nauru, New Zealand, Tuvalu, Wallis &amp; Futuna Islands'; break;

	case 13:
	 c = 'Tonga'; break;

	case 2:
	 c = 'Botswana, Bulgaria, Burundi, Cyprus, Democratic Republic of Congo (Zaire), Egypt, Finland, Greece, Israel, Jordan, Lebanon, Lesotho, Libya, Lithuania, Malawi, Mozambique, Namibia, Palestine, Romania, Rwanda, South Africa, Sudan, Swaziland, Syria, Turkey, Zambia, Zimbabwe'; break;

	case 3:
	 c = 'Bahrain, Belarus, Comoros Island, Djibouti, Eritrea, Estonia, Ethiopia, Iraq, Kenya, Kuwait, latvia, Madagascar, Mayotte Islands, Moldova, Qatar, Russia, Saudi Arabia, Somalia, Tanzania, Uganda, Ukraine, Yemen Arab Republic'; break;

	case -3:
	 c = 'Argentina, Brazil, Cuba, Greenland, Guyana, Uruguay'; break;

	case 3.5:
	 c = 'Iran'; break;

	case -3.5:
	 c = 'Surinam'; break;

	case 4:
	 c = 'Armenia, Azerbaijan, Georgia, Mauritius, Oman, Reunion Island, Seychelles, United Arab Emirates'; break;

	case -4:
	 c = 'Anguilla, Antigua and Barbuda, Aruba, Barbados, Bermuda, Bolivia, Brazil, Canada, Chile, Dominica Islands, Dominican Republic, Falkland Islands, French Guiana , Grenada, Guadeloupe, Martinique, Montserrat, Netherlands Antilles, Paraguay, Puerto Rico, St Kitts &amp; Nevia, St Lucia, Trinidad &amp; Tobago, Venezuela'; break;

	case 5:
	 c = 'Diego Garcia, Maldives Republic, Pakistan, Turkmenistan'; break;

	case -5:
	 c = 'Bahamas, Brazil, Canada, Cayman Islands, Columbia, Ecuador, Haiti, Jamaica, Panama, Peru, Turks &amp; Caicos Islands, USA'; break;

	case 5.5:
	 c = 'Bhutan,India,Nepal,Sri Lanka'; break;

	case 6:
	 c = 'Bangladesh, Kazakhstan, Kyrgyzstan, Tajikistan, Uzbekistan'; break;

	case -6:
	 c = 'Belize, Canada, Costa Rica, El Salvador, Guatemala, Honduras, Mexico, Nicaragua, USA'; break;

	case 6.5:
	 c = 'Myanmar (Burma)'; break;

	case 7:
	 c = 'Australia, Cambodia, Indonesia, Laos, Thailand, Vietnam'; break;

	case -7:
	 c = 'Canada, Mexico, USA'; break;

	case 8:
	 c = 'Australia, Brunei, China, Hong Kong, Indonesia, Macau, Malaysia, Mongolia, Philippines, Singapore, Taiwan'; break;

	case -8:
	 c = 'Canada, Mexico, USA'; break;

	case 9:
	 c = 'Australia, Indonesia, Japan, Korea, North, Korea, South, Palau'; break;

	case -9:
	 c = 'USA'; break;
}

//at this point Lang should be a 2 letter language code (e.g. en), timeOffset will be the users hour offset from GMT and c will be the csv of possible countries!
alert('Lang: ' + lang + &quot;\r\n&quot; + 'timeOffset: ' + timeOffset + &quot;\r\n&quot; + 'Possible Countries: ' + &quot;\r\n&quot; + c);
</pre>
<p>You can get the full source for this zipped <a href="http://blog.woodylabs.com/downloads/javascript.timezone.country-detection.zip">here</a>, included is a minified version wrapped in a function, isn&#8217;t that nice of me? Use it as you will, and if you create something epic, show me!</p>
<p><strong>Countries/timezones:</strong> I built the timezone offset switch based on the wikipedia list of countries and their timezones, so its comprehensive.</p>
<div class="shr-publisher-821"></div>]]></content:encoded>
			<wfw:commentRss>http://blog.woodylabs.com/2011/12/ip-to-location-alternative-javascript-using-js-to-find-browser-country-location-not-from-ip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Did you know: Facebook short url&#8217;s already kinda exist</title>
		<link>http://blog.woodylabs.com/2011/11/did-you-know-facebook-short-urls-already-exist/</link>
		<comments>http://blog.woodylabs.com/2011/11/did-you-know-facebook-short-urls-already-exist/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 09:46:03 +0000</pubDate>
		<dc:creator>Woody</dc:creator>
				<category><![CDATA[Facebook Pages]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Technology]]></category>
		<category><![CDATA[dataspace savings]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[facebook shorturl]]></category>
		<category><![CDATA[random occurance]]></category>
		<category><![CDATA[shorturl]]></category>

		<guid isPermaLink="false">http://blog.woodylabs.com/?p=800</guid>
		<description><![CDATA[As a side note: facebook shorturls, or at least abreviated urls exist. We all know about fb.me, but fb.com works too&#8230;. Random occurance: Was saving down facebook data into a database from the graph api, wanted to save the urls in a mixed url table but didn&#8217;t want to bother saving the whole http://www.facebook.com every [...]<hr /><a href="http://blog.woodylabs.com">Visit Woody Haydays Blog</a><hr />]]></description>
			<content:encoded><![CDATA[<p>As a side note: facebook shorturls, or at least abreviated urls exist. We all know about fb.me, but fb.com works too&#8230;. Random occurance:</p>
<p>Was saving down facebook data into a database from the graph api, wanted to save the urls in a mixed url table but didn&#8217;t want to bother saving the whole http://www.facebook.com every time, what a waste of data. Initially I lazily abbreviated this too: fb.com/whateverthepagewas, left the acquisition stuff to its job and then went off to do something else. Coming back to the management system I accidentally clicked one of these fb.com/ links, and it worked! Facebook have set it up as a redirect. Maybe this was common knowledge but I hadn&#8217;t heard of it before&#8230;Anyhow a useful biproduct of dataspace savings!</p>
<h1 align="center">So check it out: <a href="http://fb.com/hayday">fb.com/hayday</a></h1>
<p>That will redirect you too http://www.facebook.com/hayday (my page.) &#8211; just like fb.me, but traditional-like, lol. Neat eh? Anyone else know any facebook quick wins?</p>
<div class="shr-publisher-800"></div>]]></content:encoded>
			<wfw:commentRss>http://blog.woodylabs.com/2011/11/did-you-know-facebook-short-urls-already-exist/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Abstract Autumn: Animal Structures</title>
		<link>http://blog.woodylabs.com/2011/11/abstract-autumn-animal-structures/</link>
		<comments>http://blog.woodylabs.com/2011/11/abstract-autumn-animal-structures/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 09:44:23 +0000</pubDate>
		<dc:creator>Woody</dc:creator>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[abstract]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Belgium]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[Gent]]></category>
		<category><![CDATA[Photos]]></category>

		<guid isPermaLink="false">http://blog.woodylabs.com/?p=804</guid>
		<description><![CDATA[See the rest of Abstract Autumn, Addictive @my photostream<hr /><a href="http://blog.woodylabs.com">Visit Woody Haydays Blog</a><hr />]]></description>
			<content:encoded><![CDATA[<div align="center">
<a href="http://www.flickr.com/photos/woodyhayday/sets/72157628095889582/with/6331549982/" title="fire rowers by WoodyHayday, on Flickr" target="_blank"><img src="http://farm7.static.flickr.com/6093/6331539674_8c85e553ed_z.jpg" width="640" height="427" alt="fire rowers"></a></p>
<p><a title="On their way by WoodyHayday, on Flickr" href="http://www.flickr.com/photos/woodyhayday/sets/72157628095889582/with/6331549982/" target="_blank"><img src="http://farm7.static.flickr.com/6051/6331548594_9e3c792fcf_z.jpg" alt="On their way" width="640" height="427" /></a></p>
<p><a href="http://www.flickr.com/photos/woodyhayday/sets/72157628095889582/with/6331549982/" title="Velc by WoodyHayday, on Flickr" target="_blank"><img src="http://farm7.static.flickr.com/6106/6331547780_4a92b7322b_z.jpg" width="640" height="427" alt="Velc"></a></p>
<p><a href="http://www.flickr.com/photos/woodyhayday/sets/72157628095889582/with/6331549982/" title="Myst by WoodyHayday, on Flickr" target="_blank"><img src="http://farm7.static.flickr.com/6048/6330792777_8cb143276e_z.jpg" width="640" height="427" alt="Myst"></a></p>
<p><a href="http://www.flickr.com/photos/woodyhayday/sets/72157628095889582/with/6331549982/" title="dry water by WoodyHayday, on Flickr" target="_blank"><img src="http://farm7.static.flickr.com/6031/6331542722_72e8424232_z.jpg" width="640" height="427" alt="dry water"></a></p>
<h2 align="center">See the rest of Abstract Autumn, Addictive @<br/><a href="http://www.flickr.com/photos/woodyhayday/" target="_blank">my photostream</a></h2>
</div>
<div class="shr-publisher-804"></div>]]></content:encoded>
			<wfw:commentRss>http://blog.woodylabs.com/2011/11/abstract-autumn-animal-structures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL datetime examples &#8211; first/last day of the year &#8211; dates and unix-times</title>
		<link>http://blog.woodylabs.com/2011/11/mysql-datetime-examples-firstlast-day-of-the-year-dates-and-unix-times/</link>
		<comments>http://blog.woodylabs.com/2011/11/mysql-datetime-examples-firstlast-day-of-the-year-dates-and-unix-times/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 09:09:22 +0000</pubDate>
		<dc:creator>Woody</dc:creator>
				<category><![CDATA[Snippets]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Transactional SQL]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Technology]]></category>
		<category><![CDATA[data schemas]]></category>
		<category><![CDATA[facebook data acquisition]]></category>
		<category><![CDATA[facebook graph api]]></category>
		<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL Workbench]]></category>
		<category><![CDATA[Query]]></category>
		<category><![CDATA[Timestamps]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://blog.woodylabs.com/?p=797</guid>
		<description><![CDATA[For some reason I had an abstract memory of SQL SERVER 2000, timestamps and pain. Who knows why. Perhaps its a faulty memory. lol. Anyhow working with timestamps in MySQL/MSSQL these days is nothing short of simple. With MySQL Workbench free its ridiculous how far the barrier of entry for database design has come, its [...]<hr /><a href="http://blog.woodylabs.com">Visit Woody Haydays Blog</a><hr />]]></description>
			<content:encoded><![CDATA[<p>For some reason I had an abstract memory of SQL SERVER 2000, timestamps and pain. Who knows why. Perhaps its a faulty memory. lol. Anyhow working with timestamps in MySQL/MSSQL these days is nothing short of simple. With MySQL Workbench free its ridiculous how far the barrier of entry for database design has come, its now all pleasant schema&#8217;s and error messages that make sense, gone are the days of spending half the time fixing/navigating the database system, they just work now (99% of the time) what a lucky generation of programmers! Anyhow here&#8217;s some datetime examples that you might find useful:</p>
<p>Get last day of last year &#8211; obvious, but still (+1 this for first day):</p>
<pre class="brush: sql; title: ; notranslate">SELECT DATE(CURDATE()- INTERVAL DAYOFYEAR(CURDATE()) DAY);</pre>
<p>And how useful&#8230; FROM_UNIXTIME takes a unix timestamp and makes it a friendly datetime, its like they KNOW I am coding for facebook data acquisition&#8230;Anyhow&#8230;</p>
<p>To make a GMT UNIX time-stamp for the first day of this month:</p>
<pre class="brush: sql; title: ; notranslate">SELECT UNIX_TIMESTAMP(CONVERT_TZ(DATE(CURDATE()- INTERVAL DAYOFMONTH(CURDATE()) DAY), '+0:00', 'SYSTEM'));</pre>
<p>You can switch out the dates obviously, and there are probably other ways, still, mostly pain free.  </p>
<div class="shr-publisher-797"></div>]]></content:encoded>
			<wfw:commentRss>http://blog.woodylabs.com/2011/11/mysql-datetime-examples-firstlast-day-of-the-year-dates-and-unix-times/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix/Hack to make AutoSuggest JQuery Plugin work</title>
		<link>http://blog.woodylabs.com/2011/11/fixhack-to-make-autosuggest-jquery-plugin-work/</link>
		<comments>http://blog.woodylabs.com/2011/11/fixhack-to-make-autosuggest-jquery-plugin-work/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 13:41:12 +0000</pubDate>
		<dc:creator>Woody</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Technology]]></category>
		<category><![CDATA[autosuggest]]></category>
		<category><![CDATA[client-side]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://blog.woodylabs.com/?p=817</guid>
		<description><![CDATA[When I came across Drew Wilson&#8217;s flashy JQuery Autosuggest plugin I happily downloaded the code and started using it within a recent project, but as I used it more and more I kept hitting a bug &#8211; don&#8217;t know if its just the version of JQuery I was tied to using or whether everyone using [...]<hr /><a href="http://blog.woodylabs.com">Visit Woody Haydays Blog</a><hr />]]></description>
			<content:encoded><![CDATA[<p>When I came across <a href="http://code.drewwilson.com/entry/autosuggest-jquery-plugin" target="_blank">Drew Wilson&#8217;s flashy JQuery Autosuggest plugin</a> I happily downloaded the code and started using it within a recent project, but as I used it more and more I kept hitting a bug &#8211; don&#8217;t know if its just the version of JQuery I was tied to using or whether everyone using the pretty plugin suffers it. Either way there was peculiar happenings when removing elements, they would remove 75% of the time, but the other 25% they would remove only to not maintain the associated CSV list of objects properly. </p>
<p>Irritating when the thing looks so pretty out of the box. So rather than opt for one of the non-pretty options I just hacked it. Brutally I just added code to maintain an input as a csv, it needs fixing really but this does work, for now.</p>
<p><a href="http://blog.woodylabs.com/downloads/jquery.autoSuggest.fixed.csv.rar" target="_blank">Click here to download my hack/fixed version</a> which maintains a separate csv (in a designated ID &#8211; search replace &#8220;csvHolder&#8221; if you want to change its ID.)</p>
<p>Hopefully Drew can update his plugin so it works out of the box, its a really useful plugin. </p>
<p><strong>Note:</strong> This rar includes <a href="http://blog.woodylabs.com/2011/11/maintain-a-csv-with-javascript-keep-a-hidden-list/">my csv quick maintaining functions</a> which are required.</p>
<div class="shr-publisher-817"></div>]]></content:encoded>
			<wfw:commentRss>http://blog.woodylabs.com/2011/11/fixhack-to-make-autosuggest-jquery-plugin-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maintain a CSV with Javascript &#8211; keep a hidden list</title>
		<link>http://blog.woodylabs.com/2011/11/maintain-a-csv-with-javascript-keep-a-hidden-list/</link>
		<comments>http://blog.woodylabs.com/2011/11/maintain-a-csv-with-javascript-keep-a-hidden-list/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 13:25:20 +0000</pubDate>
		<dc:creator>Woody</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[client-side]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://blog.woodylabs.com/?p=813</guid>
		<description><![CDATA[The situation: Want to build a comma separated list of int&#8217;s (or whatever) client-side, in javascript, remove/add items on the fly using JS. Well these tiny functions below are what I use, useful when you just need to get a clever form / app input done. Using the below you can add/remove items to an [...]<hr /><a href="http://blog.woodylabs.com">Visit Woody Haydays Blog</a><hr />]]></description>
			<content:encoded><![CDATA[<p>The situation: Want to build a comma separated list of int&#8217;s (or whatever) client-side, in javascript, remove/add items on the fly using JS. Well these tiny functions below are what I use, useful when you just need to get a clever form / app input done.</p>
<p>Using the below you can add/remove items to an input which acts as a csv holder, should be self explanatory, get and set are just shorteners.</p>
<pre class="brush: jscript; title: ; notranslate">function get(a){ //small get
	if (typeof a != &quot;undefined&quot;) {
		return document.getElementById(a).value;
	} else {
		return '';
	}
}

function set(i,v){ //small set
	document.getElementById(i).value = v;
}

function append(i,v){ //small append
	set(i,get(i) + v);
}

function appendTocsv(i,v){ //small append csv
	if (get(i).length == 0){
		set(i,v);
	} else {
		append(i,', ' + v);
	}
}

function incsv(id,v){ //check a csv (in element with id) for a value (v)

	var csv = get(id);
	var csvArray = csv.split(', ');
	var found = false;

	if (csvArray.length &gt; 0){

		for (i = 0; i &lt;= csvArray.length; i++){

			if (csvArray[i] == v){ found = true;  }

		}

	}

	return found;

}

function removeFromcsv(id,v){ //removes a val from csv

	var csv = get(id);
	var csvArray = csv.split(', ');
	var removed = false;
	var endString = &quot;&quot;;

	if (csvArray.length &gt; 0){

		for (i = 0; i &lt;= csvArray.length-1; i++){

			if (csvArray[i] == v){ removed = true;  } else { 

				if (endString.length &gt; 0){ endString += ', '; }
				endString += csvArray[i]; 

			}

		}

	}

	set(id,endString);

	return removed;

}</pre>
<div class="shr-publisher-813"></div>]]></content:encoded>
			<wfw:commentRss>http://blog.woodylabs.com/2011/11/maintain-a-csv-with-javascript-keep-a-hidden-list/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Facebook time in php &#8211; Facebook uses GMT not PDT/PST?</title>
		<link>http://blog.woodylabs.com/2011/10/facebook-time-in-php-facebook-uses-gmt-not-pdtpst/</link>
		<comments>http://blog.woodylabs.com/2011/10/facebook-time-in-php-facebook-uses-gmt-not-pdtpst/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 12:09:11 +0000</pubDate>
		<dc:creator>Woody</dc:creator>
				<category><![CDATA[Facebook Pages]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[facebook apps]]></category>
		<category><![CDATA[facebook pages]]></category>
		<category><![CDATA[facebook time]]></category>
		<category><![CDATA[timezones]]></category>

		<guid isPermaLink="false">http://blog.woodylabs.com/?p=793</guid>
		<description><![CDATA[I don&#8217;t know whether its purely related to my location when I am calling facebooks&#8217; graph API or what, but all the talk about what timestamps facebooks API returns seems to be wrong. Perhaps they&#8217;ve changed something, perhaps they are re-adjusting them just for me. If its the latter I wonder why they are giving me GMT [...]<hr /><a href="http://blog.woodylabs.com">Visit Woody Haydays Blog</a><hr />]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know whether its purely related to my location when I am calling facebooks&#8217; graph API or what, but all the talk about what timestamps facebooks API returns seems to be wrong. Perhaps they&#8217;ve changed something, perhaps they are re-adjusting them just for me. If its the latter I wonder why they are giving me GMT when I am in Belgium? Is it based on the USER?</p>
<div align="center"><img src="http://farm4.static.flickr.com/3308/3324587240_c663bd1c9b_z.jpg?zz=1" width="640" height="425" alt="Antique Clock Face"><br /><a href="http://www.flickr.com/photos/arcticpuppy/3324587240/" title="Antique Clock Face by tibchris, on Flickr" rel="nofollow" target="_blank">Clock Face by tibchris</a><br /><strong>Facebook Time in PHP, who the what where?</strong></div>
<p>If you haven&#8217;t tried pulling anything time-sensitive out of the graph API yet, don&#8217;t, that&#8217;s my advice. There is not a single bit of coherent explanation as to how the API hand&#8217;s out times, when I first researched it I had written on my pad &#8220;Pacific time&#8221;&#8230;great, did my past (possibly beer holding) self not remember that Pacific time is one thing half the year and another the other half? PDT/PST? Obviously not. What&#8217;s more, now when I check (post something on a page, grab it with graph API) &#8211; its giving me GMT+00 times, WHEN I&#8217;M IN GMT+01.</p>
<p>&nbsp;</p>
<p>All I can work out is facebook have either been pleasant enough to convert the time to the users original registration locale (likely, and pleasant) and not noted it down ANYWHERE publicly, or they have chosen to use GMT. Probably the former, either way &#8211; facebook developers &#8211; we need a better solution for working with facebook times.</p>
<div class="shr-publisher-793"></div>]]></content:encoded>
			<wfw:commentRss>http://blog.woodylabs.com/2011/10/facebook-time-in-php-facebook-uses-gmt-not-pdtpst/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unable to drop JQuery sortable onto empty list? Hack solution</title>
		<link>http://blog.woodylabs.com/2011/10/unable-to-drop-jquery-sortable-onto-empty-list-hack-solution/</link>
		<comments>http://blog.woodylabs.com/2011/10/unable-to-drop-jquery-sortable-onto-empty-list-hack-solution/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 11:34:29 +0000</pubDate>
		<dc:creator>Woody</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Sortable]]></category>

		<guid isPermaLink="false">http://blog.woodylabs.com/?p=789</guid>
		<description><![CDATA[The problem: You have a multi column (or area) JQuery UI Sortable (these are neat) which only needs to show a &#8220;drop zone&#8221; when the user has started to drag a sortable object. The JQuery documentation for this doesn&#8217;t account for the reality of the above, its all very well if you want the empty [...]<hr /><a href="http://blog.woodylabs.com">Visit Woody Haydays Blog</a><hr />]]></description>
			<content:encoded><![CDATA[<p>The problem: You have a multi column (or area) JQuery UI Sortable (these are neat) which only needs to show a &#8220;drop zone&#8221; when the user has started to drag a sortable object.</p>
<p>The JQuery documentation for this doesn&#8217;t account for the reality of the above, its all very well if you want the empty column/div to SHOW all the time as empty, that is remain as some sort of visible placeholder, but if the empty list should show as empty, until an object is ready to be dropped on it then JQuery sortable&#8217;s don&#8217;t work. It all comes down to dimensions, if an empty list exists without a height value, you can&#8217;t drop onto it.</p>
<p>More specifically, if an empty jquery-sortable list exists without a specific height set at the point of [.sortable start] (that is BEFORE the event is fired) then you just cannot drop the sortable.</p>
<div align="center" style="font-size:10px;"><img src="http://farm3.static.flickr.com/2326/2378867408_4cc90791d6.jpg" width="500" height="375" alt="the JavaScript Code"><br />
<a href="http://www.flickr.com/photos/dmitry-baranovskiy/2378867408/" title="the JavaScript Code by Dmitry Baranovskiy, on Flickr">Image by Dmitry Baranovskiy</a></div>
<p>I played with fixing this by adjusting each empty list (in the example belows case #col1,#col2,#col3) to have a defined height (and background, which looks nice) within the sortable &#8220;start&#8221; option, but this just creates boxes (or landing pads/zones) you can see, but not drop on. </p>
<p>Long and short of it &#8211; the solution to being able to drop jquery sortable&#8217;s onto invisible empty lists is to bind a function which adds a css class (or sets the height specifically) to the empty (invisible) sortable list when a user clicks one of the goal objects. This is then fired BEFORE the sortable takes hold and so creates drag-droppable landing zones for the users held sortable. It then uses the sortables &#8220;stop&#8221; property to remove the class it has added to any columns which have it. </p>
<pre class="brush: jscript; title: ; notranslate">
function sortAndDrag() {

	//show BEFORE sortable starts
     $(&quot;#col1, #col2, #col3&quot;).bind('click mousedown', function(){
          $(&quot;.col&quot;).each(function (c) {
                if ($(&quot;div&quot;, this).size() == 0) {
                    $(this).addClass(&quot;colZoneEmpty&quot;)
                }
            })
     });

	//enable sortable
    $(&quot;#col1, #col2, #col3&quot;).sortable({
        revert: true,
        connectWith: &quot;.col&quot;,
        stop: function (a, d) {
            $(&quot;.col&quot;).removeClass(&quot;colZoneEmpty&quot;);
	    //any ajax processing
        }
    });

}
//in this example 3 column div's exist with the id's 'col1','col2','col3', all of which have the class 'col'
//colZoneEmpty is a css class which makes the empty list visible
</pre>
<p>There are of course improvements you could make here, like checking the users dragging before setting any styling, but this quick hackaround works where it shouldn&#8217;t.</p>
<div class="shr-publisher-789"></div>]]></content:encoded>
			<wfw:commentRss>http://blog.woodylabs.com/2011/10/unable-to-drop-jquery-sortable-onto-empty-list-hack-solution/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

