Skip to content

Instantly share code, notes, and snippets.


Joshua Canfield jcanfield

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.
jcanfield /
Last active Nov 27, 2020
DNS Server List for 2015/2017 (courtesy of

List of DNS Servers

'The following is a list of DNS Servers: both, Private and Public.'

DNS Servers

Why does DNS matter?

The Domain Name System (DNS) protocol is an important part of the web's infrastructure, serving as the Internet's phone book: every time you visit a website, your computer performs a DNS lookup. Complex pages often require multiple DNS lookups before they start loading, so your computer may be performing hundreds of lookups a day.

List of Public DNS Servers

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 / index.php5
Last active Jun 25, 2020
Wordpress Image Attachment Recipes > Post by which can be found at > Even though this is an older post there are a few very simple Wordpress functions and methods utilizing Post Images with-in your code.
View index.php5
* Basic display of gallery attachments
* When displaying your images via the [gallery] shortcode, WordPress will display image-links for each image in the gallery. Each of these image-links points to the image-gallery page for that particular image. The image gallery is created by the image.php template if present in your theme files. Here is a basic way to display your gallery images from within the image-gallery loop:
<a href="<?php echo wp_get_attachment_url($post->ID); ?>"><?php echo wp_get_attachment_image($post->ID, 'medium'); ?></a>
* Display the URL of the latest image attachment
* Perhaps the most useful template tag for displaying image-attachment information is wp_get_attachment_url(). This function returns a full URI for an attachment file. If no attachment is found, a value of false is returned. Here are several ways to use this tag within the loop:
jcanfield / index.html
Created Sep 4, 2012
HTML Meta Data for DublinCore and Geolocation
View index.html
<link rel="schema.DC" href="">
<link rel="schema.DCTERMS" href="">
<meta name="DC.title" content="Title of Website">
<meta name="DC.creator" content="Author">
<meta name="DC.subject" content="Subject. IE Business Type">
<meta name="DC.description" content="Complete Description of your Website">
<meta name="DC.publisher" content="Author">
<meta name="DC.contributor" content="Author and Contributors">
<meta name="DC.type" content="Text" scheme="DCTERMS.DCMIType">
<meta name="DC.format" content="text/html" scheme="DCTERMS.IMT">
jcanfield / checkserverheads.js
Created Aug 19, 2012
Check Server Headers Bookmarklet
View checkserverheads.js
// Bookmarklet by Joshua Canfield (Code Clarity --
// Using URI-Valet services
javascript:var url = prompt("Enter Domain to check Server Headers");''+ url, '_blank');
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