This file contains 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
window.fbAsyncInit = function() { | |
// init the FB JS SDK | |
FB.init({ | |
appId : 'YOURAPPID', // App ID from the App Dashboard | |
channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File for x-domain communication | |
status : true, // check the login status upon init? | |
cookie : true, // set sessions cookies to allow your server to access the session? | |
xfbml : true // parse XFBML tags on this page? | |
}); |
This file contains 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
window.twttr = (function (d,s,id) { | |
var t, js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) return; js=d.createElement(s); js.id=id; | |
js.src="//platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs); | |
return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } }); | |
}(document, "script", "twitter-wjs")); | |
twttr.ready(function (twttr) { | |
twttr.events.bind('tweet', function(event) { | |
// Track Twitter |
This file contains 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
/* change data-onsuccess="linkedInShare" to data-onsuccess="yourFunction" */ | |
<script src="//platform.linkedin.com/in.js" type="text/javascript"></script> | |
<script type="IN/Share" data-counter="right" data-onsuccess="linkedInShare"></script> | |
<script> | |
function linkedInShare() { | |
// Track Linked In | |
} | |
</script> |
This file contains 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
// Change googlePlusShare to your function name | |
<div class="g-plusone" data-callback="googlePlusShare"></div> | |
<!-- Place this tag after the last +1 button tag. --> | |
<script type="text/javascript"> | |
window.___gcfg = {lang: 'en-GB'}; | |
(function() { | |
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; |
This file contains 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
function parameterize($string, $sep = '-') { | |
# Get rid of anything thats not a valid letter, number, dash and underscore and | |
# replace with a dash | |
$paramterized_string = preg_replace("/[^a-z0-9\-_]/i", $sep, $string); | |
# Remove connected dahses so we don't end up with -- anyhwere. | |
$paramterized_string = preg_replace("/$sep{2,}/", $sep, $paramterized_string); | |
# Remove any trailing spaces from the string |
This file contains 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 head = document.getElementsByTagName('head')[0]; | |
// Save the original method | |
var insertBefore = head.insertBefore; | |
// Replace it! | |
head.insertBefore = function (newElement, referenceElement) { | |
if (newElement.href && newElement.href.indexOf('https://fonts.googleapis.com/css?family=Roboto') === 0) { | |
return; |