Skip to content

Instantly share code, notes, and snippets.

View Vijaysinh's full-sized avatar
🌶️
Working from home

Vijaysinh Parmar Vijaysinh

🌶️
Working from home
View GitHub Profile
@Vijaysinh
Vijaysinh / AdGroupCallExtension.php
Created June 24, 2020 08:09 — forked from jamesmills/AdGroupCallExtension.php
Google Adwords API. Creating a Call Extension for an AdGroup.
<?php
public function fire()
{
// See the Placeholder reference page for a list of all the placeholder types and fields.
// https://developers.google.com/adwords/api/docs/appendix/placeholders.html
define('PLACEHOLDER_SITELINKS', 1);
define('PLACEHOLDER_FIELD_SITELINK_LINK_TEXT', 1);
define('PLACEHOLDER_FIELD_SITELINK_URL', 2);
@Vijaysinh
Vijaysinh / NewLineHTMLTitleAttributeTooltip.html
Last active May 14, 2020 06:15
New Line HTML Title Attribute
<!DOCTYPE html>
<html>
<body>
<p><abbr title="-Line 1&#010;-Line 2">Hover Me</abbr> My Name Is Vijaysinh.</p>
<p title="Bangalore">Bangalore</p>
</body>
</html>
@Vijaysinh
Vijaysinh / GoogleAdsMCCScriptLabels.js
Created November 20, 2019 11:25
GoogleAdsMCCScript for Labels
function main() {
// You can use this approach when you have only minimal processing to
// perform in each of your client accounts.
// Select the accounts to be processed.
var accountIterator = MccApp.accounts().get();
var arrayList=[];
// Save the MCC account, to switch back later.
@Vijaysinh
Vijaysinh / bitbucket-ftp-pipelines.yml
Last active November 20, 2019 11:28
bitbucket2remoteFTP deploy
image: samueldebruyn/debian-git
pipelines:
default:
- step:
script:
- apt-get update
- apt-get -qq install git-ftp
- git ftp init --user $SITE_FTP_USER --passwd $SITE_FTP_PASS ftp://xyzsite.com/publichtml/repo/
@Vijaysinh
Vijaysinh / Add_Audience_to_AdwordsAccount.php
Last active September 29, 2019 20:40
Google Adwords Adding Audiance to Google adwords account Visitors of a page
<?php
//https://github.com/googleads/googleads-php-lib/blob/8cd18b116b40127c91bb1d2679924c13d6b964f6/examples/AdWords/v201809/Remarketing/AddRuleBasedUserLists.php
//https://developers.google.com/adwords/api/docs/guides/remarketing#visitors_to_your_website
//https://developers.google.com/adwords/api/docs/reference/v201809/AdwordsUserListService.BasicUserList
///https://groups.google.com/forum/#!msg/adwords-api/-_dA7ZYVNiI/ebA9BXjkCwAJ
//https://developers.google.com/google-ads/api/reference/rpc/google.ads.googleads.v2.common#google.ads.googleads.v2.common.UserListInfo
//https://developers.google.com/adwords/api/docs/samples/php/remarketing#add-crm-based-user-list
use Google\AdsApi\AdWords\AdWordsServices;
use Google\AdsApi\AdWords\AdWordsSession;
use Google\AdsApi\AdWords\AdWordsSessionBuilder;
@Vijaysinh
Vijaysinh / sorting_versions.py
Last active September 25, 2019 08:55
Sorting Api Version in python
from distutils.version import StrictVersion
#from operator import itemgetter
v1 = [{'ver': "1.1.12"},{'ver': "1.0.0"},{'ver': "1.3.3"},{'ver': "1.0.12"},{'ver': "1.0.2"}]
v1.sort(key=lambda x: StrictVersion(x['ver']),reverse=True)
print(v1)
versions = ["1.1.2", "1.0.0", "1.3.3", "1.0.12", "1.0.2"]
versions.sort(key=StrictVersion,reverse=True)
print(versions)
@Vijaysinh
Vijaysinh / file_download.php
Last active January 4, 2021 06:46
Download Files from Remote Server DB
<?PHP
error_reporting(E_ALL);
ini_set('display_errors',1);
get_attachments();
if(isset($_GET['id']) && !empty($_GET['id'])){
$id = $_GET['id'];
$fileName = $_GET['file'];
@Vijaysinh
Vijaysinh / File_upload.php
Last active September 3, 2019 06:31
File upload using CURL PHP
<!DOCTYPE html>
<html>
<head>
<title>Upload your files</title>
</head>
<body>
<form enctype="multipart/form-data" action="index.php" method="POST">
<p>Upload your file</p>
<input type="file" name="file"></input><br />
<input type="submit" value="Upload"></input>
@Vijaysinh
Vijaysinh / memcached.php
Created August 9, 2019 11:48 — forked from raybogman/memcached.php
Memcached viewer for PHP
<?php
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2004 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
@Vijaysinh
Vijaysinh / Duplicate Ad Detector.js
Created July 13, 2019 04:49 — forked from BrainlabsDigital/Duplicate Ad Detector.js
Script to find and label duplicated ads
/**
*
* Duplicate Ad Detector
* This script will find ads with identical text and URLs, and label
* one to keep and the rest to pause according to performance.
*
* Version: 1.0
* Google AdWords Script maintained by brainlabsdigital.com
*
**/