Skip to content

Instantly share code, notes, and snippets.

Avatar

Mark Jaquith markjaquith

View GitHub Profile
View genesis-front-page-manager-functions.php
<?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
*/
View gist:9280562
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 Aug 29, 2015
Alerts me when someone opens my office door when I'm not at home
View off-limits-when-not-home.groovy
/**
* 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 Mar 2, 2014
dotjs-zen script to make Cloudup images link to the raw image URL (for dragging, easy direct sharing, etc)
View cloudup.com.coffee
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
View keybase.md

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 Feb 22, 2015
Raw Notes from #wptybee Updates Session
View gist:dd3e5cf2bcadd888284e
<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 Mar 18, 2015
exclude post type from search
View gist:1d1c5f7e0ff502928e89
<?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;
View gist:523972
<?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 ) );
View employee-list.php
<?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 Jun 30, 2011
WordPress plugin example code to correctly set a custom number of posts to display per page, for specific types of views
View cws-posts-per-page.php
<?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 {
You can’t perform that action at this time.