Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
GIT_WORK_TREE=/path/to/web git checkout -f
# Attempt to load files from production if they're not in our local version
# https://stevegrunwell.com/blog/keeping-wordpress-under-version-control-with-git/
# or, option for main htaccess:
# RewriteCond /your/docroot/%{REQUEST_FILENAME} !-f
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
# Replace URL with the production site's domain name
UPDATE `wp_options`
SET `option_value` = 'a:22:{s:8:\"filepath\";s:128:\"/Users/slam_13/sites/to4/wp-content/uploads/wpallimport/uploads/d9a9d7a00a52a270a15df2eb4f515b83/xml_articles_10_14_10_40_PM.xml\";s:6:\"source\";s:214:\"a:4:{s:4:\"name\";s:31:\"xml_articles_10_14_10_40_PM.xml\";s:4:\"type\";s:6:\"upload\";s:4:\"path\";s:85:\"/wpallimport/uploads/d9a9d7a00a52a270a15df2eb4f515b83/xml_articles_10_14_10_40_PM.xml\";s:12:\"root_element\";s:3:\"row\";}\";s:9:\"feed_type\";s:0:\"\";s:15:\"update_previous\";s:1:\"3\";s:16:\"parent_import_id\";s:1:\"0\";s:5:\"xpath\";s:4:\"/row\";s:7:\"options\";s:9795:\"a:191:{s:4:\"type\";s:4:\"post\";s:21:\"is_override_post_type\";i:0;s:15:\"post_type_xpath\";s:0:\"\";s:8:\"deligate\";s:0:\"\";s:11:\"wizard_type\";s:3:\"new\";s:11:\"custom_type\";s:16:\"to4_article_post\";s:14:\"featured_delim\";s:1:\",\";s:10:\"atch_delim\";s:1:\",\";s:25:\"is_search_existing_attach\";s:1:\"0\";s:15:\"post_taxonomies\";a:2:{s:8:\"category\";s:154:\"[{\"item_id\":\"1\",\"left\":2,\"right\":5
@campaignupgrade
campaignupgrade / donation_thank_you_ga_fill.html
Last active February 27, 2017 03:54 — forked from salsalabs/donation_thank_you_ga_fill.html
Send donatoin_KEY and amount to Google Analytics (GA) from the thank you page that follows a successful donation in Salsa.
<script>
// Script to retrieve donation_KEY and amount from the URL and send
// them to Google Anaylitics eCommerce.
// See https://salsasupport.zendesk.com/entries/98811317
var m = /donation_KEY=(\d+)/.exec(window.location.search);
var donation_KEY = (m != null) ? donation_KEY = m[1] : 'Unknown';
var m = /amount=(\d+)/.exec(window.location.search);
var amount = parseFloat(window.location.href.split("amount=")[1].split('&'));
(function(i, s, o, g, r, a, m) {