Skip to content

Instantly share code, notes, and snippets.

@boborchard
boborchard / Hide Wordpress Visual Editor Elements
Last active December 23, 2015 11:49
Quickly and simply determine what elements show up in the visual editor.
<?php
/*
Plugin Name: SEO - Remove H1
Plugin URI: http://boborchard.com/plugins/seo-remove-h1-wordpress-editor/
Description: Easily remove the H1 tag from the editor within the WordPress admin for SEO purposes.
Version: 1.0.2
Author: Bob Orchard
Author URI: http://boborchard.com
*/
@boborchard
boborchard / oa-bootstrap-nav.js
Created October 16, 2013 18:10
Reformat the Online-Access Pagepilot navigation to support Bootstrap 3.0's navigation menu
function addMenuSupport($parent, level) {
// add a parent class to the ul
$parent.addClass('navbar-nav');
// fetch all the li's that are direct children of the ul
var $children = $parent.children('li');
// add a child class to the li
$children.addClass('level-'+level);
@boborchard
boborchard / 0_reuse_code.js
Created November 18, 2013 05:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@boborchard
boborchard / devise_layout_override.html.erb
Created November 21, 2013 01:12
Use a different layout for Devise User Auth than standard template
class ApplicationController < ActionController::Base
layout :layout_by_resource
def layout_by_resource
# If user isn't signed in or is on the main devise controllers, we'll use a different layout
if devise_controller? && resource_name == :user && action_name == 'new'
"devise"
else
"application"
end
@boborchard
boborchard / icalbuddyformatting_01a
Created November 21, 2013 13:57
iCalBuddy Formatting
/usr/local/bin/icalBuddy -nrd -npn -df "%A" -ps "| ~ | -- |" -eed -sd -tf "@%1I:%M %p" -n -eep notes,location,url,attendees -sed eventsToday+7 | sed -e "s/*/--/" | sed -e "s/!/!!/" | fold -s -w 88
@boborchard
boborchard / jsbgchange.html
Last active August 29, 2015 14:03
Change body background on hover
<html>
<head>
<title>Background Hover Change</title>
<!-- by @boborchard for @mantia https://twitter.com/mantia/status/488378727295098881) -->
<script language="javascript">
<!--
function changeBGC(color){
document.bgColor = color;
}
//-->

Keybase proof

I hereby claim:

  • I am boborchard on github.
  • I am boborchard (https://keybase.io/boborchard) on keybase.
  • I have a public key whose fingerprint is F5FD 3F72 68D8 29C5 0E0F FFBE 5071 6414 F6BF 09D0

To claim this, I am signing this object:

/*
Name: PSP CSS Cheatsheet
Author: Bob Orchard
*/
/* Body Classes */
.public-signup-page {} /* Both Signup and Success Pages */
.public-signup-page__signup {}
.public-signup-page__success {}
Verifying my Blockstack ID is secured with the address 1BZ2JpPXn5kCeL3RQUECg8goJuCAkw9m3s https://explorer.blockstack.org/address/1BZ2JpPXn5kCeL3RQUECg8goJuCAkw9m3s
@boborchard
boborchard / migrate.sh
Created November 25, 2019 17:38
Migrating a WordPress site using a shell script and WP-CLI
#!/bin/sh
# Unpack the payload
mkdir 'backup'
unzip '*.zip' -d backup
# Move down to the files directory for wp-cli
cd files
# Grab the credentials out of wp-config.php