Skip to content

Instantly share code, notes, and snippets.

View rachelbaker's full-sized avatar

Rachel Baker rachelbaker

View GitHub Profile
@rachelbaker
rachelbaker / foodquery.php
Last active March 20, 2016 17:24 — forked from dianekinney/foodquery.php
Merge query for CPT and posts in a specific category
// Loop recipes and cooking posts
$recipe_args = array(
'post_type' => array( 'recipe' ),
'post_status' => 'publish',
'posts_per_page' => 4,
'fields' => 'ids', // Only fetch the post_ids here.
);
// Run the recipe query.
$recipe_query = new WP_Query( $recipe_args);
@rachelbaker
rachelbaker / send-reads-to-master.php
Created November 23, 2015 15:19 — forked from octalmage/send-reads-to-master.php
HyperDB - Send Reads to Master.
<?php
/**
* Plugin Name: Send Reads to Master
* Description: Suggested fix for backend replication lag
* Author: WP Engine
* Version: 0.2
*
*/
if ( is_admin() ) {
var r = R.player, oVol = r.volume(), tf = r._onTrackFinished, ar = r._onAudioReady;
r._onTrackFinished = function() {
return .001 !== r.volume() && (oVol = r.volume()), r.volume(.001), tf.apply(this, arguments);
};
r._onAudioReady = function() {
return r.playingAd() || r.volume(oVol), ar.apply(this, arguments);
};

Fenced code blocks inside ordered and unordered lists

  1. This is a numbered list.

  2. I'm going to include a fenced code block as part of this bullet:

    Code
    More Code
    
<?php
/**
* Iterates over results of a query, split into many queries via LIMIT and OFFSET
*/
class QueryIterator implements Iterator {
var $limit = 500;
var $query = '';
var $global_index = 0;
@rachelbaker
rachelbaker / launch_sublime_from_terminal.markdown
Created September 11, 2012 19:43 — forked from artero/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation