Skip to content

Instantly share code, notes, and snippets.

View dnalob's full-sized avatar
🎯
Focusing

dnalob

🎯
Focusing
View GitHub Profile
@dnalob
dnalob / gist:9ec47dcfc43f08fa17487c90872bd8a2
Created January 16, 2020 21:40 — forked from mhawksey/gist:0c5ad7b79e1162b239156ce946cbe2be
Snippet of code used for DevFest London 2017 to count faces in audience and send to Google Analytics and update image in Google Slides (see https://mashe.hawksey.info/?p=17787)
import io
import picamera
import cv2
import numpy
import requests
import base64
def hitGA(faces):
print("Sending to GA")
requests.get("http://www.google-analytics.com/collect?v=1" \
@dnalob
dnalob / face-detection-to-google-analytics.py
Created January 16, 2020 21:40 — forked from mhawksey/face-detection-to-google-analytics.py
Snippet of code used for DevFest London 2017 to count faces in audience and send to Google Analytics (see https://mashe.hawksey.info/?p=17787)
import io
import picamera
import cv2
import numpy
def hitGA(faces):
print("Sending to GA")
requests.get("http://www.google-analytics.com/collect?v=1" \
+ "&tid=YOUR_UA_TRACKING_ID_HERE" \
+ "&cid=1111" \
@dnalob
dnalob / slide_template.gs
Created January 16, 2020 21:28 — forked from mhawksey/slide_template.gs
Port of Wesley Chun's 'Using the Google Slides API with Python' to Google Apps Script. Read more at https://mashe.hawksey.info/?p=17385
// Port of Slides API demo by Wesley Chun to Google Apps Script
// Source: http://wescpy.blogspot.co.uk/2016/11/using-google-slides-api-with-python.html
function slides_template() {
/*
from apiclient import discovery
from httplib2 import Http
from oauth2client import file, client, tools
*/
// Limit Monthly Cost By Postal Codes in a Campaign
//
// Copyright 2017 - Optmyzr Inc - All Rights Reserved
// Visit www.optmyzr.com for more AdWords Scripts and PPC Management Tools and Reports
//
//
// Purpose of the script:
// ---------------------
// To allow you to set a broad location target to capture more traffic in a regionwhile at the same time
// letting you limit the monthly cost for locations within the target region.
@dnalob
dnalob / Expanded Text Ad Suggestor.js
Created January 14, 2020 03:15 — forked from siliconvallaeys/Expanded Text Ad Suggestor.js
Generate an AdWords bulksheet with suggestions for expanded text ads based on your landing page meta data
// Generate Expanded Text Ads From Landing Page Meta Data - AdWords Script
//
// Copyright 2016 - Optmyzr Inc - All Rights Reserved
// For more AdWords Scripts and PPC Management Tools and Reports, visit
//
// https://www.optmyzr.com/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@dnalob
dnalob / Exclude Google Display Placements That Contain ...
Created January 14, 2020 03:12 — forked from siliconvallaeys/Exclude Google Display Placements That Contain ...
Automatically add negative placements for any new automatic GDN placements that include a particular piece of text
/****************************
* Add a Placement Exclusion When an Automatic Placement Contains the Text ...
* Version 1.0
*
* Created By: Frederick Vallaeys
* for FreeAdWordsScripts.com
* at the request of an Optmyzr.com subscriber
****************************/
function main() {
@dnalob
dnalob / Exclude Mobile App Placements
Created January 14, 2020 03:10 — forked from siliconvallaeys/Exclude Mobile App Placements
Add poorly performing mobile app placements on GDN as excluded targets
/****************************
* Exclude Mobile App ad placements that perform poorly
* Version 1.0 (Aug 08, 2018)
*
* Created By: Optmyzr
* A supported version of this script is available at www.optmyzr.com
****************************/
function main() {
@dnalob
dnalob / gdn-placement-analysis
Created January 10, 2020 23:09 — forked from derekmartinla/gdn-placement-analysis
Find Underperforming Placements & Opportunities On Google Display Network
// This script reviews your GDN placements for the following conditions:
// 1) Placements that are converting at less than $40
// 2) Placements that have cost more than $50 but haven't converted
// 3) Placements that have more than 5K impressions and less than .10 CTR
function main() {
var body = "<h2>Google Display Network Alert</h2>";
body += "<h3>Placements that are converting at less than $40:</h3> " ;
body += "<ul>";
/***********************************************************************************************
* AdWords Account Optimization - Review Google Display Network Site Placement Quality.
* Analyze Display Network Placements that have accrued more than $20 of cost MTD against
* Standard SEO metrics (PageAuthority, DomainAuthority, # of Backlinks, Age of Site) and report back
* Any questionable placements that are strong targets for exclusion.
* Created By: Derek Martin
* DerekMartinLA.com
****************************************************************************************/
// CONSTANTS
@dnalob
dnalob / Scrape YouTube search Results
Created January 7, 2020 00:12 — forked from erajanraja24/Scrape YouTube search Results
Scrape YouTube Search Results
function YouTubeScraper() {
var sh1 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1");
var keyword = sh1.getRange("B1").getValue();
var results = YouTube.Search.list('id,snippet', {q:keyword, maxResults:50});
//Video ID Published Date Channel ID "Video Title
//" Description Thumbnail URL Channel Title
var items = results.items.map(function(e){
return [e.id.videoId,
e.snippet.publishedAt,