A sandwich. A good one.

White Paper Bag

What’s inside?

While in Burlington, Vermont, I worked at the excellent Office Squared downtown coworking space. Some days I had to go out for lunch. That one burrito place on Church Street was unworthy of mention. My next try was Top of the Block Sandwich Shoppe. Here I found my usual.

My first time there, I was overwhelmed by the endless options on the sandwich menu. I didn’t want to spend half my lunch break studying a food list. So I simply asked for a sandwich. Any sandwich would do, I said, as long as it’s good. No, I don’t have any food allergies or restrictions. Just make it a sandwich, not a wrap. Surprise me.

This intrigued the young ladies behind the counter. The lucky one who got to make my sandwich was thrilled by the possibilities. She could make whatever she fancied and I would probably love it. The others kept an eye on the project, jealous of her creative opportunity.

I took my sandwich back to the office and I loved it. The bread, the special mayo, the juicy meat and unconventional mix of veggies. This was a unique sandwich made by a person whose curiosity and passion had been aroused by a simple, open-minded request: make me a sandwich. A good one.

Each week I went back once or twice for a new sandwich. Each visit brought smiles to the faces behind the counter. Each sandwich was better than my memory of the last.

By the third visit I didn’t have to speak my order. My request was so memorable that I was an instant regular. I am the guy who wants a random sandwich. Surprise me.

My surprise sandwich was the most consistently pleasurable lunch outside of my home. For the same price everyone else paid for their made-to-order sandwich I got joy, suspense, and possibly the best sandwich made that day.

When ordering a sandwich what I really want is two slices of bread surrounding something good. Turkey, peppers, mustard, none of the above, whatever. Maybe not every sandwich maker has the passion or the sense of humor to do it right like Top of the Block. Maybe I’d be unhappy with the “surprise item” from most other places. I’m happy I found these professionals and took that chance.

WCSF 2011 Voodoo

Rarst asks: what magic turns pretty permalinks into query variables?

The setup:

The magic:

foreach ( $rewrite as $match => $query ) {
	if ( preg_match("#^$match#", $request_match, $matches) ) {
		// Got a match.
		$this->matched_rule = $match;
		break;
	}
}

The real voodoo is in creating the rewrite rules. Example: bbPress

  • register_post_types
  • register_taxonomies
  • add_rewrite_tags
  • generate_rewrite_rules

Exercise: optimize parse_request by restructuring the rules into a tree.

Nacin suggests: wp-hackers Skip Main Query

  • the grand scheme of things (png, blog post)
  • $wp->init()
  • class freshlypressed_wp extends wp
  • wp() calls $wp->main()
  • $wp->main() calls $this->parse_request()
  • $this is a freshlypressed_wp

Problems:

  • Can’t extend a variable class (class my_wp extends $wp_class)
  • No pluggable inheritance chaining
  • No way for several plugins to cooperatively extend a class

Winter irony. Snowmen after two months i

Winter irony. Snowmen after two months in Vermont: zero. Snowmen after one day in Texas: three. Pic or it didn’t happen: http://wp.me/m2v-5F

Subconscious urge: the most valuable com

Subconscious urge: the most valuable commodity in the world. People kill for them. Control yours, control you; control theirs, control them.

I got a Manitoba CD last year at Waterlo

I got a Manitoba CD last year at Waterloo. I know nothing about them but I love them in my Coding playlist. Listen: http://tr.im/manitobakid

Follow

Get every new post delivered to your Inbox.

Join 1,657 other followers