Skip to content

Instantly share code, notes, and snippets.

Joshua Canfield jcanfield

Block or report user

Report or block jcanfield

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
jcanfield / wp-modifydb.php
Created Mar 29, 2012
Serialized PHP Search and Replace
View wp-modifydb.php
* Safe Search and Replace on Database with Serialized Data v2.0.1
* This script is to solve the problem of doing database search and replace when
* developers have only gone and used the non-relational concept of serializing
* PHP arrays into single database columns. It will search for all matching
* data on the database and change it, even if it's within a serialized PHP
* array.
View gist:dbea452188b9f93419ff352117972791 # - Netia # - Netia # - Google # - Google # - OpenDNS # - OpenDNS # - OpenDNS # - OpenDNS # #
jcanfield / index.html
Created Jul 28, 2012
DublinCore, Facebook Meta Tag and Geolocation Meta Tags (HTML5)
View index.html
<!DOCTYPE html>
<html lang="en">
<title>Lonely Women Cooks For Nobody</title>
<link rel="schema.DC" href="">
<link rel="schema.DCTERMS" href="">
<meta name="DC.title" content="Lonely Women Cooks For Nobody<">
<meta name="DC.creator" content="William Clinton (">
<meta name="DC.subject" content="Politics">
jcanfield /
Created Sep 29, 2012 Generator (Bash Script)
## Usage: gistID urlshortenedname
echo "--> Creating address for your Gist..."
curl -i -F "url=$1" \
-F "code=$2"
echo "--> Created$2 ..."
jcanfield / sources.list
Created Apr 27, 2017
Ubuntu 16.10 Sources for APT
View sources.list
# Ubuntu Sources List Generator
>>> NEWS: Now available on SSL
>>> Replace your /etc/apt/sources.list with the following one. For adding GPG keys of new repos, see instruction (if available) in the sources.list below itself.
## curl | sudo tee /etc/apt/sources.list
jcanfield / msie-vmwarefusion-osx.bash
Created Apr 3, 2013
Download the latest VMWare Fusion images from Modern.IE for Internet Explorer Testing. This bash script is primitive and simple. Anybody who would like to expand on this is more than welcome to.
View msie-vmwarefusion-osx.bash
# Download all VMWare Fusion machines from Modern.IE Website to test your Website/Web Application in Microsoft Internet Explorer on Mac OSX. All VM's and other VM's for Windows and Linux and other Virtual Manager's such as VirtualBox can be found at
# Don't have cURL or want to learn more, visit are you really a Developer? First part of that sentence comes from the MS site.
read -p "--> Downloading Internet Explorer 6-10 on Windows XP/7/8 Appliances for VMWare Fusion. Large downloads ahead. (Press Enter to continue)."
echo "--> Download Internet Explorer 6 on Microsoft Windows XP Appliance for VMWare Fusion."
curl --progress-bar -O ""
echo "--> Download Internet Explorer 8 on Microsoft Windows XP Appliance for VMWare Fusion."
jcanfield / webhook-mailer.php
Created Jun 3, 2012 — forked from boucher/webhook-mailer.php
Stripe Webhook PHP Example
View webhook-mailer.php
// 1. Customize all the settings (stripe api key, email settings, email text)
// 2. Put this code somewhere where it's accessible by a URL on your server.
// 3. Add the URL of that location to the settings at
// 4. Have fun!
// set your secret key: remember to change this to your live secret key in production
// see your keys here
jcanfield / cache.htaccess
Created Aug 10, 2012 — forked from kurtpayne/cache.htaccess
.htaccess caching rules
View cache.htaccess
<IfModule mod_mime.c>
# Text
AddType text/css .css
AddType application/x-javascript .js
AddType text/html .html .htm
AddType text/richtext .rtf .rtx
AddType text/plain .txt
AddType text/xml .xml
jcanfield / gist:4522839
Created Jan 13, 2013
htaccess Configuration for Wordpress (Developed for a client project and utilizes Caching, Correct Timezones, ETAG Configuration, Compression and Basic Rewrites.
View gist:4522839
# .htaccess for
# By Joshua Canfield (Code Clarity)
# Features include Page Caching by FilesMatch, mod_expires & mod_header. Also uses old website 301 Redirections
# Sets Timezone to Mountain
SetEnv TZ America/Denver
# Turn on Expires and set default to 0
ExpiresActive On
ExpiresDefault A0
jcanfield / 404.html
Created Oct 11, 2012
404 Not Found Template (via and Modified)
View 404.html
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>404 Error</title>
::-moz-selection { background: #fe57a1; color: #fff; text-shadow: none; }
::selection { background: #fe57a1; color: #fff; text-shadow: none; }
html { padding: 30px 10px; font-size: 20px; line-height: 1.4; color: #737373; background: #f0f0f0; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
html, input { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
You can’t perform that action at this time.