Skip to content

Instantly share code, notes, and snippets.

View mkokes's full-sized avatar

Marty Kokes mkokes

View GitHub Profile
@mkokes
mkokes / httpd-vhosts.conf
Last active August 29, 2015 14:21
Virtual host config file I use for my local dev environment, in combination with dnsmasq this allows me to use folders in my OS X sites directory as individual sites.
#Simply change '%username%' to be the username for you account
<Directory "/www">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Virtualhost *:80>
@mkokes
mkokes / _opacity.scss
Last active August 29, 2015 14:23
Sass Opacity Mixin
@mixin opacity($opacity) {
opacity: $opacity;
$opacity-ie: $opacity * 100;
filter: alpha(opacity=$opacity-ie); //IE8
}
@mkokes
mkokes / viewport-height.css
Created August 12, 2015 16:32
Set the height of a div to match the current viewport, useful if the div is being used to add a background image
div {
position:fixed !important;
position:absolute;
top:0;
right:0;
bottom:0;
left:0;
}
@mkokes
mkokes / nginx.conf
Last active September 9, 2015 21:46
nginx wordpress-mu main config file. This lives in /etc/nginx/
user www-data;
worker_processes auto;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
# multi_accept on;
}
http {
@mkokes
mkokes / wp-multi.conf
Last active September 9, 2015 21:45
nginx wordpress-mu multisite specific configuration. This lives in /etc/nginx/conf.d/
error_page 404 = @wordpress;
log_not_found off;
location / {
try_files $uri $uri/ /index.php?$args;
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
@mkokes
mkokes / mainsite.conf
Last active September 9, 2015 21:44
nginx wordpress-mu site specific configuration, this lives in /etc/nginx/sites-available and is referenced in /etc/nginx/sites-enabled with a symbolic link
server {
listen 80;
server_name example.com *.example.com;
root /path-to-site-directory/;
index index.php index.html;
error_log /path-to-log-directory/error.log;
access_log /path-to-log-directory/access.log;
@mkokes
mkokes / migration.md
Last active April 12, 2017 16:12
Wordpress Standalone to Multisite Migration Strategy

Migration Strategy

Why not just use the wordpress import/export plugin?

Recently I had lovely experience of moving several large wordpress installations into a single multisite installation. Even with tweaking php/server timeout settings beyond anything safe or realistic my servers were either completely choking when doing an import/export or the process was unbearably slow to the point it just wasn't feasible. I figured rather than relying on the wordpress import/export plugin & php it would probably be orders of magnitude faster to do it manually using some SQL queuries and a little bit of rsync to get everything moved over.

Intro

This document describes the steps taken to migrate content from a wordpress standalone site into a multisite installation. In this document the multisite installation will be referred to as site A and the standalone site will be referred to as site B. This assumes that themes and plugins have been manually copied from the source server to their destination, a pass

@mkokes
mkokes / MarkdownCheatsheet.md
Created October 1, 2015 14:31 — forked from Janfy/MarkdownCheatsheet.md
Markdown Cheatsheet
@mkokes
mkokes / curl-xmlrpx-wordpress.txt
Last active October 12, 2015 17:57
Curl snippet for posting to wordpress via xmlrpc
curl -d "<?xml version=\"1.0\"?> <methodCall>
<methodName>metaWeblog.newPost</methodName>
<params>
<param><value>1</value></param>
<param> <value>%username%</value> </param>
<param> <value>%password%</value> </param>
<struct>
<member>
<name>title</name>
<value><string>Curl Test Post</string></value>