Skip to content

Instantly share code, notes, and snippets.

View schutzsmith's full-sized avatar

Daniel Schutzsmith schutzsmith

View GitHub Profile
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/

Keybase proof

I hereby claim:

  • I am schutzsmith on github.
  • I am schutzsmith (https://keybase.io/schutzsmith) on keybase.
  • I have a public key whose fingerprint is C109 8607 AD05 D24F 139F 65A3 87C0 5517 5518 A2A5

To claim this, I am signing this object:

@schutzsmith
schutzsmith / custom-provision.sh
Created April 24, 2016 00:50 — forked from neilgee/custom-provision.sh
Custom VVV Variable Provisioning for WordPress sites
# #!/bin/bash
# #
# # provision.sh
# #
# # This file is specified in Vagrantfile and is loaded by Vagrant as the primary
# # provisioning script whenever the commands `vagrant up`, `vagrant provision`,
# # or `vagrant reload` are used. It provides all of the default packages and
# # configurations included with Varying Vagrant Vagrants.
# # By storing the date now, we can calculate the duration of provisioning at the
@schutzsmith
schutzsmith / gulpfile.js
Created April 16, 2016 15:42 — forked from geelen/gulpfile.js
Harp with BrowserSync! Woo!
var gulp = require('gulp');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var harp = require('harp');
/**
* Serve the Harp Site from the src directory
*/
gulp.task('serve', function () {
harp.server(__dirname + '/src', {
@schutzsmith
schutzsmith / gist:2d0ea341486af3e545b2
Last active August 29, 2015 14:21
Change Permalink Based on Custom Field
add_action('init', 'tdd_add_rewrite_rules');
function tdd_add_rewrite_rules()
{
// Register custom rewrite rules
global $wp_rewrite;
$wp_rewrite->add_rewrite_tag('%your_post_type%', '([^/]+)', 'your_post_type=');
@schutzsmith
schutzsmith / gist:e8d0b250e1291902ed26
Created May 25, 2015 14:09
Display URLs In A Printed Page
@media print {
a:after {
content: " [" attr(href) "] ";
}
}
@schutzsmith
schutzsmith / gist:136510fff6690a1328fa
Created May 25, 2015 14:08
Style Links Based on File Type
/* external links */
a[href^="http://"] {
padding-right: 13px;
background: url('external.gif') no-repeat center right;
}
/* emails */
a[href^="mailto:"] {
padding-right: 20px;
background: url('email.png') no-repeat center right;
input[type=text], textarea {
-webkit-transition: all 0.30s ease-in-out;
-moz-transition: all 0.30s ease-in-out;
-ms-transition: all 0.30s ease-in-out;
-o-transition: all 0.30s ease-in-out;
outline: none;
padding: 3px 0px 3px 3px;
margin: 5px 1px 3px 0px;
border: 1px solid #ddd;
}
tbody tr:nth-child(odd) {
background-color: #ccc;
}
@schutzsmith
schutzsmith / css-select
Created May 24, 2015 12:08
Custom Text Selection
::selection { background: #e2eae2; }
::-moz-selection { background: #e2eae2; }
::-webkit-selection { background: #e2eae2; }