Skip to content

Instantly share code, notes, and snippets.

Travis Smith wpsmith

Block or report user

Report or block wpsmith

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@wpsmith
wpsmith / minimize-over-delivery.js
Created Jun 4, 2016 — forked from daniel-c05/minimize-over-delivery.js
AdWords Scripts - Minimize Overdelivery
View minimize-over-delivery.js
//Edit this based on the max amount you want to spend on a given day.
var maxSpend = 1000;
function main () {
var currentAccount = AdWordsApp.currentAccount();
var stats = currentAccount.getStatsFor("TODAY");
var cost = stats.getCost();
Logger.log("Account has spent " + cost + " so far.");
if (cost > maxSpend) {
campaign.pause();
@wpsmith
wpsmith / evaluate-ad-text-line-performance.js
Created Jun 4, 2016 — forked from daniel-c05/evaluate-ad-text-line-performance.js
AdWords Scripts - Evaluate Ad Text Line Performance
View evaluate-ad-text-line-performance.js
// Comma-separated list of recipients. Comment out to not send any emails.
var RECIPIENT_EMAIL = 'YOUR_EMAIL';
// URL of the default spreadsheet template. This should be a copy of http://goo.gl/pxaZio
var SPREADSHEET_URL = 'SPREADSHEET_URL';
/**
* This script computes an Ad performance report
* and outputs it to a Google spreadsheet
*/
View AdWords_Scripts_Ad_Testing.js
/*********************************************
* Automated Creative Testing With Statistical Significance
* Version 2.1
* Changelog v2.1
*   - Fixed INVALID_PREDICATE_ENUM_VALUE
* Changelog v2.0
*   - Fixed bug in setting the correct date
*   - Script now uses a minimum visitors threshold
*        per Ad instead of AdGroup
*   - Added the ability to add the start date as a label to AdGroups
@wpsmith
wpsmith / gist:d7b500d018dafb85325fe8d70fb6568c
Created May 27, 2016 — forked from dberesford/gist:28876b39d26b02b7683a
Sample node.js leak detection using memwatch and heapdump
View gist:d7b500d018dafb85325fe8d70fb6568c
var http = require('http');
var util = require('util');
var heapdump = require('heapdump');
var memwatch = require('memwatch');
var server = http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
for (var i=0; i<1000; i++) {
server.on('request', function leakyfunc() {
@wpsmith
wpsmith / Amazon-Linux-AMI PHP55
Created Apr 21, 2016 — forked from sl-digital/Amazon-Linux-AMI PHP55
Install Apache, MySQL and PHP 5.5 on Amazon Linux AMI
View Amazon-Linux-AMI PHP55
:: UPDATE YUM ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
sudo yum update -y
:: INSTALL WEBSERVER :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
sudo yum install httpd24
sudo service httpd start
sudo chkconfig httpd on
chkconfig --list httpd
@wpsmith
wpsmith / Setup.md
Created Apr 21, 2016 — forked from suvozit/Setup.md
Setup AWS EC2 and RDS (php5.5, apache2.4, mysql5.5, phpmyadmin)
View Setup.md
@wpsmith
wpsmith / default.conf
Created Apr 20, 2016 — forked from cbmd/default.conf
nginx config - dynamic virtual hosts
View default.conf
server {
index index.php;
set $basepath "/var/www";
set $domain $host;
# check one name domain for simple application
if ($domain ~ "^(.[^.]*)\.dev$") {
set $domain $1;
set $rootpath "${domain}";
@wpsmith
wpsmith / aaa.nginxconf
Created Apr 20, 2016 — forked from markjaquith/aaa.nginxconf
Grab non-locally-existing production images from Photon for your local WordPress dev environment
View aaa.nginxconf
location ~* \.(jpe?g|gif|png)$ {
try_files $uri @photon;
}
location @photon {
rewrite ^(.*)-([0-9]+)x([0-9]+)\.(jpe?g|gif|png)$ http://i0.wp.com/$host$1.$4?resize=$2,$3;
rewrite . http://i0.wp.com/$host$request_uri;
}
@wpsmith
wpsmith / WP on AWS.md
Created Apr 20, 2016 — forked from ericandrewlewis/gist:95239573dc97c0e86714
Setting up a WordPress site on AWS
View WP on AWS.md

Setting up a WordPress site on AWS

This tutorial walks through setting up AWS infrastructure for WordPress, starting at creating an AWS account. We'll manually provision a single EC2 instance (i.e an AWS virtual machine) to run WordPress using Nginx, PHP-FPM, and MySQL.

This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. It is intended for folks who want a high-level of control and understanding of their infrastructure. It will take about half an hour if you don't Google away at some point.

If you experience any difficulties or have any feedback, leave a comment. 🐬

Coming soon: I'll write another tutorial on a high availability setup for WordPress on AWS, including load-balancing multiple application servers in an auto-scaling group and utilizing RDS.

@wpsmith
wpsmith / nginx.conf
Created Apr 20, 2016 — forked from markjaquith/nginx.conf
My WordPress Nginx setup
View nginx.conf
upstream phpfpm {
server unix:/var/run/php5-fpm.sock;
}
upstream hhvm {
server unix:/var/run/hhvm/hhvm.sock;
}
# SSL
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
You can’t perform that action at this time.