Skip to content

Instantly share code, notes, and snippets.

View Strusovsky's full-sized avatar

Andrew Strusovsky Strusovsky

View GitHub Profile
@Strusovsky
Strusovsky / google_sheets_one_way_sync.js
Created May 25, 2019 07:01 — forked from thealchen/google_sheets_one_way_sync.js
One-way data sync between Google Sheets files
var sourceSpreadsheetID = "TO UPDATE";
var sourceWorksheetName = "TO UPDATE";
var targetSpreadsheetID = "TO UPDATE";
var targetWorksheetName = "TO UPDATE";
function importData() {
var thisSpreadsheet = SpreadsheetApp.openById(sourceSpreadsheetID);
var thisWorksheet = thisSpreadsheet.getSheetByName(sourceWorksheetName);
var thisData = thisWorksheet.getDataRange();
//Uncomment line 11 below and comment out line 9 if you want to sync a named range. Replace "teamBugs" with your named range.
@Strusovsky
Strusovsky / gist:176aa6c7c0bb75a329ec9bb47f917e7b
Created March 31, 2019 10:21 — forked from jeznag/gist:a47fefa0d491a8a73956a345d1a4c51e
Deluge code for creating purchase order based on sales order
sales_order_record = zoho.crm.getRecordById("Sales_Orders",sales_order_id.toLong());
products = sales_order_record.get("Product_Details");
account_id = sales_order_record.get("Account_Name").getJSON("id");
account_record = zoho.crm.getRecordById("Accounts", account_id.toLong());
products_list = products.toJSONList();
products_for_purchase_order = List:Map();
grand_total = 0.0;
total_without_tax = 0.0;
string getProductsFromPurchaseorder(string purchase_order_id)
{
purchase_order_record = zoho.crm.getRecordById("PurchaseOrders",input.purchase_order_id.toLong());
line_items = purchase_order_record.get("product").toJSONList();
xml_for_related_list = "<record>";
idx = 0;
for each line_item in line_items
{
line_item_map=line_item.toMap();
xml_for_related_list=((xml_for_related_list + ("<row no='" + idx + "'><FL val='product name'>" + line_item_map.get("Product Name")) + "</FL><FL val='quantity'>") + line_item_map.get("Quantity")) + "</FL></row>";
@Strusovsky
Strusovsky / gist:2a4e8fd478199d3f556771b9c603abd1
Created March 31, 2019 10:21 — forked from jeznag/gist:eb53f5742c6f9cebf3b6752b04fd25e2
Automatically associating products to potential in Zoho CRM
AUTH_TOKEN = "CHANGEME";
quote_record = zoho.crm.getRecordById("Quotes", quote_id);
quote_products = quote_record.get("product").toJSONList();
related_products = zoho.crm.getRelatedRecords("Products", "Potentials", input.deal_id.toString());
row_index = 1;
xml_data = "<Products>";
for each product in quote_products {
product_map = product.toMap();
info product_map;
xml_data += "<row no=\"" + row_index + "\"><FL val=\"PRODUCTID\">" + product_map.get("Product Id") + "</FL></row>";
@Strusovsky
Strusovsky / README.md
Created March 25, 2019 23:24 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@Strusovsky
Strusovsky / Analyze Close Variant Search Terms
Created March 24, 2019 11:26 — forked from siliconvallaeys/Analyze Close Variant Search Terms
Compare phrase and exact match Google Ads keywords with the close match variants they are shown for
// Report on how close variants relate to your keywords in Google Ads
// Free AdWords Script courtesy of Optmyzr.com
// September 12, 2018
function main() {
// -----------------
// Edit this section with your preferences
// ----------------
var time = 'LAST_30_DAYS';
@Strusovsky
Strusovsky / Populate Sheets With AdWords Data.js
Created March 24, 2019 11:25 — forked from siliconvallaeys/Populate Sheets With AdWords Data.js
Populate Google Sheet With Custom AdWords Data
/*
// AdWords Script: Put Data From AdWords Report In Google Sheets
// --------------------------------------------------------------
// Copyright 2017 Optmyzr Inc., All Rights Reserved
//
// This script takes a Google spreadsheet as input. Based on the column headers, data filters, and date range specified
// on this sheet, it will generate different reports.
//
// The goal is to let users create custom automatic reports with AdWords data that they can then include in an automated reporting
// tool like the one offered by Optmyzr.
@Strusovsky
Strusovsky / Keyword or Product Group Spend Alerts
Created March 24, 2019 11:25 — forked from siliconvallaeys/Keyword or Product Group Spend Alerts
Get alerted when keywords or product groups are spending too much today with few conversions
function main() {
var currentSetting = new Object();
// what do you want to check?
currentSetting.entityToCheck = "product groups"; // valid options: keywords, product groups
// How much cost is allowed before we alert?
currentSetting.maxCost = 1;
// Fewer than how many conversions before we alert?
/****************************
* Export an AdWords report to a Google Sheet and pivot on unique entities
* Version 1.0
*
* Created By: Frederick Vallaeys
* for FreeAdWordsScripts.com and Optmyzr.com
* to support advanced use cases of the Optmyzr Rule Engine available at www.optmyzr.com
****************************/
@Strusovsky
Strusovsky / Conflicting Negative Keywords for Converting Queries
Created March 24, 2019 11:24 — forked from siliconvallaeys/Conflicting Negative Keywords for Converting Queries
Find negative keywords that block queries that have converted in the past
/*
// AdWords Script: Negatives Blocking Converting Queries
// -----------------------------------------------------------------------------
// Copyright 2017 Optmyzr Inc., All Rights Reserved
//
// This script identifies negative keywords that are now blocking ads from
// appearing for previously converting queries
//
// For more PPC management tools, visit www.optmyzr.com
//