This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// How to open an XML file and write out it's contents as a CSV! | |
// Using sample XML file here https://msdn.microsoft.com/en-us/library/ms762271(d=printer,v=vs.85).aspx | |
$filexml='books.xml'; | |
if (file_exists($filexml)) { | |
$xml = simplexml_load_file($filexml); | |
$f = fopen('books.csv', 'w'); | |
foreach($xml->book as $book) { | |
$values = array( | |
'author' => $book->author, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on('click', '.widget-promotion a', function(event) { | |
var title = $(this).text().trim(); | |
var url = $(this).attr('href'); | |
dataLayer.push({ | |
'event': 'promotion_click', | |
'promotion_title': title, | |
'eventCallback': function() { window.location = url }, | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on('click', '.my-class', function(event) { | |
var position = compute_xy_click(event, this); | |
}); | |
function compute_xy_click(event, element) { | |
var position = []; | |
var gardientPos = $(element).offset(); | |
var posx = 0; | |
var posy = 0; | |
if ( !event ) var event = window.event; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).on('click', '.play', function() { | |
var video = jQuery(this).data('video-name') | |
dataLayer.push({'video': video, 'event': 'play_video'}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function write_log ( $log ) { | |
if ( true === WP_DEBUG ) { | |
if ( is_array( $log ) || is_object( $log ) ) { | |
error_log( print_r( $log, true ) ); | |
} else { | |
error_log( $log ); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.button | |
@extend %button-reset | |
padding: rem(10px) rem(15px) | |
color: #ffffff | |
border-radius: 8px | |
@extend .clickable | |
&.is-blue | |
background: linear-gradient(to bottom, $blue 0%, $blue--dark 100%) | |
&:hover |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scrollTo: function ( y ) { | |
FB.Canvas.getPageInfo(function(pageInfo){ | |
$({y: pageInfo.scrollTop}).animate( | |
{y: y}, | |
{duration: 500, step: function(offset){ | |
FB.Canvas.scrollTo(0, offset); | |
} | |
}); | |
}); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var that = this; | |
event.preventDefault(); | |
var callback = function() { | |
$(that).parents('#nl_form').submit(); | |
} | |
_gaq.push(['_set','hitCallback', callback]); | |
_gaq.push(['_trackEvent', 'Newsletter Subscription', 'Started', window.location.pathname]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// build the google plus feed template | |
$.ajax({ | |
url : that.default_settings['api_path'] + 'gplus/', | |
}).done(function( results ) { | |
// compile the facebook feed template | |
feed_template = $(".feed_template").html(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var utility = { | |
app_data: { | |
bitlyAccessToken: 'the-key', | |
bitlyBaseUrl: 'https://api-ssl.bitly.com', | |
vanityUrl: '', |