javascript funkyness

Posted on August 22nd, 2010 by thiswayup.
Categories: dev.

As I've started to learn more about javascript this year , I've been really enjoy digesting some interesting resources on the internet to learn more about the innards that make this rather great lanaguage. One that I have found is a great google tech talk "JavaScript: The Good Parts" from Doug Crockford and he highlighted a rather quiky thing in javascript.

function good(){
   return true
}
alert( good() );
//alert is true

function bad(){
   return
   true
}
alert( bad() );
//alert is "undefined";

One would think that if you run both function you would get the same return (ie true) but there's one thing I learnt from Doug's talk is that Javascript was built with a interesting quirk, if it runs into a compilation error, it actually backs up and puts in a semi colon in for you! This was originally designed to help people first picking up the language but as a consequence has caused this weird business. So the moral is to always add semi colons.

2 comments.

Upgrading macbook pro 13″ hard drive

Posted on August 7th, 2010 by thiswayup.
Categories: Gadgets.

I thought I'll post up my process to upgrade my Mac book pro 13" hard drive that I bought autumn 2009. I couldnt be bothered to find the exact model

Shopping list

I decided to upgrade my macbook pro hard drive recently as I'm going to use it as my primary method to store my photos. Having only 80gb left on my disc, I decided to buy most of my kit from Ebuyer. My shopping list was :

Step by step guide

Well not much much to it but here we go.

  1. After putting your new hard drive into the external case, I then backed up the whole thing using SuperDuper. The main reason being is that it not only backsup your drive but prepares it also for the switch by making it fully bootable! The benefit being is that it saves you having to install OSx and restore from the Time machine backup :)
     
  2. I then followed this video and you are done!

Other stuff

Don't forget to perform another time machine or SuperDuper backup after!

2 comments.

SEO thoughts of the day

Posted on August 4th, 2010 by thiswayup.
Categories: dev.

Today at work at we had a someone from Spring Digital do a basic introduction to SEO. At my work we have been working a bit in this space and always trying to gain SEO advantages over other sites but I thought it could be good to check out any possible new nuggets. As it stands I learnt some new things and reinforced some interesting points which have been floating around:

  • Twitter links like a "NOFOLLOW" – One of the things which I thought gave a little bit of weight was the fact that links appearing in twitter apparently hold no seo weight. I had obviously drawn an incorrect conclusion given that twitter started appearing on google searches.
     
  • Concept of "link baiting" – To follow on from the above point of twitter linking and focusing back on the idea that back linking is important, advertising yourself with interesting content obviously starts people talking. With a bit of luck, all that chatter of your site will hopefully spawn a few backlinks on other sites. Basic idea of marketing through social media I know but hey it stuck out.
     
  • PPC vs SEO – I find it interesting that SEO and PPC can sometimes both work together and against. But the majority of the time they complement each other. PPC generally is seen as the short term traffic driver with SEO requiring alot more strategic and medium/long term commitment before a good ROI.
     

Finally I have been reading a bit from The Art of SEO. As a developer I wonder about the process of our site builds and whether we are doing the correct "thing", reading this book had definitely given me some more insight. One of the points which sticks out is the advice to not use pagination. There are a few points he makes for it being bad :

  • Provides no topical relevance – since pagination results in a page of just links with no focus on seo this is bad.
  • Content between different pages can create dupe content – Duplicate content is a factor of the amount of SEO juice google gives.
  • Can create spider traps – Spiders generally can only dig so deep and if it catches the spider in a infinite spider trap then there is less chance of the page you want the spider to find, is found.

This pagination point sticks out as it goes to show that there is a site usability opportunity cost of choosing to not to use pagination. The book does concede though that it takes a seriously alot of planning to try build a certain large sites without pagination.

0 comments.

clearoverlays in google maps v3 api

Posted on July 27th, 2010 by thiswayup.
Categories: dev.

Since api v2 has been now officially deprecated, I've been recently relearning some of the stuff to the new v3 api and trying to figure out the differences. One of the annoying things (as of writing) is the lack of clearOverlays().

There's a few ways to do it but the easiest way to do is maintain a separate array of markers then remove them one by one. So the code would look like :

while(markerArrayList[0]){
   markerArrayList.pop().setMap(null);
}

We keep going through the array in the while loop and pop an item until we don't have any more at which point the markerArrayList[0] will return false and stop the loop.


Example code here

I hope this helps some out there! Please feel free to comment!

0 comments.

Interesting modx bookmarks May 2010

Posted on May 31st, 2010 by thiswayup.
Categories: dev.

I don't have much to post about this month so I'll post some interesting Modx links I have.

Introduction to MODx Revolution, Pt. I – http://vimeo.com/8335791?hd=1

modx and kohana – Someone has attempted to bridge between Modx and Kohanahttp://forum.kohanaframework.org/comments.php?DiscussionID=4221
 

Getting back into modx when you have locked yourself out – http://www.lucidgreen.net/webbybooth/?p=27

Wordpress vs modx – I just found this thread recently, old but interesting http://modxcms.com/forums/index.php/topic,15341.0.html

Stats plugin for modx – http://modxcms.com/about/blog/zaigham/slimstat-plugin-for-modx.html

More modx tutorials – http://www.modxrules.com/

0 comments.

example code of how to geo code addresses

Posted on April 25th, 2010 by thiswayup.
Categories: Uncategorized.

I've had this in my book mark for a while and thought was handy. Essentially the code shows how with a database of address how you can usea call to a google service to return a xml file which you then iterate through to extract what you need.

Geocoding Addresses with PHP/MySQL

0 comments.

weekend of coding at secret london

Posted on April 25th, 2010 by thiswayup.
Categories: Development, London gems.

I've had this post sitting in my draft posting for the past couple of months and had completely forgotten about it until recently, so I thought it best to commit some thoughts down for future prosperity..or something.

It was back in February when I noticed a call from secret london for developers to help build a website and so looking for a small project at the time to sink my teeth into, I thought I'll come down. I head to where they had a small cozy office off oxford circus to meet the small gang of 4. After chatting a bit with a slightly shy girl who I thought was called Georgia (for some bizare reason) go through the website concept. This girl turned out to be Tiffany, the creator of the facebook group! At the time with my tired mind I was unawares of this! (sorry Tiffany if you are reading this)

Anyways…walking through the site idea, I had commented how I could possibly offer a few hours of my time a week over the next few months. Obviously Tim (the main dev guy) had thought about scalability and having a fast backend from the start. It was a shame he had decided to do it in Django and some weird data engine called Solr but I was enthusiastic working with people who knew what were doing. The real kicker or as Greg (who I considered the energetic and charismatic "ideas man") came out with the punch line… they were planning to create the whole thing in a weeks time! I was a bit stunned but said I will try get back to them (but still enthusiastic to try help out). I left thinking decisively "These people were slightly mad.", my favorite type of people :)

Moving onto the following weekend with some great planning and scheduling done through gdocs, the "guerrilla style" site build was underway starting on the Friday near Farringdon. Unfortunately I could not attend from the start and joined them on the Saturday. My php skills would be slightly rubbish for this project but decided to help out as best can with the javascript side of things.

I met some fantastic peeps on the day, chatting mainly to Ruth and Andy The setup was was very fun with a large area to accommodate the gang of designers, developers, editors and content people with booze and food around. I found it amazing to see so many people spending their weekend pushing forward something they believed in and credit is due to Demetrios for keeping the atmosphere positive, making sure everyone was happy! The content people had a very arduous task of transferring as much of the information from the facebook website to the site database. There was then the 4-5 developers  nd roughly same amount of designers do the front end work.

It was a bit of a shame on my part as I had a couple of bday do's to attend on that particular weekend, I wanted to hang around a bit longer to polish off my section! After spending a few hours here and there, trying to play around with the google maps local search api, I managed to offer a small contribution in the form of a google map showing the secrets for the first version of the website. I finally left late on the sunday after the design team had did the initial load of the site on a beta domain, at that point it truly struck me how an amazing feat they had achieved with the number on the posters indicating how much data they had loaded and the functionality they managed to squeeze in!

Secret London contributors on the sunday

The experience was definitely a positive one and it made me realise how doing coding for projects like this is really good fun. I should do more of these! I had a chance to learn some new stuff that I wouldn't otherwise expose myself to and got a tasty curry and beer for my troubles! Would I do this again? Definitely.

Further links

0 comments.

ultimate SEO list

Posted on April 13th, 2010 by thiswayup.
Categories: dev.

I thought I'll start creating a SEO checklist for my personal and whoever likes to reference this, at the moment itd quite small but will add more and more over time.

General site structure

  • "keywords" meta tag – google ignores
  • h1 tag – descriptive term
  • description meta tag -
  • friendly url – that describes the page hint: should be close to H1 tag
  • Keep content as high as possible
  • Vary the media
  • Add alt tags to all picture
  • If using flash add spiderable content of what the flash content should have

Making google happy

  • Optimise for speed

More techie stuff

  • Robot.txt
  • Sitemap.xml – generate automatically
  • rel="Nofollow" – add to outbound links which you do not want the search engine to give weight or scrae through
  • When using ajax to update content, make sure we can degrade to non-javascript mode as I do not believe the spiders render the page to figure out what content will appear

Content guide

  • html site guide
  • Privacy policy

Tools

  • Googleweb master
  • http://www.pluginseo.com/
  • majesticseo.com – report on backlinks
  • ubervu.com – tracking how people respond to your website. Helps with building relationships and back linking further?

Other

  • Backlinks – get other sites to create a link to your site

2 comments.

using xdebug on wamp under windows 7

Posted on April 13th, 2010 by thiswayup.
Categories: dev.

I recently had windows 7 installed on my machine at work after it had been running like a dog for the past 6 months after previously having Win Xp. I tried to install WAMP and xdebug but was finding that I kept on having random connection issues and breakpoints was not working, bloody annoying! At first I thought this was because I was running php 5.3 wamp but then tried to put in php 5.2 but pin point it to recent versions of Xdebug not playing very well with WAMP.

I read a couple of posts and just changed dll used to version 2.0.0 and it suddenly worked!

Also for future reference :

zend_extension_ts="C:/wamp/bin/php/php5.2.9-1/ext/php_xdebug-2.0.4-5.2.8.dll"
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000

Got this from the netbeans wiki

0 comments.

Large Hadron Collider stuff

Posted on April 5th, 2010 by thiswayup.
Categories: humour, justgeek.

I've been seeing a few things about the Large hydron collider of recent time and thought I'll drop these two gems of a find links from the nytimes explaining the basics of the Hadron and also the plans to use the london circle line as the Hadron version 2

0 comments.