Skip to content

Instantly share code, notes, and snippets.

View alispat's full-sized avatar
🎯
Focusing

Alisson Patrick alispat

🎯
Focusing
View GitHub Profile
@alispat
alispat / bash_profile.md
Created April 8, 2019 12:58 — forked from ankurk91/bash_profile.md
:octocat: Git branch name in Linux/Mac Terminal

Mac OS : Show your git branch name on your terminal

Add these lines in your ~/.bash_profile file

# Show current git branch name
parse_git_branch() {
     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
@alispat
alispat / Campaign Budget Overspend Monitoring
Created January 14, 2019 22:01 — forked from BrainlabsDigital/Campaign Budget Overspend Monitoring
Labels (and optionally pauses) campaigns that are overspending too much, and emails you a warning.
/**
*
* Campaign Budget Overspend Monitoring
*
* This script labels campaigns whose spend today is more than their daily
* budgets. Optionally, it also pauses campaigns whose spend exceeds the
* budget by too much. An email is then sent, listing the newly labelled
* and paused campaigns.
* When spend no longer exceeds budget, the campaigns are reactivated and
* labels are removed.
@alispat
alispat / Landing Page Contents Checker.js
Created January 14, 2019 21:58 — forked from BrainlabsDigital/Landing Page Contents Checker.js
Script to check landing pages for phrases like 'out of stock'
/**
*
* AdWords Script for checking the contents of landing pages.
* Goes to the final URL of keywords or ads, then searches the source code for
* user defined strings.
*
* Version: 1.0
* Google AdWords Script maintained by brainlabsdigital.com
*
**/
@alispat
alispat / Pause Losing Ads.js
Created January 14, 2019 21:55 — forked from BrainlabsDigital/Pause Losing Ads.js
Script to find and label the best performing ads in each ad group, and label/pause the others.
/**
*
* Pause Losing Ads & Ad Rotate Analysis
*
* This script finds the best ad in each ad group (subject to thresholds) and
* calculates the performance you could have got if the impressions that went to
* losing ads went to the winning ads instead.
* Labels the winning and losing ads, and (optionally) pauses the losers.
*
* Version: 2.0
@alispat
alispat / Low Quality Score Alert.js
Created January 14, 2019 21:49 — forked from BrainlabsDigital/Low Quality Score Alert.js
Script to email you if you have low quality score keywords, and optionally label/pause them
/**
*
* Low Quality Score Alert
*
* This script finds the low QS keywords (determined by a user defined threshold)
* and sends an email listing them. Optionally it also labels and/or pauses the
* keywords.
*
* Version: 1.0
* Google AdWords Script maintained on brainlabsdigital.com
@alispat
alispat / Expanding Phrase Match Negatives.js
Created January 14, 2019 21:46 — forked from BrainlabsDigital/Expanding Phrase Match Negatives.js
Script to find potential negatives based on search queries that contain an existing phrase negative.
/**
*
* Expanding Phrase Match Negatives
*
* This script searches for all occurrences of phrase match negatives in search
* queries resulting from typos. Outputs a report to a Google Doc spreadsheet.
*
* Version: 1.0
* Google AdWords Script maintained on brainlabsdigital.com
*
@alispat
alispat / Change in Campaign Spending Alert.js
Created January 14, 2019 21:46 — forked from BrainlabsDigital/Change in Campaign Spending Alert.js
Script to alert you if a campaign's spend has changed dramatically
/**
*
* Change in Campaign Spending Alert
*
* This script uses the current hour to calculate how much has been spent on
* individual campaigns on the day of running. The average spend up to the
* current hour in a specified numbers of days previously is averaged. If the
* spend today is higher by a specified percentage threshold an alert email
* is sent.
*
@alispat
alispat / ExactMatchScriptUpdated.js
Created January 14, 2019 21:45 — forked from BrainlabsDigital/ExactMatchScriptUpdated.js
Create negatives where search queries are too dissimilar to the keywords they trigger. Based on containing the same words and/or edit distance.
/**
*
* Make Exact Match Exact
*
* Adds negatives for any search query that doesn't actually exactly match an exact
* match keyword.
*
* Version: 2.0
* Google AdWords Script maintained on brainlabsdigital.com
*
@alispat
alispat / ruby_http_post.rb
Created January 31, 2018 11:34 — forked from kinopyo/ruby_http_post.rb
Pure ruby code posting form data with parameters, and get the response.
require 'net/http'
require 'uri'
#1: Simple POST
res = Net::HTTP.post_form(URI.parse('http://www.example.com/search.cgi'),
{'q' => 'ruby', 'max' => '50'})
puts res.body
#2: POST with basic authentication
res = Net::HTTP.post_form(URI.parse('http://jack:pass@www.example.com/todo.cgi'),
@alispat
alispat / deploy.rb
Created January 26, 2018 16:13 — forked from cannikin/deploy.rb
Notify Sentry of a new release via Capistrano
# This task will notify Sentry via their API[1] that you have deployed
# a new release. It uses the release timestamp as the `version`
# (like 20151113182847) and the git ref as the optional `ref` value.
#
# This task requires several environment variables be set (or just
# hardcode the values in here if you like living on the edge):
#
# ENV['SENTRY_API_ENDPOINT'] : API endpoint, https://app.getsentry.com
# ENV['SENTRY_ORG'] : the organization for this app
# ENV['SENTRY_PROJECT'] : the project for this app