Skip to content

Instantly share code, notes, and snippets.

View underdown's full-sized avatar

Ryan Underdown underdown

  • Classy Closets
  • Phoenix, AZ
View GitHub Profile
/***********************************************************************************************
* 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
@wimleers
wimleers / .htaccess
Created November 15, 2011 06:37
.htaccess file to only allow downloads from Amazon CloudFront.
Options +FollowSymLinks -MultiViews
RewriteEngine On
SetEnvIf User-Agent ^Amazon Cloudfront$ cdn
Order Deny,Allow
Deny from all
Allow from env=cdn
@derekmartinla
derekmartinla / gist:b719840542406322bb27
Last active June 2, 2017 14:20
AdWords Countdown Ads Updater Script
/***************************************************************************************
* AdWords Countdown Ad Updater -- Find stale countdown ads and replace them with
* Ads that are updated with new dates.
* Version 1.0
* Created By: Derek Martin
* DerekMartinLA.com or MixedMarketingArtist.com
****************************************************************************************/
var DESCRIPTION2_TEXT = "Sale Ends In"
@rupl
rupl / user-actions.js
Last active May 11, 2018 22:46
A CasperJS script to demonstrate simple user navigation actions on a website. This sample accompanies a blog post about CasperJS found at http://fourword.fourkitchens.com/article/simulate-user-actions-casperjs
/**
* @file
* Simulating user actions with CasperJS. This script explores the ability to
* use Casper for navigation just like a user would: clicking the page and
* entering text to submit a form. This script accompanies a blog post from
* Four Kitchens:
*
* @see http://fourword.fourkitchens.com/article/simulate-user-actions-casperjs
*/
@mhawksey
mhawksey / gist:5419876
Last active August 24, 2018 19:33
Google Apps Script to get feed post count and last post date
function fetchFeedItemCount(url,optType) {
var type = optType || "feed";
var output = [];
//var url = "http://confessionsofalearningtechnologist.blogspot.com/feeds/posts/default?alt=rss";
// little switch to get rss2 feed for blogger
if (/\/posts\/default$/.test(url)){
url += "?alt=rss";
}
@Wysie
Wysie / gist:03934b6a79a715772abd
Last active December 10, 2019 20:01
Upload to Amazon S3 Instead of Server for Sendy Email Image Uploads
//Using S3.php from https://github.com/tpyo/amazon-s3-php-class. Place it in includes/helpers
//Replaces Sendy's includes/create/upload.php
<?php
include('../functions.php');
include('../login/auth.php');
require_once('../helpers/S3.php');
//Init
$file = $_FILES['file']['tmp_name'];
@kaspergrubbe
kaspergrubbe / install-graphite-ubuntu-13.04.sh
Last active October 4, 2020 11:53 — forked from jgeurts/install-graphite-ubuntu-12.04.sh
Don't overwrite the local_settings.py
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 16. June 2013
####################################
# This is apparantly needed for python when running manage.py
# described here: http://stackoverflow.com/questions/11593556/django-createsuperuser-not-working
export LANG=en_US.UTF-8
@underdown
underdown / gist:1367825
Created November 15, 2011 18:07
PHP Google Scraping Function
function findranking($domain, $keyword) {
usleep(400000*rand(0,16)); //set random interval between checks
$url="http://www.google.com/search?q=".urlencode($keyword)."&num=100";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER,1); // set to 0 to eliminate header info from response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)
$header = array();
$header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,";
@scottmagdalein
scottmagdalein / clickable-element.html
Last active March 15, 2023 18:01
Make the Mailchimp Subscriber popup appear on click
<!-- This is the HTML element that, when clicked, will cause the popup to appear. -->
<button id="open-popup">Subscribe to our mailing list</button>
@derekmartinla
derekmartinla / gdn-placement-analysis
Last active July 12, 2023 09:08
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>";