Wednesday, August 16, 2017
Home Code

Code

A place for code php, ruby, javascript, jquery, html, css etc.

Regex’s | Regular Expressions in Programming

Today I saw a nice script which redirects mobile traffic by searching the useragent string for a list of search terms related to mobile devices. This is PHP but I'll show...

Redirection Methods and Referer Passing

The following are some methods you can use to redirect users from one place to another. I generally use 301 redirects for anything where I want the referer passed through because...

Wasabi Opensource A/B Testing Platform

Intuit have opensourced a enterprise grade A/B testing platform called Wasabi. This runs as an API on a separate server from your site/landers. It isn't the easiest thing to setup and will...

How to display different banners for web/mobile

Adsense's flex box has made it really simple to put in a piece of code which adapts to the size of available space. I had a situation where I wanted to...

Captcha Cracker For PHPBB written in Ruby

It's been a while since I've done much in SEO so I am going to start publishing some of my old scripts. This is a captcha cracker which uses gocr and...

Alert box on click through to offer

The following example will allow you to create an alert box when the user clicks through from your landing page to the offer page. This can be useful to remind users...

A simple iOS / Android traffic splitter in PHP

The following basic PHP code will split traffic by device with iOS traffic going to the first out link, Android to the second and leftovers to the third. <?php     $ua = strtolower($_SERVER);   ...

Big list of Cordova/Phonegap Plugins

I needed a big list of Cordova plugins to search through: android.support.v4 This is a Cordova plugin that adds the Android Support v4 client library. It is meant to be depended on by...

Passing URL parameters (GET variables) on a PHP redirect

This was something quite simple that shouldn't have taken me as long as it did to figure out. I had traffic going to one url: http://myserver.com/lander.php?source=google&campaign=no1&c1=foobar I wanted to split the traffic to...

Splitting traffic to different offers on mobile

If you are buying bulk traffic to a mobile offer the chances are that you can split some of your traffic off to different offers. For example if  you have a...