Skip to content

Instantly share code, notes, and snippets.

Avatar

Joshua Canfield jcanfield

View GitHub Profile
@jcanfield
jcanfield / wp-modifydb.php
Created Mar 29, 2012
Serialized PHP Search and Replace
View wp-modifydb.php
<?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
jcanfield / dns-servers_updated-2017.md
Last active Nov 27, 2020
DNS Server List for 2015/2017 (courtesy of http://sos.smerwick.com.tw)
View dns-servers_updated-2017.md

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
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
#!/bin/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 http://modern.ie/
# Don't have cURL or want to learn more, visit http://curl.haxx.se/.. 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 "http://virtualization.modern.ie/vhd/IEKitV1_Final/VMWare_Fusion/IE6_XP/IE6.XP.For.MacVMware.sfx"
echo "--> Download Internet Explorer 8 on Microsoft Windows XP Appliance for VMWare Fusion."
@jcanfield
jcanfield / index.php5
Last active Jun 25, 2020
Wordpress Image Attachment Recipes > Post by DigWP.com which can be found at http://digwp.com/2009/08/awesome-image-attachment-recipes-for-wordpress/. > 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
jcanfield / index.html
Created Sep 4, 2012
HTML Meta Data for DublinCore and Geolocation
View index.html
<link rel="schema.DC" href="http://purl.org/dc/elements/1.1/">
<link rel="schema.DCTERMS" href="http://purl.org/dc/terms/">
<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
jcanfield / checkserverheads.js
Created Aug 19, 2012
Check Server Headers Bookmarklet
View checkserverheads.js
// Bookmarklet by Joshua Canfield (Code Clarity -- www.icodeclarity.com)
// Using URI-Valet services
javascript:var url = prompt("Enter Domain to check Server Headers");window.open('http://urivalet.com/?'+ url, '_blank');
View gist:dbea452188b9f93419ff352117972791
195.114.173.153 # ns1.internetia.pl - Netia
195.116.55.69 # ns2.internetia.pl - Netia
8.8.8.8 # google-public-dns-a.google.com - Google
8.8.4.4 # google-public-dns-b.google.com - Google
208.67.222.222 # resolver1.opendns.com - OpenDNS
208.67.220.220 # resolver2.opendns.com - OpenDNS
208.67.222.220 # resolver3.opendns.com - OpenDNS
208.67.220.222 # resolver4.opendns.com - OpenDNS
149.156.1.3 # nms.cyf-kr.edu.pl
149.156.4.11 # info.cyf-kr.edu.pl
@jcanfield
jcanfield / index.html
Created Jul 28, 2012
DublinCore, Facebook Meta Tag and Geolocation Meta Tags (HTML5)
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Lonely Women Cooks For Nobody</title>
<link rel="schema.DC" href="http://purl.org/dc/elements/1.1/">
<link rel="schema.DCTERMS" href="http://purl.org/dc/terms/">
<meta name="DC.title" content="Lonely Women Cooks For Nobody<">
<meta name="DC.creator" content="William Clinton (http://www.man-has-his-needs.com/">
<meta name="DC.subject" content="Politics">
@jcanfield
jcanfield / gistrepo-shorten.sh
Created Sep 29, 2012
Git.io Generator (Bash Script)
View gistrepo-shorten.sh
#!/bin/bash
##
## Usage: gist-shorten.sh gistID urlshortenedname
echo "--> Creating git.io address for your Gist..."
curl -i http://git.io -F "url=https://gist.github.com/$1" \
-F "code=$2"
echo "--> Created http://git.io/$2 ..."
@jcanfield
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 https://repogen.simplylinux.ch/txt/yakkety/sources_dccbf34a40895c1d9b7a7e7d24ee21dbbbccc385.txt | sudo tee /etc/apt/sources.list
#------------------------------------------------------------------------------#
# OFFICIAL UBUNTU REPOS #