Skip to content

Instantly share code, notes, and snippets.

View faizanayubi's full-sized avatar

Faizan Ayubi faizanayubi

View GitHub Profile
@faizanayubi
faizanayubi / utm_tracker.html
Created November 14, 2017 11:39
UTM Tracker vNative
<script type="text/javascript">
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
// Give the URL parameters variable names
var source = getParameterByName('utm_source');
var medium = getParameterByName('utm_medium');
[
"ALL", "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda",
"Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh",
"Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia",
"Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burma",
"Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad",
"Chile", "China", "Colombia", "Comoros", "Congo, Democratic Republic", "Congo, Republic of the",
"Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti",
"Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador",
"Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon",
@faizanayubi
faizanayubi / script.js
Created May 21, 2017 06:23
Track Multiple Conversions from different traffic
$(document.body).on("click", ".product-btn, .btn-buy", function (e) {
e.preventDefault();
var lnk = $(this).attr('href');console.log(lnk);
var l = document.createElement("a"); l.href = lnk;
var src = 'https://track.vnative.com/pixel?adid=5920681cb6920d372064e102&sub2=' + encodeURIComponent(window.location.pathname) + '&sub3=' + encodeURIComponent(document.title) + '&sub1=' + encodeURIComponent(l.hostname) + '&txn_id=RANDOM';
var body = document.getElementsByTagName('body')[0], img = document.createElement('img');
img.style.width = '1px';img.style.height = '1px';img.style.display = 'none';img.src = src; body.appendChild(img);
var win = window.open(lnk, '_blank');
win.focus();
});
@faizanayubi
faizanayubi / nginx.conf
Created May 14, 2017 04:25
Redirect to SSL
server {
listen 172.31.20.172:80;
server_name m.vnative.com;
## redirect http to https ##
rewrite ^ https://$server_name$request_uri permanent;
}
@faizanayubi
faizanayubi / pubRegister.html
Created April 25, 2017 06:22
Sample Email Template - EJS
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Publisher Register</title>
<style type="text/css">
img {
max-width: 100%;
@faizanayubi
faizanayubi / AndroidManifest.xml
Last active December 15, 2016 08:34
Implementing a custom BroadcastReceiver with INSTALL_REFERRER
<receiver android:name=".vNativeTracker"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
@faizanayubi
faizanayubi / mautic-nginx
Created October 5, 2016 06:04
Mautic 2 Nginx Configuration file
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name _;
@faizanayubi
faizanayubi / nginx-basic.conf
Created October 4, 2016 11:33
Nginx Basic Configuration
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name server_domain_or_IP;
location / {
@faizanayubi
faizanayubi / bot.py
Created August 19, 2016 16:06
Advanced Bot
#!/usr/bin/python
import urllib2
import urllib
import sys
import time
import random
import re
import os
proxylisttext = "proxylist.txt"
@faizanayubi
faizanayubi / ftp-example-ubuntu
Created July 22, 2016 14:44
Fixed: FTP Backup VestaCP
1. Switch to root
2. configure FTP backup command usage
/usr/local/vesta/bin/v-add-backup-host TYPE HOST USERNAME PASSWORD [PATH] [PORT]
example - /usr/local/vesta/bin/v-add-backup-host ftp ftpserver.com user password /home/user 21
(replace with your ftp server details)
3. verify that ftp server is added successfully
nano /usr/local/vesta/conf/ftp.backup.conf