/* | |
* Behave.js | |
* | |
* Copyright 2013, Jacob Kelley - http://jakiestfu.com/ | |
* Released under the MIT Licence | |
* http://opensource.org/licenses/MIT | |
* | |
* Github: http://github.com/jakiestfu/Behave.js/ | |
* Version: 1.5 | |
*/ |
// add this to your theme's functions.php | |
/* | |
* Define a custom option type | |
* this type will repeat some text inputs | |
*/ | |
function repeat_text_option_type( $option_name, $option, $values ){ | |
$counter = 0; |
I'm using Ubuntu 12.04 and I'm following the Debian/Ubuntu way of dealing with config files. I presume you know how to work with sudo and such | |
- Install last stable version of WordPress (in my case 3.6) with Subversion into /opt/wordpress/3.6 | |
- create a symlink /opt/wordpress/stable ==> /opt/wordpress/3.6 | |
- create a directory sites in /var/www/sites | |
- create a directory specific for your site using the domain name e.g. /var/www/sites/example.com | |
- create a directory wp-content in /var/www/sites/example.com | |
- create a directory wordpress in /etc | |
- create a directory named as you site's domain name, e.g. in /etc/wordpress | |
- copy from /opt/wordpress/stable/wp-config-sample.php to /etc/wordpress/example.com/wp-config.php |
<?php | |
/** | |
* By default, cURL sends the "Expect" header all the time which severely impacts | |
* performance. Instead, we'll send it if the body is larger than 1 mb like | |
* Guzzle does. | |
*/ | |
function add_expect_header(array $arguments) | |
{ | |
$arguments['headers']['expect'] = ''; |
<?php /* | |
************************************************************************** | |
Plugin Name: Generate Thumbnails On The Fly | |
Description: When a thumbnail image is requested of a specific width/height (rather than by name), generate it if it doesn't exist. | |
Version: 1.0.0 | |
Author: Alex Mills (Viper007Bond) | |
Author URI: http://www.viper007bond.com/ |
# Apache .htaccess | |
RedirectMatch 301 ^/wp-content/uploads/(.*) http://livewebsite.com/wp-content/uploads/$1 | |
# Nginx | |
location ~ ^/wp-content/uploads/(.*) { | |
rewrite ^/wp-content/uploads/(.*)$ http://livewebsite.com/wp-content/uploads/$1 redirect; | |
} |
Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.10 Yosemite setup recipe (as found on this gist https://gist.github.com/kevinelliott/0726211d17020a6abc1f). Note that I expect this to change significantly as I install El Capitan several times.
I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.
This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.
You are encouraged to fork this and modify it to your heart's content to match your own needs.
# Automatically instal the latest nginx | |
wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add - | |
#Make a backup copy of your current sources.list file | |
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak | |
#Now copy the following repositories to the end of ` /etc/apt/sources.list` | |
echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list | |
echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list |