Skip to content

Instantly share code, notes, and snippets.

View rachelbaker's full-sized avatar

Rachel Baker rachelbaker

View GitHub Profile
@xentek
xentek / wp-unit-tests.md
Created August 26, 2012 19:06
WordPress Unit Tests Quick Start

WordPress Unit Tests Quick Start Guide

This quick start guide is geared towards installing PHPUnit on OSX in order to run the WordPress unit tests. It uses homebrew to install PHP using homebrew-php. You can likely skip this step if you've already got php and pear installed properly.

If you use MAMP, then try these instructions to use MAMP's php and pear to install PHPUnit.

install homebrew

ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
@rachelbaker
rachelbaker / matchMedia.js
Created August 24, 2012 17:38
jQuery matchMedia event handler for mobile
jQuery(document).ready(function($) {
// load touchdown resposnive nav
$('#site-navigation .menu').Touchdown();
// check window size
if (matchMedia) {
var mq = window.matchMedia("(min-width: 769px)");
mq.addListener(WidthChange);
WidthChange(mq);
}
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active April 16, 2025 07:11
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@pdewouters
pdewouters / adv-custom-fields.php
Created May 2, 2012 10:31
php export advanced custom fields
/**
* Activate Add-ons
* Here you can enter your activation codes to unlock Add-ons to use in your theme.
* Since all activation codes are multi-site licenses, you are allowed to include your key in premium themes.
* Use the commented out code to update the database with your activation code.
* You may place this code inside an IF statement that only runs on theme activation.
*/
// if(!get_option('acf_repeater_ac')) update_option('acf_repeater_ac', "xxxx-xxxx-xxxx-xxxx");
// if(!get_option('acf_options_ac')) update_option('acf_options_ac', "xxxx-xxxx-xxxx-xxxx");
// if(!get_option('acf_flexible_content_ac')) update_option('acf_flexible_content_ac', "xxxx-xxxx-xxxx-xxxx");
@nicoleslaw
nicoleslaw / 1_Tiny_Content_Framework.md
Last active January 24, 2025 16:39
Tiny Content Framework

Tiny Content Framework

About the project

This is a tiny content strategy framework focused on goals, messages, and branding. This is not a checklist. Use what you need and scrap the rest. Rewrite it or add to it. These topics should help you get to the bottom of things with clients and other people you work with.

Give me feedback on Twitter (@nicoleslaw) or by email ([email protected]).

Contents

@gcatlin
gcatlin / gist:1847248
Created February 16, 2012 19:43
Install specific version of Homebrew formula
brew update
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew install FORMULA
brew switch FORMULA VERSION
git checkout -- Library/Formula/FORMULA.rb # reset formula
## Example: Using Subversion 1.6.17
#
@rachelbaker
rachelbaker / genesis-all-posts-by-category-template.php
Created February 16, 2012 14:54
WordPress Genesis Theme Custom Archive Listing Template - All Posts by Category
<?php
/**
* Template Name: Custom Category Archive
*
*
*/
get_header(); ?>
<?php genesis_before_content_sidebar_wrap(); ?>
<div id="content-sidebar-wrap">
<?php genesis_before_content(); ?>
@xentek
xentek / httparty-xml-example.rb
Created February 7, 2012 01:57
HTTParty with XML example
require 'httparty'
response = HTTParty.get('http://www.google.com/ig/api?weather=Chicago')
data = response.parsed_response
puts data['xml_api_reply']['weather']['current_conditions']['condition']['data']
@rachelbaker
rachelbaker / wordpress-testimonial-widget.php
Created January 26, 2012 18:20
WordPress Testimonial Widget - adds custom widget to WordPress Widget Dashboard
/**
* Creating custom Testimonial Widget Area
*/
class Testimonial_Widget extends WP_Widget {
function Testimonial_Widget() {
$widget_ops = array('classname' => 'testimonial_sidebar_widget', 'description' => 'Custom Testimonial Widget' );
$this->WP_Widget('testimonial_widget', 'Testimonial Widget', $widget_ops);
}
function widget($args, $instance) {
extract($args, EXTR_SKIP);
@smlombardi
smlombardi / Railscast2.tmTheme
Created January 22, 2012 23:29
Modified version of Railscast theme for Textmate/Sublime Text 2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Railscasts 2</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>