{ evil genius level 5 }

Code Snippet: GA Unobtrusive Click Tracking with jQuery

HTML:

<a href="size-chart.pdf" data-track="Size Chart">Size Chart</a>

JavaScript:

$(document).ready(function () {
  $('a[data-track]').on('click', function (e) {
    var label = $(this).attr('data-track');
    //_gaq.push(['_trackEvent', 'Links', 'Click', label]);
    ga('send', 'event', 'Links', 'Click', label);
  });
});

Update Aug 5, 2014: New Google Analytics API.

-R

Particle Designer

I'm currently working on an iPhone app using cocos2d for iPhone and I just ran across Particle Designer, an awesome OSX app by the 71Squared guys.

The app allows you to create particle emitters by adjusting parameters.

Particle Designer

The generated emitters can then be exported into plist files which can be loaded into a cocos2d scene with a couple lines of code:

CCQuadParticleSystem *particles = [CCQuadParticleSystem particleWithFile:@"fireball.plist"];
[self addChild:particles];

-R

Code Snippet: Getting the Bundle Path using Core Foundation

CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef bundleURL = CFBundleCopyBundleURL(mainBundle);
CFStringRef bundlePathString = CFURLCopyFileSystemPath(bundleURL, kCFURLPOSIXPathStyle);
CFRelease(bundleURL);

char bundlePath[PATH_MAX];
CFStringGetCString(bundlePathString, bundlePath, PATH_MAX, kCFStringEncodingASCII);
CFRelease(bundlePathString);

printf(bundlePath);

Ramon Torres - iOS developer/product designer

My name is Ramon Torres. I'm a software developer and product designer, currently working at Inkboard building cool stuff.