This file contains 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
####################################### | |
# Operating Systems # | |
####################################### | |
# OS X | |
.DS_Store | |
._* | |
.Spotlight-V100 | |
.Trashes |
This file contains 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
# Some sensible defaults | |
Options +FollowSymLinks -Indexes | |
AddDefaultCharset UTF-8 | |
ServerSignature Off | |
# Hide sensitive information | |
RedirectMatch 404 /\.git | |
RedirectMatch 404 /*.sql | |
RedirectMatch 404 /Gruntfile.js |
This file contains 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
// Add whatever URLs you want to replace with the current home URL | |
$replace_urls = array('http://exampleoldsite.com/mysite'); | |
$uri = str_replace("{$_SERVER['DOCUMENT_ROOT']}/", '', dirname(__FILE__)); | |
$home_url = sprintf('%s://%s/%s', $_SERVER['SERVER_PORT'] == 443 ? 'https' : 'http', $_SERVER['SERVER_NAME'], $uri); | |
define('WP_SITEURL', $home_url); define('WP_HOME', $home_url); | |
function replace_old_urls($html) { global $replace_urls; return str_replace($replace_urls, WP_SITEURL, $html); } | |
ob_start('replace_old_urls'); |
This file contains 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
# To update replace line below with: hg pull && hg update | |
hg clone https://googlefontdirectory.googlecode.com/hg/ googlefonts | |
find . -name "*.ttf" -exec cp {} /Library/Fonts \; | |
fc-cache -f |
This file contains 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
# General | |
find . -type f -exec chmod 644 {} \; | |
find . -type d -exec chmod 755 {} \; | |
# Magento | |
find . -type f -exec chmod 644 {} \; | |
find . -type d -exec chmod 755 {} \; | |
chmod 550 mage # For magento 1.5+ | |
# Joomla |
This file contains 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
# OS's | |
.DS_Store | |
Desktop.ini | |
Thumbs.db | |
# Server | |
.ftpquota | |
error_log | |
cgi-bin/ | |
.htpasswd |
This file contains 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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REMOTE_ADDR} !=59.167.223.97 | |
RewriteRule ^(.*)$ 404.php [R=404,L] | |
</IfModule> |
This file contains 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
-- Delete all old post revisions | |
DELETE a,b,c FROM wp_posts a LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) | |
LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) WHERE a.post_type = 'revision'; | |
-- Cleanup weird characters | |
UPDATE wp_posts SET post_content = REPLACE(post_content, '“', '“'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, 'â€', '”'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, '’', '’'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, '‘', '‘'); |
This file contains 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
/** | |
* Automatically logs in a visitor when accessing the admin login area (/wp-login.php) | |
* | |
* @copyright Copyright (c) 2014, Jackson Cooper | |
* @license MIT | |
* | |
* Whitelist IPs: add IPs to whitelist in $ip_whitelist. If it is empty, it will allow all IPs. | |
* Username: Specify the username to login as with the "user" GET parameter (eg. ?user=admin). | |
* If the "user" get parameter is not set, $default_user_login will be used. If set | |
* to "*", it will login as the first administrator found. Otherwise it will use the |
This file contains 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
# Force the canonical www-subdomain | |
# example.com => www.example.com | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} !^www\. | |
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] | |
# Force the canonical root domain | |
# www.example.com => example.com | |
RewriteEngine On |
OlderNewer