Skip to content

Instantly share code, notes, and snippets.

# ------------------------------------------------------------------------
# REMOVE WWW PREFIX ------------------------------------------------------
# ------------------------------------------------------------------------
server {
server_name *.[sitename];
# remove all sub domains and www
rewrite ^/(.*)$ http://[sitename]/$1 permanent;
}
# ------------------------------------------------------------------------
# REMOVE WWW PREFIX ------------------------------------------------------
# ------------------------------------------------------------------------
server {
server_name *.[sitename];
# remove all sub domains and www
rewrite ^/(.*)$ http://[sitename]/$1 permanent;
}
@kjprince
kjprince / puppet_bootstrap.sh
Last active August 29, 2015 13:56
Bootstrap your puppet installation on a fresh box
#!/usr/bin/env bash
# Pre install script to install the a specific version of puppet
# If no parameter is supplied, the lastest version will be installed
# Thanks to: https://gist.github.com/dol/5776169
# Corresponds to Vagrantfile line
VERSION=""
if [ -n "$1" ]
then
VERSION="$1"
fi
@kjprince
kjprince / Vagrantfile
Last active August 29, 2015 13:56
Vagrantfile for bootstrapping wordpress multi-site network
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "jeter"
config.vm.box_url = "~/Downloads/debian-wheezy64.box"
@kjprince
kjprince / local-config.php
Created March 14, 2014 06:09
local-config.php for wordpress
<?php
/*
This is a sample local-config.php file
In it, you *must* include the four main database defines
You may include other settings here that you only want enabled on your local development checkouts
This file should be ignored in your .gitignore file
*/

Header 1

Overview {#overview}

Philosophy {#philosophy}

Markdown is intended to be as easy-to-read and easy-to-write as is feasible.

@kjprince
kjprince / gist:44ba9fc36de13560454f
Last active August 29, 2015 14:15
Hopewell Junction Insurance Agent http://princeagency.com
<p>This is a test to see if this strategy will work.</p>
<p>I'm going to see if I can add some inline links.</p>
<p><a href="http://princeagency.com" title="Hopewell Junction Insurance Agent" rel="follow">Hopewell Junction New York</a></p>
Verifying that +kjprince is my openname (Bitcoin username). https://onename.com/kjprince
@kjprince
kjprince / wp-bootstrap-grid
Created June 19, 2015 19:18
3 Column Bootstrap Layout WP Posts
<div class="container my-container">
<?php
$args=array(
'post_type' => 'reviews',
'post_status' => 'publish',
'posts_per_page' => 18
);
$my_query = null;
@kjprince
kjprince / Google Analytics Content Experiments code for Google Tag Manager
Created April 1, 2016 21:10
With this script you are good to go for client-site A/B/n testing with Content Experiments. Add ?var=1 to preview the variation of the A/B test.
<script src="//www.google-analytics.com/cx/api.js?experiment=YOUR_EXPERIMENT_ID"></script>
<script>
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
var varID = getParameterByName('var');
if(! varID){ var chosenVariation = cxApi.chooseVariation(); }