Code
-
Blockchain Developer Roadmap | A Guide To Learning Blockchain Development
This blockchain developer roadmap lays out a framework for learning blockchain development. It should provide a wealth of resources and information for aspiring blockchain developers. Blockchain Developer Roadmap James On YouTube Watch On YouTube: https://youtu.be/h-IcAZX7250 Understanding The Moving Parts There are a number of roles within the blockchain sector and an understanding of what each…
-
Crypto Market Volatility | List Of 100 Altcoin Betas Relative To Bitcoin
In this study we are looking at crypto market volatility and how different altcoins markets move relative to Bitcoin. For example if Bitcoin moves up or down 1% Solana will roughly move double that amount for various reasons discussed below. Crypto Market Volatility List FTX Market Beta Volume BTC-PERP 1.01 $4609m ETH-PERP 1.29 $4471m SOL-PERP…
-
How To Create A TradingView Indicator | Easy Pinescript 5 Tutorial
In this Pinescript tutorial we will build out a simple TradingView indicator using the latest version of Pinescript v5. TradingView Indicator Tutorial This video goes through the Tradingview indicator tutorial with more details and code snippets available in the article below. James On YouTube Watch On YouTube: https://youtu.be/gWw6Hv3CuBU Getting Started With Indicators TradingView indicators are…
-
Intermediate Solidity Tutorial | Building On DeFi Lego Bricks With Hardhat 👷
In this intermediate solidity tutorial I’ll be building, testing and deploying a smart contract to rebalance a digital asset portfolio. The idea is to look at how we can work with external smart contracts to start building our own products on the lego bricks of DeFi. The Challenge To create a solidity smart contract to…
-
Markdown Tutorial | How To Get Started With Markdown 🖋
In this markdown tutorial I’ll be showing you how to get started with writing simple markdown for docs and social media before going on to some more advanced concepts and exploring the things you can do with markdown. Markdown Tutorial This video goes through the basics step by step. There are more details, copy &…
-
Arbitrum Tutorial | How To Use The Ethereum Layer 2 Solution
This Arbitrum Tutorial explores what Arbitrum is and how it works, the opportunities layer 2’s present for investors and developers, before testing the deployment of smart contracts on the Arbitrum network and calculating gas fee reductions. What Is Arbitrum? Arbitrum is a layer 2 scaling solution for the Ethereum network. The L2 has opened it’s…
-
How To Create A New Token And Uniswap Liquidity Pool
In this article I will create a new token and make it available to swap on a decentralised exchange. I’ll be deploying a solidity smart contract to mint an ERC20 token on Ethereum and setting up a liquidity pool on Uniswap v3. Create A New Token & Liquidity Pool [Video] This video provides an overview…
-
Solidity Tutorial | For Developers Coming From Javascript, C++, Python
In this Solidity tutorial I’ll be going through the work flow to develop smart contracts on Ethereum using the Solidity programming language. Solidity Developer Tutorial [Video] James On YouTube Introduction To Solidity Smart Contracts Solidity is the programming language of Ethereum and many other blockchains that use the Ethereum virtual machine. A developer will write…
-
Uniswap V3 Trading Bot 🦄
In this tutorial I’ll be explaining how I built Uniswap v3 trading bot in preparation for arbitrage opportunities. We will be looking at why Uniswap v3 is important and how concentrated liquidity pools provide new features such as range orders. I’ll then show how I built and tested the trading bot prior to Uniswap v3…
-
Twitter Trading Bot | Elon + DOGE = Profit
In this article I’ll share how I built a Twitter trading bot to trade a cryptocurrency called DOGE every time Elon Musk tweeted something mentioning it. I’ll be using NodeJS to query the Twitter API and then executing trades on FTX. Building A Twitter Trading Bot Video James On YouTube The “Elon Effect” Opportunity Anything…
-
Pine Script Tutorial | How To Develop Real Trading Strategies On TradingView
In this pine script tutorial I’ll be showing you how to get started with TradingView scripting for technical analysis and trading strategy development. We will start by looking at how pine script works and a simple example. From there we will move on to inputs and indicators before creating a complete trading strategy using pine…
-
Solana Tutorial | Building Smart Contracts & dApps For The Solana Hackathon
This Solana tutorial goes through a step by step process of setting up a development environment for Solana, writing and deploying smart contracts and my experiences with entering the Solana Hackathon. Getting Started With Solana Solana is a high performance modern blockchain with impressive throughput capabilities. It can handle 50,000 transactions per second which makes…
-
Separating Signal From Noise on WallStreetBets [Niche Website]
This case study looks at how I went about building a one page website around the trending WallStreetBets community. Creating A Niche Website To Filter WallStreetBets [Video] The Problem & A Simple Solution Starting With A Script Lean Methodology For Niche Websites Marketing A Niche Website Niche Website Monetisation & Financials Conclusion Creating A Niche…
-
Website Competitor Analysis | 5 Steps To Research The Competition 🕵️
This article outlines the following five steps to carry out a thorough website competitor analysis. Assessing Competitive Landscape Analyzing Website Traffic Metrics Social Media & Content Analysis Web Technology & Tracking Analysis Personnel & Corporate Structure Research First let’s look at a video example of carrying out competitor research for a Clickbank product. Website Competitor…
-
Google Analytics Event Tracking | GA Events Setup, Tips & Examples
In this article we will explore what you can do with Google Analytics Events, how to set them up, some example code for where they can be used and some tips for getting the most out of gtag events. Google Analytics Events in 90 Seconds What are Google Analytics Events? Breakdown of an Event Setting…
-
Vanilla HTML | No. 1 Free HTML Boilerplate
A boilerplate is a starter template which contains the skeleton framework for a development project. Vanilla HTML is a HTML,CSS,JS boilerplate designed for websites with particular focus on SEO and performance marketing. Vanilla HTML in under 2 minutes How Does Vanilla HTML Work? Setting Up Vanilla HTML Why Vanilla HTML over WordPress or React? Vanilla…
-
Browser Automation With Javascript
In this article I am going to demonstrate how anyone can learn some simple code to automate common tasks using a standard web browser. Browser automation is a great tool for productivity and scaling up repetitive tasks. James On YouTube What Can Be Automated and Why? Have you ever found yourself carrying out the same…
-
Deno JS | Deno vs Node.JS
Deno is a Javascript and Typescript runtime from the creator of Node.js For anyone that doesn’t know Node.js is a server-side Javascript runtime. It’s used by millions of projects across the globe and powers the backends and API’s of many of the world’s leading websites. Then came Deno (aka Deno.js or Deno JS), an improved…
-
Lead Magnets, Autoresponders & Tripwires | The Modern Sales Funnel
This article is part of a free online course where you can learn digital marketing. Lead magnets, autoresponders and tripwires form key components of a very popular sales funnel. Traffic is pushed into the funnel from traffic sources such as paid ads, content marketing and social media outreach. The visitor is directed to a landing…
-
ReasonLIGO | Building Smart Contracts & Dapps On Tezos
Tezos smart contracts are compiled from a custom low level language called Michelson. For web developers however learning a new low level programming language is a barrier to entry… Enter LIGO and specifically ReasonLigo. ReasonLIGO is the most accessible way to develop smart contracts for web developers. ReasonLIGO is based on ReasonML which is based…
-
How do you turn a website into an app in 7 steps
This is a step by step guide to using a open-source package called Cordova to turn a website into mobile app on Android and iOS. I’ll be using a windows device for this but all the packages are also available for a Mac. To publish an app to the iOS app store you need to…
-
8 Tips For The Perfect Blog Post
This is the revised 2020 complete guide to the best practices when creating content for your blog. You can use this framework to create a “perfect blog post” and move your site up the search engine rankings. James On YouTube The Title The title or headline of a blog post should be a close match…
-
How to encrypt text file in Visual Studio Code (VSCode)
I wanted a way to quickly encrypt and decrypt text files in VSCode using a memorised pass phrase so I created an easy to use plugin to encrypt text in Visual Studio Code. VSC has become the text editor of choice for most developers and it is relatively simple to create and publish a plugin…
-
Prevent Mobile Browsers From Turning Off
The following code has been published to prevent mobile browsers from turning off and going into sleep mode. This was affecting setTimeout functions as the javascript code in the browser is effectively paused preventing the event loop from processing once sleep mode is activated. I originally looked at nosleep.js but ended up simplifying the code…
-
Search For Satoshi
In 2008 an anonymous user with the alias Satoshi Nakamoto posted the original Bitcoin whitepaper to the Cryptography mailing list. Satoshi mined a lot of the early Bitcoin blocks and the rewards that are held in bitcoin wallets associated are estimated to be around 1 million BTC or 10 Billion USD. If Bitcoin eventually reaches…
-
PHP Redirect with Parameters | Passing GET variables in a Redirect
Update March 2023 To do a 301 PHP redirect with parameters to another page we can use the following code: The entire query parameter string is stored in the following variable. Everything after the question mark. So for the URL: server.com/index.php?test=123&hi=hellothe $_SERVER[‘QUERY_STRING’] will contain this string “test=123&hi=hello” We can then pass this out when redirecting…
-
Wasabi AB Testing Platform
Update July 2020 – Wasabi is no longer maintained or supported. Check this article for more information on conversion rate optimisation. Wasabi AB 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…
-
robots.txt Disallow All | Block Bots
In this article we are going to look at how to block bot traffic using the robots.txt disallow all feature, then some of the more advanced uses of the robots.txt file. How To Disallow All in robots.txt Custom robots.txt for Specific Bots and Directories Complete List of Bots – robots.txt How To Disallow All in…
-
Vibrate Phone with Javascript
The following javascript uses the Vibrate API to make a phone vibrate when a page is loaded. You can time it with setTimeouts or onclick/onscroll if required. There’s more information available at: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/vibrate This can be used to draw a users attention to the landing page or to create message effects etc.
-
Node.js client for Moz API (MozScape)
Update 2020: This is outdated now and not maintained. I’d recommend using one of these packages: https://www.npmjs.com/package/moz-api https://www.npmjs.com/package/moz-api-wrapper Original Post: I was doing some work with SEO domains and realised there wasn’t a node.js client for the MozScape API… so after Googling and not finding what I was looking for I built one. What this…
-
REGEX | A Complete Guide With Examples
Regexes are a powerful way to do search queries on a text string. They can be used to replace text, sanitize user inputs and much more. Contents Introduction to REGEX REGEX Cheatsheet REGEX Examples REGEX Javascript Code An Introduction to REGEX A REGEX or regular expression is used to match text strings in many programming…
-
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 of your offers value proposition, sign-up requirements (double-opt in?) or just to increase conversion rate on the offer end. A working demo is available…
-
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. TIP: This uses a 301 redirect however you can do any type of programmatic variation based on the user agent. You can copy and paste this into…
-
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 pin submit that only accepts android but has a much higher payout then you can separate your android traffic and increase your bottom line.…
-
RAM & CPU Usage PHP Script | Server Health Check
This single file server health check script works on Windows, Linux and possibly others. It is written in PHP to show CPU usage, RAM usage, Incoming Connections and Hard disk usage. Update September 2020 Server Check PHP was getting a lot of downloads so I’ve updated the code and open sourced it on Github. If…
-
Resize youtube/vimeo iframe to maximum available height and width
Here is the code to make a flexible youtube.com or vimeo.com video fit both the height and width of the containing div. Like a flexible adsense unit it will take up the maximum available space on the page or be constrained within a containing object such as a div. CSS: .vcontainer { position:relative; padding-bottom:56.25%; padding-top:30px;…
-
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 the earth in km var dLat = deg2rad(lat2-lat1); var dLon = deg2rad(lon2-lon1); var a = Math.sin(dLat/2) *…
-
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 can sometimes be viewed negatively and for the first visit or under certain circumstances it is best to temporarily disable them. Here is the…
-
Automatic Redirect for Mobile Landing Page
Want a mobile lander with a 90%+ “CTR”? Simply add the following javasript: <script> function go() { location.href = ‘http://www.jamesbachini.com’; } function init() { setTimeout(function() { confirm(‘You have two friends who recommended this app’); },3000); setTimeout(function() { go(); },5000); } </script> Then run the init function on body load like so: <body onload=”init();”> This does…
-
Setting up Maxmind GEOIP2 Legacy Database with PHP or Javascript
This is the php code I use to access geoip data from Maxmind’s geoip database: <?php $gpath = getcwd() . “/GeoIPCity.dat”; if (isset($_SERVER[‘HTTP_X_FORWARDED_FOR’])) { $myip = $_SERVER[‘HTTP_X_FORWARDED_FOR’]; } if (isset($_SERVER[‘REMOTE_ADDR’])) { $myip = $_SERVER[‘REMOTE_ADDR’]; } include(“./geoipcity.inc”); $gi = geoip_open($gpath,GEOIP_STANDARD); $record = geoip_record_by_addr($gi,$myip); $city = $record->city; $countrycode = $record->country_code; geoip_close($gi); echo ‘countrycode = “‘.$countrycode.’”; city =…
-
Google Friendly Mobile Pages Test
Google have provided a tool which checks to see if a site renders clearly in a mobile browser. The tool looks like it is setup at 320px and if your site works at this you’ll get a “mobile-friendly” tag in your organic search listings. Here’s the link to check your sites: https://www.google.com/webmasters/tools/mobile-friendly/ Some other good…
-
Passing Through Landing Page Variables
This was inspired by another post which is well worth a read at: http://affplaybook.com/blog/affiliate-marketing/the-ultimate-guide-to-landing-page-tricks/ So many traffic sources provide you with tags such as {keyword} {countrycode} {device} etc. You can add these variables to your url so it would look something like: http://www.myserver.com/landingpage.htm?kw={keyword}&device={device} Then in the code to your landing page you can access these…
-
Coding PHP for Affiliates | A Getting Started Guide
Coding for me is one of the most important skills you can have as an affiliate marketer. I’ve met plenty of affiliates that are running huge volume, making millions and can’t write a single line of code. “I just outsource it all” but for me I couldn’t imagine coming up with a tweak to a…
-
Automatic backup of MySQL database
Would you like to have a backup of your critical MySQL database emailed to you automatically? The following script was moified from backup2mail and needs setting up as a cron job, instructions are in the code. Download it for free here This is what the code looks like: <?php /// Setup /// // Test it…
-
Stupidly Simple AB or Multivariate Testing
Here’s a simple way you can setup a simple multivariate or A/B split test without any software just using the subid variables provided by an affiliate network and some really basic php. <?php $out = ‘http://www.myaffiliatelink.com/page1.php?affid=123&subid1=’; if (rand(0,1) == 0) { $out.=’g1′; $girlimg = ‘1.png’; } else { $out.=’g2′; $girlimg = ‘2.png’; } // this…
-
Combining Maxmind GeoIP with Google Maps iFrame
This is a quick script which uses Maxminds geoip location db downloadable for free from here with Google Maps iFrame. I haven’t tested this enough to find out if Google restrict the number of requests by referrer but you could always put a meta refresh page in the iframe to blank the referrer if thats…
-
Loading a conversion pixel on click through
Mobile campaign optimisation throws up a number of issues in regard to tracking. One thing I’ve found really useful is to load a conversion pixel on click through from the landing page to the offer page. This can be a traffic source pixel which can then be used to give some indication of site/device/carrier quality…
-
iframe to a specific div id on a landing page
Below is the code to iframe an offer page but cut out all the stuff you don’t need. This is useful if you just want to iframe the form while using your own images etc. This is setup so you just enter the url and div id you want to jump to at the top…
-
Mobile Multivariate Testing with SubID’s
Due to slow page load speeds it is advised to keep tracking software to minimum when running mobile campaigns. This caused me a problem when trying to develop and optimise a mobile landing page. Because I wasn’t using prosper or any other tracking software I couldn’t plug in my custom multivariate testing scripts. I was…
-
Prosper202 Mod – Set preferences before crashing server
Had a bit of an issue with Prosper crashing once the database got too big. I would log out and leave the analysis preferences set to my biggest traffic source and when I logged back in the server would crash as it tries to pull a report before you can modify the search critieria. I…
-
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 but this will be accurate for any software that uses the ISO 3166 standard. AD = Andorra AE = United Arab Emirates AF =…
-
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 someone. It’s designed for linux and you’ll need selenium up and running to work it. #!/usr/bin/env ruby require ‘rubygems’ gem ‘selenium-client’ require ‘selenium/client’ system(‘java…
-
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 image magick to decipher phpbb captchas. It’s written in ruby and was designed as part of a backlink building module. You’ll need linux, gocr,…
-
Rotating Offer Pages and Landing Pages in Prosper202
It is really easy to setup rotation of urls in Prosper but if you actually want to track which url is doing better or you want to test different landing pages it can be a little more challenging. One way to do this is to set each url or landing page up separately and then…
-
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 first page – bit naughty but I prefer to jump straight into the spy section to see whats been going…
-
Using Adsense Section Targeting
If you are getting lots of Groupon and Three ads on your adsense niche site the chances are it isn’t optimised correctly. By simply writing a short, keyword rich, snippet of what your site is about and surrounding it in the following tags you can manipulate which ads are shown. <!– google_ad_section_start –> Jet internet…
-
Custom WordPress 404 Page For SEO
I have recently been purchasing used domain names from Godaddy Auctions and Dropcatch. When I get the domains the first thing we do is look at what traffic they were pulling for what topics via google cached web search. If there is some good content on there and things we want to keep we will…
-
Setting up twitter feed to post to Twitter and Facebook accounts
If you don’t already have a facebook and twitter account for your company they are really easy to setup. On facebook remember to click the “Create a Page for a celebrity, band or business” link on the homepage. Once you have those accounts setup head over to twitterfeed.com and sign up for an account. Enter…
-
Mixing php with javascrip – Heredoc
My main issue with javascript is the fact it is full of ‘ and ” which can be a real pain when coding. I’ve started using a method called heredoc to set a start and end point, example below. // Heredoc string // $sstring = <<<TEST Hello World TEST; The word TEST could be anything…
-
Poor mans GeoIP – Quick and Easy Geolocation
//poor mans geoip $country=trim(file_get_contents(“http://api.hostip.info/country.php?ip=”.$_SERVER[‘REMOTE_ADDR’])); //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; }
-
Two php functions for scraping content and extracting links
////// Grab webpage ////// function webFetcher($url) { $crawl = curl_init(); curl_setopt ($crawl, CURLOPT_URL, $url); curl_setopt($crawl, CURLOPT_RETURNTRANSFER, 1); $resulting = $resulting.curl_exec($crawl); curl_close($crawl); return $result = $resulting; } //////////////////////////////// //// extract links //// function extract_links($text) { preg_match_all(‘/<\s*a[^<>]*?href=[\’”]?([^\s<>\’”]*)[\’”]?[^<>]*>(.*?)<\/a>/si’, $text, $match_array, PREG_SET_ORDER); $return = array() ; foreach ($match_array as $serp) { $full_anchor = $serp[0]; $href = $serp[1]; $anchortext =…
-
Three ways to debug php
Method 1 – error.log For this to work you need to be coding in a linux environment with php, apache etc setup. This is the best way I have found and what I currently use to debug my applications/web pages. open up a new terminal and type: tail -f /var/log/apache2/error.log This will give you a…
-
list to php array list2phparray
Code below for a script to take a list and turn it into an array. Comes in pretty useful. <?php if ($_POST[‘list’]) { $splist = explode(“\n”, $_POST[‘list’]); $out = ‘$x = array(‘; foreach ($splist as $line) { $out = $out.”‘$line’, “; } $out = substr($out,0,-1); $out = substr($out,0,-1); $out = $out.’);’; echo $out; } else…
-
Prosper202 Hacks and Modifications
JiM’s Prosper202 mods 1) increase session life (stops it locking you out every few minutes) add the following line just before session_start(); in 202-config/connect.php ini_set(‘session.gc_maxlifetime’,99999); 2) Cchange the first page you see. edit 202-login.php line 80: header(‘location: /202-account’); to header(‘location: /tracking202’); or /tracking202/spy/ If you are doing email submits or any volume loging into spy…
-
Dynamically modifying the landing page with TrafficVance using php
I ran into a silly issue today when dynamically modifying a landing page using TrafficVance. The script I was using was a pretty straight forward: <?php if ($_GET[‘t202kw’]) { $kw = strip_tags($_GET[‘t202kw’]); } if(strpos($kw,’jetinternetmarketing.co.uk’) !== false) { $page = ‘<h1>Dont target JiM on traffic Vance</h1>’; } ?> The problem was that the url I was…