Category Archives: Programming

Software is Emo

It seems to me that people see software as simply a set of instructions to provide a result in a digital machine. This is true, but it’s not the entire picture. Software is also something that we interact with, every piece has it’s own soul. As developers of software we have to be cognizant of what kind of voice we are putting into our own code.

You almost have to consider the app as if you would consider a person for a job. Does it need to have a business tone, or maybe a fun tone. Does it need a pretty face, or does it need a face at all. But on top of all of this: you have to consider the creator of your application.

As a programmer, you’re given a set of instructions. How you carry out those instructions is dependent on many factors. Such as your skill-set, desire to work on the project, and your own personality.

This brings me to my point: I believe that choosing the right programmers for a project by their personality is almost as important as their skill-set. The voice, look and feel, it can all be prototyped by a designer and conceptualized by a lead/director/architect sure. But the guys actually writing the code are the ones bringing your app to life. There is only so much time that you can send back changes to “get it right”, and let’s face it: it’s never going to be just right if you don’t write it yourself.

Moral of the story? Don’t assume software is just someone you can pay to sit in a chair and type. These guys are responsible for the code AND the heart/soul of your app. Find dynamic and interesting folks that care about what you’re trying to accomplish, otherwise you’re going to end up with an app that leaves you feeling like you brought home the wrong baby from the hospital.

If you’re interest more in this stuff check out Aaron Walter, one of the guys working on MailChimp, http://aarronwalter.com/blog/ http://twitter.com/aarron, he’s got a lot to say about emotional software.

A better way to host multiple domains on WordPress MU/Multi-Site

What am I talking about!?

Well, there is this thing called “Multi-Site” in WordPress 3.0. You can read official docs on it here: Create a Network. It used to be called WordPress Mu or WPMU. The Multi-Site platform is MEANT to allow you to host multiple blogs on one domain via either subdirectories or subdomains like:

http://www.somesite.com/joesblog

or

http://joesblog.somesite.com

But any savvy web dev knows that this is not far from being able to host say the following on the same WordPress Multi-Site platform/install:

http://joesblog.com

and

http://samsblog.com

That’s what this guide is for: to help you “hack” WordPress to get multi-domains to work. Now you can do this with some fancy redirection plugins. But I really don’t like these because they mask/redirect a subdomain which can complicate some plugins and who knows what else. That’s why I wrote this post so you can make this work without using a redirection plugin.

This is really only for smarty-pants web developers

It’s possible that one day WordPress will move/remove this code I’m modifying. They did it in 2.9 -> 3.0 and I had to go looking for that bit of code again. Sure I’ll probably update this post if they do, but for how long? As long as I’m managing a Multi-Site I suppose. You do the math. So that said, you’re probably going to want to be smart enough to debug this if I quit the internets, or you don’t bookmark my site, or monsters eat your homework, etc..

Additionally: I haven’t ran this by ANY wordpress experts. But I’ve been running this on “old” WPMU for years, and now “new” 3.0 Multi-Site, with no issues.

This is NOT for the faint of heart!

If you have a lot of sites you’re going to want to gauge heavily on how/when to do this. However in my opinion this is a LOT less janky than all the redirect plugins. Twice I reviewed my options and both times I came up using this method. Once it’s done: it’s great.

This is also the first draft.

I literally copy/pasted this from an email I just sent and made some modifications, so it may by a little rough. I’ll try to update it if people give me feedback or I do any modifications on my end.

My method is two-part

  1. changing 1 line of php (into 2)
  2. changing the “domain name” in the db for each blog to be the real domain instead of the subdomain

Part 1

note some further info/instruction can be found here on updating to new WP versions etc.: Installing/Updating WordPress with Subversion

We check out via svn on the 3.0.1 tag (note: this is the latest version as of this posting):

$ svn co http://core.svn.wordpress.org/tags/3.0.1 .

note: don’t worry about not being able to updated to new versions like 3.1 etc all you have to do to do so is: svn switch http://core.svn.wordpress.org/tags/3.1 you can see how to do that in that wp codex article I linked

once we’re checked out, we are able to make changes to the core and be able to still update from wordpress because updating from the remote repository will trigger a merge with our locally modified code. So we don’t have to fear our slight modification ever getting overwritten.

As for the code we changed, it’s very simple. WPMU is (obviously) only setup to work on subdomains and subdirectories. So it _always_ loads the basic info from the root domain name. So we only need to make a slight modification for when it does this:

Here is the .diff patch if you don’t want to do it manually: ds_wpmu.zip

file: wp-includes/ms-load.php
line: ~141

remove this line:

$current_site->blog_id = $wpdb->get_var( $wpdb->prepare( "SELECT blog_id FROM $wpdb->blogs WHERE domain = %s AND path = %s", $current_site->domain, $current_site->path ) );

replace with these lines:

$current_site->blog_id = $wpdb->get_var( $wpdb->prepare( "SELECT blog_id FROM $wpdb->blogs WHERE domain = %s AND path = %s", $domain, $path ) );
$current_site->domain = $domain;

Part 2

Then you have to update each blog so that it’s domain name isn’t the subdomain and instead is the real domain. When I first set this up I had < 20 domain so I did it all manually, you may want to do it automagically if you already have a lot of sites via a big sql script or a mixed php/sql script or w/e your favorites are. Anyway these are the options that need to be updated in each blog:

  1. in [wp_blogs] each [domain] field (and possibly [path] if you’re using subdirectories)
  2. in each [wp_X_options] table, X being the blog’s ID the following fields:
  • siteurl
  • home
  • fileupload_url

Note: Instead you can update the domain manually in wp-admin when editing the site. You can check-box the “Update siteurl and home as well.” but it doesn’t update fileupload_url, so make sure to change tht too.

And that’s it.

Naturally these instructions come with no warranty, so don’t break your stuff, and make sure to back everything up before you do anything. I’m sure some of you are looking at me in horror, but meh, get over it.

Google Maps + IE8 Beta 1 = Epic Fail

The front-end engineers certainly have their work cut out for them with the release if IE8 on the horizon. Albeit that this IS a Beta, and the FIRST of all public Betas, but still, all my sites generally mostly work (except those using google maps).

Remember folks, this is early beta software, rendering (most likely) browser specific hacks styling, so take this with a grain of salt.

GoogleMaps-Epicfail

And embedded

GoogleMaps2-EpicFail

But wait! Not even Microsoft’s DOM based maps look good:

LiveMaps-EpicFail

Safari 3 … wtf?

So far my experience with Safari 3 (on win32) has been a very good one. By far it is the fastest Javascript implementation I’ve ever seen. On top of that it’s compatibility is very very close to FireFox 2. We’ve seen only a few issues, specifically in regards to Flash implementations.

But I’m not here to talk about what apple has done right with safari. I’m here to talk about what they did wrong, specifically the only thing that I can find that they did wrong. Lets take a look at a few screenshots of their very nice ui:

The Address Bar:

pretty blue glow

The Pretty Buttons:

glassy even

The Sweet RSS and Google-Search:

i'm feeling lucky

But… what happened HERE!?

lego-corners

Apple… anti-aliasing! Please!

am I playing police quest?!

GAH!