This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /my/wordpress/location | |
sudo find . -type f -exec chmod 644 {} + | |
sudo find . -type d -exec chmod 755 {} + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir my_app_cookbook | |
cd my_app_cookbook | |
git init | |
knife cookbook create my_app -o ./ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
list.subList(offset > activityItems.size() ? activityItems.size() : offset, limit > (offset + activityItems.size()) ? activityItems.size() : offset+limit); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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())); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use the 'theirs' strategy option during a git merge | |
git merge -Xtheirs original/master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |