Monday, December 11, 2017
Home Code

Code

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

Option to Disable Adsense Ads

In some cases it is beneficial to provide a link or option for visitors to a site not to see the adsense ads the first time they visit a page. Ads...

Bing URL Ripper for Dorks

This is a URL ripper which uses bing to search for a dork i.e. "powered by wordpress" and output a list of thousands of wordpress sites. This example was actually setup...

Poor mans GeoIP – Quick and Easy Geolocation

//poor mans geoip $country=trim(file_get_contents("http://api.hostip.info/country.php?ip=".$_SERVER)); //You can then redirect customers to different offers depending on country. I wouldn't recommend this for critical or high volume use. if ($country == 'MyCountry') { yadda yadda yadda; }

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...

A simple floating feedback/support button

It can be very useful for online businesses to collect feedback from their customers. This gives us priceless insight in to their wants, needs and problems. One quick way to start...

Prosper 202 Mods 2012

Prosper202 mods 1) increase session life - stops it logging you out every five minutes when you are trying to work add the following line just before session_start(); in 202-config/connect.php ini_set('session.gc_maxlifetime',99999); 2) bypass adverts on...

What was that Country Code?

Have problems remembering all the different country codes for geolocation scripts etc? Switzerland gets me everytime! Here's a handy list you can use to check before you code. I use Maxmind...

Calculate distance between two geocooridnates

Here is a javascript function to calculate the distance between two latitude and longitude coordinates. function deg2rad(deg) { return deg * (Math.PI/180) } function calcDistance(lat1,lon1,lat2,lon2) {   var R = 6371; // Radius of...

Ruby & Selenium Script to Check Google SERP ranks

Haven't used this in a while but it used to work really well untill google would throw a captcha at you after the first 5000 queries. Might be of use to...

Direct Linking and Retargeting

Here is how to do it, you'll still need a server and a domain. Point all your traffic towards a php file i.e. http://www.mydomain.com/trackandforward.php Then place all your retargeting pixels in to...