Skip to content

Instantly share code, notes, and snippets.

View skyebook's full-sized avatar

Skye Book skyebook

View GitHub Profile
@skyebook
skyebook / gist:5935728
Created July 5, 2013 16:38
Create Cookbook in Subdirectory
mkdir my_app_cookbook
cd my_app_cookbook
git init
knife cookbook create my_app -o ./
@skyebook
skyebook / apt-s3-installer.sh
Created May 29, 2013 16:29
This will install apt-s3
sudo apt-get install -y python-software-properties
sudo add-apt-repository ppa:businessoptics/packages
sudo apt-get update
sudo apt-get install -y apt-transport-s3
list.subList(offset > activityItems.size() ? activityItems.size() : offset, limit > (offset + activityItems.size()) ? activityItems.size() : offset+limit);
@skyebook
skyebook / gist:5006682
Created February 21, 2013 17:54
Installing MicroArmy on Ubuntu
#!/bin/sh
# This script will install the dependencies needed for MicroArmy to be installed.
sudo apt-get install build-essential python-dev libevent-dev
sudo pip install -U eventlet paramiko boto pyyaml
git clone git://github.com/j2labs/microarmy.git
@skyebook
skyebook / gist:4262228
Created December 11, 2012 21:21
WPDB::Prepare Fix for WordPress 3.5
<?php
// Old (single argument) function call
global $wpdb;
$authorIDs = $wpdb->get_col($wpdb->prepare("SELECT post_author FROM " . $wpdb->posts . " WHERE ID = " . intval($postID) . " LIMIT 1");
// New (two argument) function call
global $wpdb;
$authorIDs = $wpdb->get_col($wpdb->prepare("SELECT post_author FROM " . $wpdb->posts . " WHERE ID = " . intval($postID) . " LIMIT 1", array()));
?>
@skyebook
skyebook / gist:3701879
Created September 11, 2012 20:43
Git merge with theirs strategy
# Use the 'theirs' strategy option during a git merge
git merge -Xtheirs original/master
@skyebook
skyebook / gist:3701793
Created September 11, 2012 20:33
Migrate to new git repository and keep history
# Go to the new repository
cd /path/to/new
# Add the original repository as a remote
git remote add original /path/to/old
# Get the original's branch and merge it into yours
git fetch original/master
git merge original/master
@skyebook
skyebook / gist:3698357
Created September 11, 2012 13:12
Delete WordPress transients
DELETE FROM `wp_options` WHERE `option_name` LIKE '_transient_%'
skyebookpro:Party skyebook$ rhc app restart -a MPCParty
Password: ************
Problem reported from server. Response code was 500.
Re-run with -d for more information.
RESULT:
Node execution failure (invalid exit code from node). If the problem persists please contact Red Hat support.
skyebookpro:Party skyebook$ rhc app force-stop -a MPCParty
@skyebook
skyebook / gist:3288293
Created August 7, 2012 18:50
wp_options cleanser
<?php
/**
* Remove expired transients from the wp_options table.
* This script cycles through a number of expired transients until it doesn't find anymore.
* Our wp_options tables has over 2 million stale entries at time of writing, this limiting is really needed
* @author Skye Book
*/
$user = "";
$pass = "";