Skip to content

Instantly share code, notes, and snippets.

There are three options (that I know of) for automatically enabling a plugin in new sites.

  1. Move the plugin from wp-content/plugins/ to wp-content/mu-plugins/ (MU = Must Use). But then it cannot be deactivated for any site.

  2. Click Network Activate instead of Activate to enable it for all sites. I didn't want to use this though because I didn't want to affect existing sites. Also I couldn't work out how to deactivate it for some sites (although I've read this should be possible).

  3. Write a plugin (in wp-content/mu-plugins/) with a hook that activates the plugin at creation time. This way it only affects new blogs, can be deactivated easily, and I can also set the default configuration at the same time.

@quickredfox
quickredfox / split-graphemes.js
Created March 4, 2013 19:40
Split a javascript utf-16 string into an array of graphemes.
var splitGraphemes = function( string ) {
var matches = string.match( /([A-Z]{1})|([^A-Z]{2})|([^A-Z]{1})/gi );
if( !matches) return [];
return Array.prototype.slice.call( matches );
}
@quickredfox
quickredfox / how-to-use.md
Last active December 13, 2015 17:38
How to explore a new human user interface, for the sighted individuals. ( AKA: Over-intellectualizations of @quickredfox intended for a fictional end user audience )

How to explore a new human user interface, for the sighted individuals.

  1. Find it's interaction points: We tend to be "tricked" by visual configurations as to where we draw our attention first. In the case of an example farm machine, dangerous and important buttons and levers would be big, red and solid. Less important functions are usually hidden in a panel somewhere under/over a dashboard of other functions. Make a thorough observation of these interaction points, looking beyond their visual representation.

  2. Determine the central area of operation: In a website, this would be where the main content should be. On a lawnmower this would be the area where the grass cutting is done. Also notice any visual guides around that are meant to help you focus towards this area.

  3. Understand the purpose of the whole: Sometimes, advertisements will make it really impossible to even come close to grasping what the whole is about, not just on websites. Even worse, some human interfaces only reveal themselves w

@quickredfox
quickredfox / lurn-pianos.md
Last active December 12, 2015 03:59
How I plan to learn the piano. In 6 steps.

HOW I PLAN TO LEARN THE PIANO IN 6 STEPS™

UPDATE: So far, a lot of this is working. I'm noticing slight improvements in math skills, it's opened up mental pathways in my programmer's brain and I am not afraid of a piano any more, I can already pretend I know a few things. (In just 2 weeks mind you)

  1. Classical is too hard, you have to repeatedly practice boring crap until you either die or decide you suck… unless you're a prodigy which I'm not.
  2. What's easy to learn is a pentatonic scale. Only 5 notes to worry about, they pretty much sound good whichever way you combine them and you can hack some fake jazz, blues, soul, gospel and folk for only 5 notes. Man, that's a bargain!
  3. I figure by the time I achieve reasonable comfort with the pentatonic scale in C, I can move on to the next one (D) and the next one until I've got the whole pentatonic alphabet.
  4. At this point, I should be happy with my right hand, time to work the left. So I turn off the lights...
  5. ...because I'm calmer in the dark and for
@quickredfox
quickredfox / simpless.less
Last active December 11, 2015 23:48
Rant on grid systems. Talking to myself mostly.
/* The World's simplest semantic 960px 12 col. CSS grid system in LESS. */
@full: 960;
/* That's it! That's the whole framework. */
/*
Usage Example:
<div class="container">
@quickredfox
quickredfox / grid-system.less
Created January 23, 2013 19:31
World's smallest .LESS grid system.
@full:960;
@half:480;
@third:320;
@fourth:240;
@eighth:120;
@quickredfox
quickredfox / perlincanvas.js
Created December 9, 2012 17:36 — forked from donpark/perlincanvas.js
Rendering Perlin Noise Fast to HTML5 Canvas
/* Following canvas-based Perlin generation code originates from
* iron_wallaby's code at: http://www.ozoneasylum.com/30982
*/
function randomNoise(canvas, x, y, width, height, alpha) {
x = x || 0;
y = y || 0;
width = width || canvas.width;
height = height || canvas.height;
alpha = alpha || 255;
var g = canvas.getContext("2d"),
@quickredfox
quickredfox / express-stylus.html
Created December 4, 2012 22:56 — forked from bentruyman/express-stylus.html
Using Stylus Middleware with Express
<!doctype html>
<html lang="en">
<head>
<title>My Web Page</title>
<meta charset="utf-8">
<link href="/stylesheets/main.css" rel="stylesheet">
</head>
<body>
</body>
</html>
@quickredfox
quickredfox / app.js
Created December 4, 2012 22:55 — forked from marlun/app.js
Using stylus with Express.js
/**
* Module dependencies.
*/
var express = require('express')
, stylus = require('stylus');
var app = express.createServer();
// This must be BEFORE other app.use
@quickredfox
quickredfox / color-codes.md
Created October 30, 2012 16:37
Initial Design Specs.

Need HEX color codes for:

Hero Unit

  • Yellow text: #fde46e

Badges

Orange