Skip to content

Instantly share code, notes, and snippets.

View markjaquith's full-sized avatar

Mark Jaquith markjaquith

View GitHub Profile
<?php
/**
* Genesis Front Page Manager
*
* @package Genesis_Front_Page_Manager
* @author Brad Potter
* @license GPL-2.0+
* @link http://www.bradpotter.com/plugins/genesis-front-page-manager
* @copyright Copyright (c) 2014, Brad Potter
*/
Hey. Crazy kids. This probably needs to be that one event where you sort of realize: "Oh. Shit. Other people...like...use this & stuff. We need a damn road map and a release schedule. Stop smoking dabs all day, breh."
Now is also a great time to learn how to think about the potential ramifications a production push will have prior to making said production push. And, if your change might impact some or perhaps even all of the other people who use your technology, then some degree of coordination - perhaps an email? - would be nice. It's one of those things that will help make you look professional. I suck at professionalism. You have no idea. But, even I know this much.
Because, right now, I sort of feel like I'm asking some very rightfully fearful people to consider entrusting perhaps their actual career into the development of technology they need to succeed and thrive. And, I just started recommending Node.js - with a caveat - that npm basically sucks. I hate having to do that and it needs to stop.
So, h
@markjaquith
markjaquith / off-limits-when-not-home.groovy
Last active August 29, 2015 13:56
Alerts me when someone opens my office door when I'm not at home
/**
* My office is off-limits when I am gone
*
* Author: Mark Jaquith
* Date: 2014-03-01
*/
preferences {
section("Monitor this door") {
input "door", "capability.contactSensor"
@markjaquith
markjaquith / cloudup.com.coffee
Created March 2, 2014 18:48
dotjs-zen script to make Cloudup images link to the raw image URL (for dragging, easy direct sharing, etc)
require 'jqueryify'
jQuery ($) ->
waitForImgLoad = ->
collection = $ '.collection-item.complete.loaded'
if collection.length
img = $ '.img-wrapper img', collection
if img.length
return img.each (n,i) ->
$i = $ i

Keybase proof

I hereby claim:

  • I am markjaquith on github.
  • I am markjaquith (https://keybase.io/markjaquith) on keybase.
  • I have a public key whose fingerprint is 6537 F2DF 3921 E11E 46C5 D6B7 56AD 3A85 0F62 922E

To claim this, I am signing this object:

@markjaquith
markjaquith / gist:dd3e5cf2bcadd888284e
Created February 22, 2015 23:17
Raw Notes from #wptybee Updates Session
<h1 id="updatesinyourface">Updates in your Face</h1>
<h2 id="farfuture">Far Future</h2>
<ul>
<li>Make updates as smooth and magical and graceful as possible</li>
<li>Continuous releases</li>
<li>Move from shrinkwrap to more agile, continuous development</li>
<li>Perhaps a direction, not a goal</li>
<li>People hate change, and they hate change they didn’t opt in to</li>
<li>Language pack Plugins, Core, Themes, in that order?</li>
</ul>
@markjaquith
markjaquith / gist:1d1c5f7e0ff502928e89
Created March 18, 2015 20:28
exclude post type from search
<?php
add_action( 'parse_query', 'gws_exclude_from_search' );
function gws_exclude_from_search( $q ) {
$exclude_from_search = array( 'gallery-entries' );
if ( $q->is_search ) {
foreach ( $exclude_from_search as $post_type ) {
$post_type_object = get_post_type_object( $post_type );
$post_type_object->exclude_from_search = true;
<?php
function gigaom_script_slug_swap( $pairs ) {
global $wpdb;
foreach ( $pairs as $pair ) {
$_temp_name = $pair[0] . '-gigaom-temp-123456789';
$slugs = "'" . implode( "', '", $pair ) . "'";
$ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' AND post_name IN( $slugs ) LIMIT 2" );
$wpdb->update( $wpdb->posts, array( 'post_name' => $_temp_name ), array( 'post_status' => 'publish', 'post_type' => 'post', 'post_name' => $pair[0] ) );
$wpdb->update( $wpdb->posts, array( 'post_name' => $pair[0] ), array( 'post_status' => 'publish', 'post_type' => 'post', 'post_name' => $pair[1] ) );
$wpdb->update( $wpdb->posts, array( 'post_name' => $pair[1] ), array( 'post_status' => 'publish', 'post_type' => 'post', 'post_name' => $_temp_name ) );
<?php
/*
Plugin Name: Employee List
Description: Leverages an existing "employee" custom post type to create a shortcode for a list of employees
Version: 0.1
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
function tampa_employee_list() {
@markjaquith
markjaquith / cws-posts-per-page.php
Created June 30, 2011 20:21
WordPress plugin example code to correctly set a custom number of posts to display per page, for specific types of views
<?php
/*
Plugin Name: CWS Posts Per Page
Version: 0.1
Description: Sets a custom number of posts to display per page, for specific types of views
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
class CWS_Posts_Per_Page_Plugin {