Home

jQuery Woopra plugin part 1: Introduction E-mail
Monday, 14 December 2009 16:04

Taking inspiration from Christian Hellsten's jQuery Google Analytics plugin, and using it as a starting point, I have developed a jQuery plugin to implement Woopra analytics in your application (download).  Right now, in version 1.1.5:

It adds the following methods to jQuery:

  • $.trackWoopra(options) - Adds Woopra tracking on the page from which it's called.  This is the only required method to enable Woopra tracking.
  • $.woopraEvent(options) - Tracks an event using the given parameters
  • $('a').trackEvent(options) - Adds event tracking to element(s)

This method is required, and can be used simply as:

<script type="text/javascript">
$.trackWoopra();
</script>

or:

<script type="text/javascript">
$.trackWoopra({
domain : 'http://www.mydomain.com',
url : 'http://www.myurl.com',
title : 'My page',
cookie: 'someCookie'});
</script>

All parameters in example above are optional:

  • domain - use it to specify root domain (to enable tracking of sub-domains)
  • url and title parameters must be passed in together as a pair; use them to give pages custom names in Woopra
  • cookie allows you to exclude visitors who have the cookie set (someCookie in this case)

See here for more information on using these optional parameters.  (The cookie feature is not yet built into Woopra, so you won't see any information on that on the Woopra site.  Once they implement it into the core, I will remove this add-on feature and incorporate their implementation.  You can learn more about how to use my current implementation here.)

Used like:

<script type="text/javascript">
$.woopraEvent({
title : 'category_click',
label : 'Category1',
url : 'url1'
event_name : 'click'});
</script>

This method is best called from the next one, $.trackEvent(options).

Takes the following parameters:

  • title - required.  Name for the event being tracked.
  • event_name - optional.  Name of event you want to bind to.  Default is 'click'.
  • as many (key,value) pairs as you want your event to have

Example usage:

<script type="text/javascript">
$('#content #links a').trackEvent({
title : 'Links_hover',
label : function(element) {return element.text()},
url : function(element) {return element.attr('href')},
event_name : 'mouseover'});
</script>

Similar to the jQuery Google Analytics plugin, you can enter functions as property values, and they will be evaluated for the element that is the target of the event triggered.  However, whereas Google Analytics takes a specified number of parameters in its event tracking object, Woopra lets you specify custom properties and values, so this plugin was modified to accomodate for that.

In this example, everytime a visitor hovers over a link (<a> element) inside #content #links, a 'mouseover' event will be registered in Woopra, with the following properties:

  1. title: Links_hover
  2. label: the text between the <a> and </a> tags
  3. url: the url in the href attribute of the link clicked

Version 1.1.5 - added ability to exclude visits with cookies, similar to Google Analytics.

Version 1.1 - removed setTracker property which is no longer supported by Woopra.  To download older releases, visit the official jQuery plugin page.


View jQuery Woopra plugin part 2: Usage

Download

Download jQuery Woopra plugin




 
Useful websites and tools - 12/13 E-mail
Sunday, 13 December 2009 23:11

Web

  • Stack Overflow - excellent website for getting help on web development-related issues.  I find it's a much better resource than groups and forums.  It's much easier to find information as well as to read it because of the way the site is designed and laid out.  And there's a very active community behind it.
  • Gravatar - you've probably seen the icons that accompany blog posts and comments on several blogs.  Most of those come from Gravatar, a free service from the makers of WordPress that associates a 48x48 pixel image with your e-mail address, so that whenever you comment on a Gravatar-enabled website, your icon will show up with your words.  You can upload several images and choose which one you want to associate with your identity, and then change it on the fly at any time.


 
Useful websites and tools - 12/12 E-mail
Saturday, 12 December 2009 17:19

Web

  • CoralCDN - Yahoo!'s YSlow suggests using a content delivery network (CDN) to speed up your website.  The only popular one that's also free I've found is CoralCDN.  To use it, all you have to do is append nyud.net to the end of your domain when serving up pages!  I read somewhere that you get the most benefit out of it when serving up bigger files like video and audio, as opposed to small JPGs and other background graphics.
  • Font Squirrel font face - (from Web Resources Depot) I took a look at this yesterday after coming across it in the WRD feed, and they have a pretty extensive collection of @font faces to use for free in your work.
  • jQuery Google Analytics plugin - a nicely done Google Analytics plugin for your jQuery applications.  This is the one I use for my work.
  • minify - a very comprehensive PHP library for minifying JavaScript and CSS files on your site (another of YSlow's suggestions).  It's very easy to use, but you're better off working with it from the start as opposed to integrating it into a large site after the fact.


 
Useful websites and tools - 12/11 E-mail
Friday, 11 December 2009 11:10

General

  • FreePDFConvert.com - this site does a good job of converting PDFs to Word format.  You can get the converted document sent to you via e-mail.

Web

  • 11heavens.com - Montreal-based web developer specializing in Drupal; hers seems to be a widely read site, and she has tutorials on ActionScript, JavaScript, Drupal, and more
  • Codebix.com - site that presents a nice aggregation of Web-related articles.  It seems to be more focused on Microsoft technologies - ASP.NET, Silverlight, Visual Studio, etc.
  • 14 Best CSS Editors for Web Designers & Developers - 14 great tools just for CSS.
  • Slickplan.com - web-based sitemap/flowchart generator that allows for the creation of free sitemap and flowchart design (from their website).
  • OpenDNS - Google has entered the DNS space with its own offering, extending its grasp around the web even further.  I switched recently to OpenDNS's free service, mainly to try something other than what Comcast offers.  The best feature is probably the statistics it gives you on sites you visit.

Other

  • Zvents.com - a good way to find out what's happening around your town.  I've used it several times and it generally has a good number of listings.


 
Useful websites and tools - 12/8 E-mail
Tuesday, 08 December 2009 22:18
  • Net2ftp.com - very-well featured browser-based FTP client
  • Smush.it - good tool for optimizing images if you don't want to install software locally.  It can "smush" up to 5 images at a time.
  • Partition Wizard Home Edition - free partition manager that works with Windows 7 64-bit edition


 
Migrating to Windows 7 from Vista or XP E-mail
Tuesday, 08 December 2009 10:12

There are two major challenges to any migration task: not lose any data, and migrate as quickly as possible so you don't lose much working time.

In order to migrate from Windows Vista to Windows 7, my preferred method was the dual-boot way.  It works for going from Windows XP to Windows 7 as well.  The steps I took were:

  1. Create a partition from within Vista for the new Windows 7 installation
  2. Install Windows 7
  3. Install all the software I plan on using
  4. Copy old data files from Vista partition to Windows 7 partition
  5. Use the new partition and test everything
  6. Delete Vista partition and use Windows 7 as primary operating system

Let me go over these in detail.


Step one

The first step is to create a partition for the new operating system, if you don't already have one.  I used the free Partition Wizard Home Edition on both my machines and it worked great.  The reason I chose this program was because it works with Windows 7 64-bit edition, which is what I was installing.  (Screenshots from Partition Wizard website)

Partition Wizard - create partition

One snag I ran into was that there wasn't enough free space for the new partition.  I had enough free space but not all of it was available.  To clear up more space I disabled the System Restore feature in Windows Vista, which takes up a good amount of space.

Instructions for turning off System Restore (from Microsoft's website):
  1. Click Start, right-click My Computer, and then click Properties.
  2. In the System Properties dialog box, click the System Restore tab.
  3. Click to select the Turn off System Restore check box. Or, click to select the Turn off System Restore on all drives check box.
  4. Click OK.
  5. When you receive the following message, click Yes to confirm that you want to turn off System Restore:
    You have chosen to turn off System Restore. If you continue, all existing restore points will be deleted, and you will not be able to track or undo changes to your computer.

    Do you want to turn off System Restore?
    After a few moments, the System Properties dialog box closes.

Once that was done I had enough space for a new partition.

Go ahead and create a new partition in Partition Wizard.  Partition Wizard will restart the computer, create the partition, and restart back into Windows.  You're then ready to install Windows 7.


Step two

Installing Windows 7 is as easy as throwing in the DVD, booting from it, and following instructions.  Specify the new partition you created as the install location, and during the installation Windows 7 automatically sets up the dual-boot for you. It sets Windows 7 as the default operating system, with a 30-second pause before it loads on its own.


Step three

Most of the software you used in Vista should work in Windows 7.  Install whatever you use just as you would in Vista.  If you installed the x64-version of Windows 7 you may want to check for 64-bit versions of the programs you use.


Step four

All your data from your Vista installation is available to you to use in your new Windows 7 installation.  You may have noticed that your C: drive from Vista is now the D: drive in Windows 7.  That's fine, because all the data is accessible just as it was before.  If you want, you can even keep the Vista installation as it is and access the data in Windows 7 from that partition.

But if you want to migrate to Windows 7 altogether, you will want to copy all the files you use to the new partition.  You can probably keep the same file structure as before, copying My Documents to Documents, My Pictures to Pictures, etc.

I would recommend copying instead of moving because you'll be deleting the Vista partition in the end anyway, so you're not permanently losing any space with the temporary duplication.  It just gives you an extra buffer of protection while migrating.


Step five

This is a crucial step.  I held on to the old Vista partition for a couple of weeks to make sure I had copied everything I needed.  Sometimes there are files and settings you forget about that you end up needing at an unexpected time.  Once you've spent enough time with the new operating system and your workflow is the same as (or better than) before, you can safely delete the old partition.


Step six

Install Partition Wizard Home Edition, but now in the new Windows 7 installation.  This time you want to delete the Vista partition and merge the free space into the Windows 7 partition.  Partition Wizard lets you do both in one step.

Partition Wizard - delete partition 

Allow it to delete the partition, let it do its thing and restart.  What you'll notice is that Windows 7 fails to boot!  Not to worry.  Get out your Windows 7 installation DVD, launch from it, and instead of installing this time, choose to repair an installation.  Let the installer restart your system while it repairs the boot record, and soon enough you should be launching right into your working installation of Windows 7.  Your Vista installation will be gone and the disk space from it will be available in the C: drive of your Windows 7 installation.



 
Useful websites and tools - 12/5 E-mail
Friday, 04 December 2009 22:40

In the spirit of Makeuseof.com's list of Cool Websites and Tools they publish daily, I'd like to share a list of resources, as I come across them, that I find useful:

  • Xenu's Link Sleuth - small, fast Windows application to test your (or any) website for broken links

Xenu's Link Sleuth



 
«StartPrev12345678910NextEnd»

Page 9 of 18