Skip to content

Instantly share code, notes, and snippets.

View rachelbaker's full-sized avatar

Rachel Baker rachelbaker

View GitHub Profile
<h2>Rachel Baker</h2>
<p>Rachel Baker (<a href="http://twitter.com/rachelbaker">@rachelbaker</a>)
is a Senior Strategic Engineer with <a href="http://10up.com">10up</a> and
an active member of the WordPress community. Rachel has lead development on
WordPress projects of all sizes including high-traffic communities and for
Fortune 500 Companies. She created the popular
<a href="http://bootstrapwp.rachelbaker.me/">BootstrapWP Theme</a> and has
been instrumental in developing the new WordPress JSON REST API coming in WordPress 4.1.</p>
@rachelbaker
rachelbaker / tax-example-response.json
Created June 2, 2014 15:20
Example response for a taxonomy for a request to GET /taxonomies/
{
"name":"Tags",
"slug":"post_tag",
"labels":{
"name":"Tags",
"singular_name":"Tag",
"search_items":"Search Tags",
"popular_items":"Popular Tags",
"all_items":"All Tags",
"parent_item":null,
function test_get_revisions_without_permission() {
$this->markTestSkipped( 'https://github.com/WP-API/WP-API/issues/251' );
$user = wp_get_current_user();
$user->add_cap( 'publish_posts', false );
// Flush capabilities, https://core.trac.wordpress.org/ticket/28374
$user->get_role_caps();
$user->update_user_level_from_caps();
$response = $this->endpoint->get_revisions( $this->post_id );

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
/**
* Retrieve a meta for a post.
*
* @uses get_post_custom()
*
* @param int $id Post ID
* @param string $key
* @return array Post meta fields and values
*/
<?php
/**
* Unit tests covering WP_JSON_Posts functionality.
*
* @package WordPress
* @subpackage JSON API
*/
class WP_Test_JSON_Post extends WP_UnitTestCase {
public function setUp() {
parent::setUp();
/* ---------------------------------------------------------------------
Modal Base JavaScript
Target Browsers: All
Author: Rachel Baker
------------------------------------------------------------------------ */
// Namespace Object
var APP = APP || {};
<?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 / homebrew-svn-fix.md
Last active December 24, 2015 14:09
Revert Homebrew Subversion to 1.7

#Revert Homebrew Subversion to 1.7

Use brew tap homebrew/versions to install Homebrew-Versions: https://github.com/Homebrew/homebrew-versions

brew install subversion17

Add to path: /usr/local/Cellar/subversion17/1.7.11

Reload bash or zsh

@rachelbaker
rachelbaker / object-storage.js
Created August 6, 2013 02:00
Extending Local Storage to save and get Objects
/**
* Extending the Local Storage Object to allow saving of objects.
*
* @param int|string key object key
* @param int|string value object value
* @return bool true|false
*/
Storage.prototype.setObject = function(key, value) {
this.setItem(key, JSON.stringify(value));
};