Skip to content

Instantly share code, notes, and snippets.

View markjaquith's full-sized avatar

Mark Jaquith markjaquith

View GitHub Profile
@markjaquith
markjaquith / README.md
Created August 16, 2011 19:33
TLC Transients — On the fly WordPress transients with soft expiration and one-liner chained syntax.
@markjaquith
markjaquith / gist:1291960
Created October 17, 2011 04:55
Siri queries

The following are useful queries that Apple's Siri has successfully answered, or tasks it has completed

Location and Directions

  • Where am I?
  • Where is my wife?
  • Show me {city, state}
  • Show me {street address, city, state}
  • Where is the closest {business name | business type}?
  • Show me {business name | business type} in {city, state}
  • Give me directions to {contact}'s {home | house | work}
@markjaquith
markjaquith / lists.php
Created December 7, 2011 21:18 — forked from trepmal/lists.php
WordPress: Testing bulleted and numbered lists
<?php
//Plugin Name: Bulleted Lists
new Bulleted_List();
class Bulleted_List {
function __construct() {
@markjaquith
markjaquith / no-howdy.php
Created December 25, 2011 04:16
Removes "Howdy" from the WordPress 3.3 toolbar
<?php
/*
Plugin Name: No Howdy
Description: Removes "Howdy, " from the toolbar
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
@markjaquith
markjaquith / login-logo-custom-css.php
Created January 15, 2012 01:30
Login form CSS customization
<?php
/*
Plugin Name: Login Logo Custom CSS
Description: Custom CSS for the login screen
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
@markjaquith
markjaquith / moderation-buddy.php
Created January 17, 2012 10:12
Moderation Buddy
<?php
/*
Plugin Name: Moderation Buddy
Description: A friendly assistent to make sure you don't get behind on your comment moderation tasks.
Version: 0.1
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
class CWS_Moderation_Buddy_Plugin {
@markjaquith
markjaquith / gist:1645537
Created January 20, 2012 05:44
CWS_Plugin — Exploratory WordPress plugin parent class
<?php
if ( !class_exists( 'CWS_Plugin_v2' ) ) :
class CWS_Plugin_v2 {
public function hook( $hook ) {
$priority = 10;
$method = $this->sanitize_method( $hook );
$args = func_get_args();
unset( $args[0] );
foreach ( (array) $args as $arg ) {
if ( is_int( $arg ) )
@markjaquith
markjaquith / plugindiff.rb
Created July 13, 2012 22:15
Run this from a WordPress plugin SVN checkout to see what has changed in trunk vs your stable tag
#!/usr/bin/ruby
# NOTE: uses local diffs (MUCH faster). So make sure you've `svn up`d.
path = `svn info`[/Working Copy Root Path: (.*)\n/, 1]
stable_tag = nil
File.open path + '/trunk/readme.txt', 'r' do |file|
while line = file.gets
break if stable_tag = line[/stable tag: ?(.*)\n/i, 1]
end
end
@markjaquith
markjaquith / gist:4219135
Last active October 13, 2015 15:48
Script for applying WordPress patches. Provide an ID (prompts you to select patch), a Trac patch URL, or a raw Trac patch URL
#!/usr/bin/ruby
#
# The MIT License (MIT)
# Copyright (c) 2013 Mark Jaquith
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@markjaquith
markjaquith / gist:4269587
Created December 12, 2012 17:04
WordPress plugin that prevents the "New WordPress Site" e-mail from being sent out
<?php
/*
Plugin Name: No "New WordPress Site" E-mail
Description: Prevents the "New WordPress Site" e-mail from being sent out
Version: 0.1
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
class CWS_No_New_WordPress_Site_Email {