Skip to content

Instantly share code, notes, and snippets.

@timelf123
timelf123 / robots.txt
Created October 8, 2012 04:18 — forked from underdown/robots.txt
default robots.txt
User-agent: ia_archiver
Disallow: /
User-agent: dotbot
Disallow: /
User-agent: MJ12bot
Disallow: /
User-agent: AhrefsBot
Disallow: /
@timelf123
timelf123 / gist:3850699
Created October 8, 2012 04:19 — forked from underdown/gist:2141741
Split test only new visitors
<?php
setcookie("BTDT", "1", strtotime("+30 days"));
if(!$_COOKIE["BTDT"]) {
if($_GET["gclid"]) {
switch(rand(1,3)) {
case 1: header("location: /a/index.php");break;
case 2: header("location: /a/index2.php");break;
case 3: header("location: /a/index3.php");break;
}
}
@timelf123
timelf123 / gist:3850703
Created October 8, 2012 04:20 — forked from underdown/gist:2474608
responsive ads
<script type="text/javascript"><!--
google_ad_client = "ca-pub-3658299045266116";
/* top */
if ($(window).width()<728 ){
google_ad_slot = "4414183254";
google_ad_width = 320;
google_ad_height = 50;
}else{
google_ad_slot = "1020377061";
google_ad_width = 728;
@timelf123
timelf123 / gist:3850706
Created October 8, 2012 04:21 — forked from underdown/gist:3183328
Google Analytics - Adjusted Bounce Rate
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-1']);
_gaq.push(['_trackPageview']);
setTimeout("_gaq.push(['_trackEvent', '15_seconds', 'read'])",15000);
(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';
@timelf123
timelf123 / paypallogo
Created November 3, 2012 01:03
paypal logo
@timelf123
timelf123 / facebook-email-subscribe.php
Created November 16, 2012 21:04 — forked from underdown/facebook-email-subscribe.php
facebook email subscribe
<div style="width:322;background-color:#efefef;border-left:1px solid #ccc;border-right:1 px solid #ccc;border-top:1px solid #ccc;padding-bottom:6px;padding-top:6px;padding-left:6px;text-align:center;font-weight:bold">Subscribe to Our Newsletter</div>
<div id="fb-root"></div>
<script src="https://connect.facebook.net/en_US/all.js#appId=116486985128746&xfbml=1"></script>
<fb:registration
fields="name,email"
redirect-uri="http://web-op.com/fblogin.php"
width="330">
</fb:registration>
// Usage:
// .gradient( "vertical", red, blue ); -> Creates a gradient from top = red to bottom = blue.
// .gradient( "horizonal", red, blue ); -> Creates a gradient from left = red to right = blue.
// .gradient( "vertical", red, blue, true ); -> Creates a gradient with a solid-color fallback. This is
// necessary for IE9 when the container has a border-radius of 2+
// or transparency.
._gradient( @color1, @color2, @startLoc, @endLoc, @from, @to, @ieFallback: false, @ieGradientType: 0 ) when ( @ieFallback ) {
// Internal mixin for generating gradients when there are rounded corners
background: @color1;
var page = new WebPage(),
address, output, size;
//capture and captureSelector functions adapted from CasperJS - https://github.com/n1k0/casperjs
capture = function(targetFile, clipRect) {
var previousClipRect;
var clipRect = {top: 0, left:0, width: 40, height: 40};
if (clipRect) {
if (!isType(clipRect, "object")) {
throw new Error("clipRect must be an Object instance.");
/*
* Asynchronous loading of ads.
* Below is of the top of my head rewrite to load multiple ads at the same time
* in a asynchronous fashion.
*
* I gave it a quick test run and it seems to work as fare as I can see
*
*
* var EpomConfig = EpomConfig || {ads : []};
* (function(){
@timelf123
timelf123 / ga-ratio.js
Last active December 19, 2015 12:28 — forked from andrewrocco/ga-ratio.js
NOTE: This is developed for the "old" GA, not Universal Analytics Send devicePixelRatio info to GA
// NOTE: This is developed for the "old" GA, not Universal Analytics
// Create the test
var pixelRatio = (window.devicePixelRatio >= 1.5) ? "high" : "normal";
// Pass it along through GA
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxxxxxx-x']);
// --- IMPORTANT LINE!