Skip to content

Instantly share code, notes, and snippets.

@Ollo
Ollo / conversion.js
Created May 29, 2012 19:09
conversion tracking via click instead of page view
$('.clickAction').click(function(){
$('<iframe id="converter" height="1" width="1" name="converter" >').attr('src', '<?php bloginfo('template_url'); ?>/tracking.html').appendTo('body');
});
@Ollo
Ollo / wordpress-search-jquery
Created June 11, 2012 21:40
wordpress jquery search field behavior
// search box behavior text behavior
$('.searchField').focus(function(){
$('#searchsubmit,.searchWrapper').addClass('active');
$('.searchField').val('');
});
$('.searchField').blur(function(){
$('#searchsubmit,.searchWrapper').removeClass('active');
if($('.searchField').val() == '')
$('.searchField').val('Search...');
});
@Ollo
Ollo / addOnStateToMenu
Created June 13, 2012 16:50
add class to parent in wordpress if page isn't in menu
function addOnStateToMenu() {
var slugIndex = getSlugIndex();
var menus = new Array('home','about-us','gsa-schedules', 'services', 'careers', 'case-studies','contact-us');
var parent = (window.location.pathname).split('/')[slugIndex];
$('#menuList li').each(function(index){
if ( parent === menus[index])
$(this).addClass('current-menu-parent');
});
@Ollo
Ollo / ie-box-shadows
Created August 16, 2012 16:02
Old IE box shadows
/* For IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')";
/* For IE 5.5 - 7 */
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000');
@Ollo
Ollo / old-ie-gradients
Last active October 8, 2015 18:28
Old IE gradients
/* ie 6+ */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cccccc', endColorstr='#000000');
/* ie8 + */
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#063053', endColorstr='#395873')";
@Ollo
Ollo / tracking.html
Created August 28, 2012 20:43
tracking iframe content
<html>
<body>
<!-- Google Code for Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = xxxxxxxxx;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "_ArfCLPt9QMQrcfZ2AM";
@Ollo
Ollo / .htaccess
Created September 8, 2012 00:56 — forked from boogah/.htaccess
Expire headers .htaccess code.
<IfModule mod_expires.c>
ExpiresActive on
# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault "access plus 1 month"
# Data
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
@Ollo
Ollo / ga.js
Created September 8, 2012 20:42
google analytics tracking code
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
@Ollo
Ollo / info.php
Created September 8, 2012 20:46
phpinfo
<?php
phpinfo();
?>
@Ollo
Ollo / piwik.js
Created September 8, 2012 20:47
piwik tracking code
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://ollomedia.com/piwik/" : "http://ollomedia.com/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}