Skip to content

Instantly share code, notes, and snippets.

View mkormendy's full-sized avatar
🛠️
Building, fixing, making a living

Mike Kormendy mkormendy

🛠️
Building, fixing, making a living
View GitHub Profile
@mkormendy
mkormendy / domain_mapping.php
Created December 3, 2014 08:25
Wordpress MU Domain Mapping 0.5.4.3 Backup
<?php
/*
Plugin Name: WordPress MU Domain Mapping
Plugin URI: http://ocaoimh.ie/wordpress-mu-domain-mapping/
Description: Map any blog on a WordPress website to another domain.
Version: 0.5.5
Author: Donncha O Caoimh
Author URI: http://ocaoimh.ie/
*/
/* Copyright Donncha O Caoimh (http://ocaoimh.ie/)
@mkormendy
mkormendy / removehtmlcodes
Last active August 29, 2015 14:20
Regex to remove html tags and html encoded characters. From http://regexr.com/3au0j
/<[^>]*>|&.*?;/g
@mkormendy
mkormendy / gist:c9de299b997d084d59ba
Last active August 29, 2015 14:21
simple jQuery plugin to replace an element type
(function($) {
$.fn.changeElementType = function(newType) {
var attrs = {};
$.each(this[0].attributes, function(idx, attr) {
attrs[attr.nodeName] = attr.nodeValue;
});
this.replaceWith(function() {
return $("<" + newType + "/>", attrs).append($(this).contents());
@mkormendy
mkormendy / stickynav-scroll
Last active January 21, 2016 05:34
Mobile sticky nav header that scrolls with nav items that vertically extend beyond the screen length.
header {
position: fixed;
z-index: 10;
width: 100%;
padding: 0;
}
header.scroll {
height: 100vh;
overflow-y: scroll;
-- delete any usermeta specific to the other subsites
delete from wp_usermeta where meta_key regexp '^wp_([0-9]+)_';
-- duplicate the wp_usermeta structure in a working data table,
-- but add a unique index for filtering out duplicates
create table _fix_usermeta like wp_usermeta;
alter table _fix_usermeta add unique(user_id, meta_key);
-- copy the site-specific usermeta, keeping only the last of each duplicate
insert into _fix_usermeta
@mkormendy
mkormendy / WPUserTableCleanUp.sql
Last active August 29, 2015 14:26 — forked from webaware/gist:d1b51f68977d32603491
Clean up the mess left in WordPress users tables by WP e-Commerce, after you've removed that plugin from WordPress.
delete from u, um
using wp_users u
left join wp_usermeta um on um.user_id = u.ID
where u.user_login like '\_%'
@mkormendy
mkormendy / WordpressPluginSupportSearch
Last active May 26, 2016 02:41
Edit Search a Specific WordPress Plugin's Support Forums
site:wordpress.org/support/ "exact plugin name" keywords to search for
@mkormendy
mkormendy / gulpfile.js
Created September 30, 2015 22:54 — forked from mlouro/gulpfile.js
gulpfile.js with browserify, jshint, libsass, browserSync for livereload, image optimization and system notifications on errors
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var uglify = require('gulp-uglify');
var gulpif = require('gulp-if');
var exec = require('child_process').exec;
var notify = require('gulp-notify');
@mkormendy
mkormendy / Gulpfile.js
Created October 1, 2015 03:31 — forked from DESIGNfromWITHIN/Gulpfile.js
Gulpfile.js example Uses browser-sync, node-neat, gulp and gulp-sass
/*
Gulpfile.js file for the tutorial:
Using Gulp, SASS and Browser-Sync for your front end web development - DESIGNfromWITHIN
http://designfromwithin.com/blog/gulp-sass-browser-sync-front-end-dev
Steps:
1. Install gulp globally:
npm install --global gulp
@mkormendy
mkormendy / expand-collapse.js
Created October 8, 2015 20:56
Expands/Collapses section subpage lists
// expands/collapses section subpage lists
$(".pil_subMenuHeader").click( function(){
$(".submenu", this).slideToggle();
$(this).toggleClass('rotate');
});