Patent Trolling

NPR has a really good article on the absurd state of patents in the U.S. ” ‘We’re at a point in the state of intellectual property where existing patents probably cover every behavior that’s happening on the Internet or our mobile phones today,’ says Chris Sacca, the venture capitalist. ‘[T]he average Silicon Valley start-up or […]

Continue reading...

Passing Multi-Dimensional Arrays from WordPress to JavaScript

On its own wp_localize_script() can’t handle multi-dimensional arrays, but you can get around that by encoding the child arrays in JSON. That doesn’t handle HTML content very well, though, so another way to do it is to use the l10n_print_after parameter. That’s kind of ugly, but it seems like the best way available right now. It […]

Continue reading...

Tweaking Apache Settings for VPSs

Apache’s default settings assume it’s running under a dedicated box with at least 2GB of RAM, so they don’t perform very well in a VPS that may only have 500MB. I recently made some tweaks to several VPS’s that reduced memory usage by 300-400MB without degrading performance. Apache Performance Tuning is a good article that […]

Continue reading...

Creating an OpenVZ Template From an Existing VPS

I recently setup a VPS on a new OpenVZ node and wanted to use it as a template for future VPS’s created on that node.  The instructions in the wiki are actually overkill for this situation; here’s all I had to do: vzctl stop [vps id] Create /tmp/vz-template-exclude.txt and add these lines to it: .bash_history […]

Continue reading...

Conditionally Loading JavaScript and CSS in WordPress Plugins

Update 1/2/2013: As of WordPress 3.3, it’s now possible to call wp_enqueue_script() directly inside a shortcode callback, and the JavaScript file will be called within the document’s footer. That’s technically possible for CSS files as well, but should be considered a bad practice because outputting CSS outside the <head> tag violates W3C specs, can case FOUC, and may […]

Continue reading...