<commit_before>// application.js

;$(function() {
	// $('.bigger').biggerlink();
	// $('.tabs').tabs();

  // function loadTwitter() {
  //     if($(".twitter-share-button").length > 0){
  //         if (typeof (twttr) != 'undefined') {
  //             twttr.widgets.load();
  //         } else {
  //             $.getScript('http://platform.twitter.com/widgets.js');
  //         }
  //     }
  // }
	
	var init = function() {
		
		// http://stackoverflow.com/questions/7901679/jquery-add-target-blank-for-outgoing-link
		$('a[href^="http://"]').not('a[href*=usefulparadigm]').attr('target','_blank');
		
		// re-render widgets
    // if (ajax) {
    //   if (typeof FB !== 'undefined') FB.XFBML.parse();
    //   loadTwitter();
    // }
        
    // http://www.appelsiini.net/projects/lazyload
    // $("article img").lazyload({
    //     effect : "fadeIn"
    // });

    // animate.css
    // https://github.com/daneden/animate.css
    // $('*[data-animate]').hover(function() {
    //   $(this).toggleClass('animated ' + $(this).data('animate'));
    // });
    
    // Run animate only once in a session
    // if (!$.cookie('animated')) {
    //     $('*[data-animate].animate-once').each(function() {
    //         $(this).addClass('animated ' + $(this).data('animate'))
    //     });
    //     $.cookie('animated', true);
    // }
    
	};

	init();

  // Pjax page transition
  // https://github.com/luruke/barba.js


  Barba.Pjax.getTransition = function() {
    return require('./FadeTransition'); //FadeTransition;
  };

  Barba.Dispatcher.on('initStateChange', function(currentStatus, prevStatus) {
    // console.log(currentStatus, prevStatus);

    if (prevStatus != null) { // check if page is loaded by Ajax
      // Updating Google Analytics tracking
      ga('set', 'page', window.location.pathname);
      ga('send', 'pageview');
      
      // Update canonical meta tag (used for google +1 button)  
      // $('link[rel="canonical"]').attr('href', window.location.href);
    }
  });
  
  Barba.Dispatcher.on('transitionCompleted', function(currentStatus, prevStatus) {
    // console.log(currentStatus);

    if (prevStatus != null) { // check if page is loaded by Ajax

      // Loading social sharing buttons  
      try { gapi.plusone.go(document.getElementById('main')); } catch(e) {}
      try { FB.XFBML.parse(document.getElementById('main')); } catch(e) {}
      try { twttr.widgets.load(document.getElementById("main")); } catch(e) {}
    
      // Loading a Disqus thread dynamically
      // https://css-tricks.com/lazy-loading-disqus-comments/
      $.disqusLoader( '#disqus_thread', { 
        scriptUrl: '//usefulparadigm.disqus.com/embed.js'
      });
    }
  });
  
  Barba.Pjax.start();

  // Change grid color randomly
  // http://colormind.io/api-access/
  // (function() {
  //   var url = "http://colormind.io/api/";<commit_msg>update canonical link<commit_after>// application.js

;$(function() {
	// $('.bigger').biggerlink();
	// $('.tabs').tabs();

  // function loadTwitter() {
  //     if($(".twitter-share-button").length > 0){
  //         if (typeof (twttr) != 'undefined') {
  //             twttr.widgets.load();
  //         } else {
  //             $.getScript('http://platform.twitter.com/widgets.js');
  //         }
  //     }
  // }
	
	var init = function() {
		
		// http://stackoverflow.com/questions/7901679/jquery-add-target-blank-for-outgoing-link
		$('a[href^="http://"]').not('a[href*=usefulparadigm]').attr('target','_blank');
		
		// re-render widgets
    // if (ajax) {
    //   if (typeof FB !== 'undefined') FB.XFBML.parse();
    //   loadTwitter();
    // }
        
    // http://www.appelsiini.net/projects/lazyload
    // $("article img").lazyload({
    //     effect : "fadeIn"
    // });

    // animate.css
    // https://github.com/daneden/animate.css
    // $('*[data-animate]').hover(function() {
    //   $(this).toggleClass('animated ' + $(this).data('animate'));
    // });
    
    // Run animate only once in a session
    // if (!$.cookie('animated')) {
    //     $('*[data-animate].animate-once').each(function() {
    //         $(this).addClass('animated ' + $(this).data('animate'))
    //     });
    //     $.cookie('animated', true);
    // }
    
	};

	init();

  // Pjax page transition
  // https://github.com/luruke/barba.js


  Barba.Pjax.getTransition = function() {
    return require('./FadeTransition'); //FadeTransition;
  };

  Barba.Dispatcher.on('initStateChange', function(currentStatus, prevStatus) {
    // console.log(currentStatus, prevStatus);

    if (prevStatus != null) { // check if page is loaded by Ajax
      // Updating Google Analytics tracking
      ga('set', 'page', window.location.pathname);
      ga('send', 'pageview');
      
      // Update canonical meta tag (used for google +1 button)  
      $('link[rel="canonical"]').attr('href', window.location.href);
    }
  });
  
  Barba.Dispatcher.on('transitionCompleted', function(currentStatus, prevStatus) {
    // console.log(currentStatus);

    if (prevStatus != null) { // check if page is loaded by Ajax

      // Loading social sharing buttons  
      try { gapi.plusone.go(document.getElementById('main')); } catch(e) {}
      try { FB.XFBML.parse(document.getElementById('main')); } catch(e) {}
      try { twttr.widgets.load(document.getElementById("main")); } catch(e) {}
    
      // Loading a Disqus thread dynamically
      // https://css-tricks.com/lazy-loading-disqus-comments/
      $.disqusLoader( '#disqus_thread', { 
        scriptUrl: '//usefulparadigm.disqus.com/embed.js'
      });
    }
  });
  
  Barba.Pjax.start();

  // Change grid color randomly
  // http://colormind.io/api-access/
  // (function() {
  //   var url = "http://colormind.io/api/";
{'fraction_non_alphanumeric': 0.20391884862146697, 'fraction_numerical': 0.0031212068666551067, 'mean_word_length': 2.3073394495412844, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '764926', 'n_tokens_mistral': 1958, 'n_tokens_neox': 1840, 'n_words': 295}