Tuesday, December 9, 2014

Improve your Analytics skills with Google Analytics Academy

Digital Analytics Fundamentals - Course 1 (Self Study Open, No Community, No Certification)

Google Analytics Platform Principles - Course 2 (Self Study Open, No Community, No Certification)

Ecommerce Analytics - From Data to Decisions - Course 3 (Self Study Open, No Community, No Certification)

Mobile App Analytics Fundamentals - Course 4 (Self Study Open, Community Available, Certification Available)



Courses

  • Mobile App Analytics FundamentalsRegister

    Registration open through December 18
    Community available Community available
    Certificates available Certificates available
    Learn how to make your app more discoverable and profitable by measuring your performance with Google Analytics.
  • Ecommerce Analytics: From Data to Decisions

    Self-study open now
    Community unavailable Community unavailable
    Certificates unavailable Certificates unavailable
    Discover useful reporting and analysis techniques to help your ecommerce business make informed decisions using Google Analytics data.
  • Google Analytics Platform Principles

    Self-study open now
    Community unavailable Community unavailable
    Certificates unavailable Certificates unavailable
    Learn how the components of the Google Analytics Platform work together to collect and organize the business data you need for reporting and analysis.
  • Digital Analytics Fundamentals

    Self-study open now
    Community unavailable Community unavailable
    Certificates unavailable Certificates unavailable
    Learn the core principles of digital analytics, including how to build a useful measurement plan for your business and how to get started with Google Analytics.

Monday, December 8, 2014

Restart, Start, Stop MySQL server from the Command Line Terminal, OSX, Linux

To restart, start or stop MySQL server from the command line, type the following at the shell prompt…

On Linux start/stop/restart from the command line:

Sunday, December 7, 2014

Different ways to call JQuery Document Ready functions

These are the different types of Document Ready functions typically used in jQuery (aka jQuery DOM Ready). A lot of developers seem to use them without really knowing why. So I will try to explain why you might choose one version over another. Think of the document ready function as a self-executing function which fires after the page elements have loaded.
See Where to Declare Your jQuery Functions for more information on how to use the Document Ready Functions.

Document Ready Example 1

1
2
3
$(document).ready(function() {
    //do jQuery stuff when DOM is ready
});

Document Ready Example 2

1
2
3
$(function(){
    //jQuery code here
});
This is equivalent to example 1… they literally mean the same thing.

Document Ready Example 3

1
2
3
jQuery(document).ready(function($) {
    //do jQuery stuff when DOM is ready
});
Adding the jQuery can help prevent conflicts with other JS frameworks.
Why do conflicts happen?
Conflicts typically happen because many JavaScript Libraries/Frameworks use the same shortcut
name which is the dollar symbol $. Then if they have the same named functions the browser gets
confused!
How do we prevent conflicts?
Well, to prevent conflicts i recommend aliasing the jQuery namespace (ie by using example 3 above).
Then when you call $.noConflict() to avoid namespace difficulties (as the $ shortcut is no longer available)
we are forcing it to wrtie jQuery each time it is required.
1
2
3
4
5
6
7
8
9
10
jQuery.noConflict(); // Reverts '$' variable back to other JS libraries
jQuery(document).ready( function(){
         //do jQuery stuff when DOM is ready with no conflicts
   }); 
 
//or the self executing function way
 jQuery.noConflict();
 (function($) {
    // code using $ as alias to jQuery
})(jQuery);

Document Ready Example 4

1
2
3
4
5
6
7
(function($) {
    // code using $ as alias to jQuery
  $(function() {
    // more code using $ as alias to jQuery
  });
})(jQuery);
// other code using $ as an alias to the other library
This way you can embed a function inside a function that both use the $ as a jQuery alias.

Document Ready Example 5

1
2
3
$(window).load(function(){ 
     //initialize after images are loaded 
}); 
Sometimes you want to manipulate pictures and with $(document).ready() you won’t be able to do that
if the visitor doesn’t have the image already loaded. In which case you need to initialize the
jQuery alignment function when the image finishes loading.