Skip to content

Instantly share code, notes, and snippets.

View wpsmithtwc's full-sized avatar

Travis Smith wpsmithtwc

View GitHub Profile
@wpsmithtwc
wpsmithtwc / http_get.go
Created September 10, 2016 19:24 — forked from ijt/http_get.go
Example of using http.Get in go (golang)
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
)
@wpsmithtwc
wpsmithtwc / evaluate-ad-text-line-performance.js
Created June 4, 2016 01:13 — forked from daniel-c05/evaluate-ad-text-line-performance.js
AdWords Scripts - Evaluate Ad Text Line Performance
// 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
*/
@wpsmithtwc
wpsmithtwc / amp.html
Last active June 23, 2016 14:15
AMP HTML
<amp-vimeo
data-videoid="27246366"
width="500"
height="281">
</amp-vimeo>
<amp-youtube
data-videoid="mGENRKrdoGY"
layout="responsive"
width="480" height="270">
@wpsmithtwc
wpsmithtwc / wp-config.php
Created April 25, 2016 14:53 — forked from markjaquith/wp-config.php
`wp-config.php` file to sit above a pristine WordPress directory, whereby the site can symlink their WP directory to a common one, and this file will make sure their `wp-config.php` is the one that gets called. Untested in production. Just an idea right now.
<?php
$path = str_replace( $_SERVER['DOCUMENT_ROOT'], '', dirname( $_SERVER['SCRIPT_FILENAME'] ) );
$path_parts = explode( '/', $path );
while ( count( $path_parts ) > 0 ) {
$path = $_SERVER['DOCUMENT_ROOT'] . implode( '/', $path_parts ) . '/wp-config.php';
if ( file_exists( $path ) ) {
include( $path );
break;
} else {
array_pop( $path_parts );
@wpsmithtwc
wpsmithtwc / Amazon-Linux-AMI PHP55
Created April 21, 2016 16:02 — forked from sl-digital/Amazon-Linux-AMI PHP55
Install Apache, MySQL and PHP 5.5 on Amazon Linux AMI
:: UPDATE YUM ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
sudo yum update -y
:: INSTALL WEBSERVER :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
sudo yum install httpd24
sudo service httpd start
sudo chkconfig httpd on
chkconfig --list httpd
@wpsmithtwc
wpsmithtwc / validate_conf.sh
Created March 28, 2016 19:26 — forked from psd/validate_conf.sh
use nginx to validate config
#!/bin/bash
#
# validate nginx config
#
# depends upon a symbolic link from /var/apps/redirector to dist directory
# and a build of nginx which supports real_ip and other extensions
#
# probably best to build a chroot'd tree containing a complete nginx server
# though that's a lot of work to copy in shared libraries, etc