Skip to content

Instantly share code, notes, and snippets.

View mattsandersuk's full-sized avatar
🐝

Matt Sanders mattsandersuk

🐝
  • UK
View GitHub Profile
@riddochc
riddochc / jquery-tests.html
Created April 28, 2011 09:01
Jquery hiding form elements based on radio button selection
<html>
<head>
<title>JQuery tests</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
</head>
<body>
<h1>JQuery tests</h1>
<form>
@mikejolley
mikejolley / template-print-processing-orders.php
Created November 4, 2011 12:45
WooCommerce - Print Processing orders. A template page snippet to (if you are logged in as admin) output all of your orders with 'processing' status (paid) ready for printing.
<?php
/*
Template Name: Print Processing Orders :)
*/
if (!is_user_logged_in() || !current_user_can('manage_options')) wp_die('This page is private.');
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsite.com', 'http://www.newsite.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldsite.com','http://www.newsite.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldsite.com', 'http://www.newsite.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.oldsite.com', 'http://www.newsite.com');
@ericrasch
ericrasch / first-paragraph-class.php
Created March 29, 2012 21:26
WordPress: Add Class to first Paragraph in WordPress the_content; (add this to the functions.php in your Theme)
<?php
/* =BEGIN: Add Class to first Paragraph in WordPress the_content();
Source: http://webdevbits.com/wordpress/add-class-to-first-paragraph-in-wordpress-the_content/
---------------------------------------------------------------------------------------------------- */
function first_paragraph($content){
// Testing to see if the content is a Page or Custom Post Type of school, if so, display the text normally (without the class = intro).
if ( is_page() || ('school' == get_post_type() ) ) {
return preg_replace('/<p([^>]+)?>/', '<p$1>', $content, 1);
} else {
return preg_replace('/<p([^>]+)?>/', '<p$1 class="intro">', $content, 1);
@pala
pala / hack.sh
Created March 31, 2012 17:08 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@CWSpear
CWSpear / ajaxify-html5.js
Created July 8, 2012 05:16 — forked from balupton/README.md
Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo
// https://gist.github.com/3069522
;(function($, window, document, undefined) {
// Prepare our Variables
var History = window.History;
// Check to see if History.js is enabled for our Browser
if (!History.enabled) {
return false;
}
@ralphcrisostomo
ralphcrisostomo / initial.setup.mac.workflow.md
Last active December 13, 2015 20:38
My Initial Setup for Mac Workflow
@rinylo
rinylo / address-schema.html
Created July 24, 2013 12:49
Address markup for Schema.org
<div id="address" itemscope itemtype="http://schema.org/Organization">
<ul itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<li class="boldcopyright" itemprop="name">Creare Communications</li>
<li itemprop="streetAddress">Boughton Leigh House</li>
<li itemprop="addressLocality">Rugby</li>
<li itemprop="addressRegion">Warwickshire </li>
<li itemprop="postalCode">CV21 1HL</li>
</ul>
</div>
@bavington
bavington / 503.php
Created August 20, 2013 07:52
Declare a 503 Status via PHP for SEO friendly downtime.
<?php
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Retry-After: Sat, 8 Oct 2011 18:27:00 GMT'); //How long before you estimate your website will be back.
?>
<!DOCTYPE HTML>
<html>
<head>
@mattsandersuk
mattsandersuk / wordpress_snippets.php
Last active January 17, 2020 17:45
Basic Wordpress snippets
<!-- CSS -->
/*
Theme Name:
Theme URI:
Author:
Author URI:
Version: 1.0
*/
<!-- Head -->