Skip to content

Instantly share code, notes, and snippets.

View skyebook's full-sized avatar

Skye Book skyebook

View GitHub Profile
@skyebook
skyebook / push-defense.sh
Last active August 29, 2015 14:10
push-defense
#!/bin/bash
gitResult=$(git --version | grep 'git version 2.')
if [ -n "$gitResult" ]; then
# Don't push to any remotes unless a remote branch is specified
git config --global push.default nothing
mkdir -p ~/bin/git-hooks/hooks
import urllib2, urlparse, sys, webbrowser
itags = {'45': 'webm_720p',
'44': 'webm_480p',
'43': 'webm_360p',
'38': 'mp4_3072p',
'37': 'mp4_1080p',
'36': 'phone_mp4_240p',
'35': 'flv_480p',
'34': 'flv_360p',
@skyebook
skyebook / wp_permissions_reset.sh
Created July 8, 2013 16:23
Reset WordPress file and directory permissions
cd /my/wordpress/location
sudo find . -type f -exec chmod 644 {} +
sudo find . -type d -exec chmod 755 {} +
@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