Magic of Travel
[flickr]7834042890[/flickr]
The magic of getting on an airplane, waiting two hours, and then exiting in a completely different world still feels special.
[flickr]7834042890[/flickr]
The magic of getting on an airplane, waiting two hours, and then exiting in a completely different world still feels special.
The website I made for Rachel and myself is, of course, run on WordPress. After looking through some themes, I eventually settled on the Forever theme. Forever is a WordPress.com theme, but can be downloaded via SVN from
https://wpcom-themes.svn.automattic.com/forever/1 so someone can use it on a self-hosted WordPress installation. Everything was going great, but I couldn’t find the plugin for this really neat widget they have that counts down to The Big Day:

It’s called Milestone and as of January 2012 it was supposed to be included in a future release of Jetpack, the official WordPress plugin for things of that nature.
But here we are in August and there’s no plugin.
And I don’t know what the timeline is for actually releasing it.
So I did what any engineer would do when they don’t want to wait, I made my own version. There’s decent enough documentation on the backend and the front end is just stylized with CSS. It’s a pretty simple implementation and only took a few hours to crank out. There are some more things I want to add and tweak, like adding a drop down calendar select and better input checking, but it will work for now.
Here’s how it looks:

It’s a quick solution that I hope others will enjoy too. I also got a chance to try out using a deploy script to help automate the push from GitHub to SVN. This could help a lot of things go smother.
svn co http://wordpress.org/extend/plugins/milestone/ ↩
The Blue Angels are back in town! Yesterday, I got to see them take off from the flight line (one of the many job perks). Today I went out with Rachel and took pictures using the Nikon 600mm f4.0D AF-S II VR that I rented yesterday. The thing is a beast:


I got some pretty good shots, but I think there’s a lot of atmospheric crap in the way (i.e. all the air, dust, pollen, etc between my lens and the air planes). I’m not sure what I’m going to do about that, but I’m definitely going to try again tomorrow.
Update: Another picture Jake took, going for the “Rear Window” look…

“Money is one of those things that’s completely familiar and completely mysterious” – James Surowiecki, “The Financial Page” column for The New Yorker.
With that thought in mind, here are two well presented posts on money and its history, found via Kotte. The first post is reply on reddit in response to someone wondering where all the money in the world has gone. The result is an enlightening walk-through of how we got to money and what money is.
It’s hard to explain this to a five-year-old, because there are some fairly abstract concepts involved, but here goes…
All actual “money” is debt. All of it, including monetary gold, etc. (Don’t argue with me yet, I’ll get to that.)
Imagine a pretend world with no money, some kind of primitive villiage or something. Now let’s invent paper money. You can’t just print a bunch of paper that says people have to give you stuff, because nobody would honor it. But you could print IOUs. Let’s walk through this…
- Let’s say you’re an apple-farmer and I’m a hunter. You want some meat but haven’t harvested your crops yet. You say to me, “hey, go hunt me some meat and I’ll give you 1/10th of my apple harvest in the fall”. Fair enough, I give you meat, you owe me apples. There’s probably a lot of this kind of stuff going on, in addition to normal barter. In time, standard “prices” start to emerge: a deer haunch is worth a bushel of apples, or whatever.
The second article comes from one of my favorite magazines, IEEE Spectrum1, by way of the afore quoted James Surowiecki who gives a brief history of money and some of its effects:
Money’s decline in feudal times is worth noting for what it reveals about money’s essential nature. For one thing, money is impersonal. With it, you can cut a deal with, say, a guy named Jeff Bezos, whom you don’t know and will probably never meet–and that’s okay. As long as your money and his products are good, you two can do business. Similarly, money fosters a curious kind of equality: As long as you have sufficient cash, all doors are open to you. Finally, money seems to encourage people to value things solely in terms of their market value, to reduce their worth to a single number.”©
These characteristics make money invaluable to modern financial systems: They encourage trade and the division of labor, they reduce transaction costs–that is, the cost incurred in executing an economic exchange–and they make economies more efficient and productive. These same qualities, though, are why money tends to corrode traditional social orders, and why it is commonly believed that when money enters the picture, economic relationships trump all other kinds.”©
It’s unsurprising, then, that feudal lords had little use for the stuff. In their world, maintaining the social hierarchy was far more important than economic growth (or, for that matter, economic freedom or social mobility). The widespread use of money, with its impersonal transactions, its equalizing effect, and its calculated values, would have upended that order.”©
Both of these articles got me thinking about an episode of NPR’s Planet Money I listened to a while back on why we use gold as a de facto base unit of currency. It boils down to this: of all the basic elements on the periodic table that meet these basic requirements:
…gold is the element that fits the bill best.
Fair Disclosure: I am a member of IEEE ↩
I was working on a project for a client that requested using shortcodes in the_excerpt:
Displays the excerpt of the current post with […] at the end, which is not a “read more” link. If you do not provide an explicit excerpt to a post (in the post editor’s optional excerpt field), it will display an automatic excerpt which refers to the first 55 words of the post’s content. Also in the latter case, HTML tags and graphics are stripped from the excerpt’s content. This tag must be within The Loop.
You’ve probably encountered this functionality when you’ve done a search on a WordPress site or viewed an archive, the post will often end in “…”
From a programming standpoint, there was a point in time where if you wanted to have shortcodes used in an excerpt for WordPress, all you had to do what include this in your code1
add_filter( 'the_excerpt', 'do_shortcode');
However, I found out that at some point in the last few years since I tested the above system, the way in which WordPress process shortcodes has changed. I poked around a little bit in the WordPress TRAC, but didn’t see anything that would explain it. I suspect it might be a filter order, but I’m not sure and I decided that investigating the root cause at this point wouldn’t make a difference (although I would like to find out eventually).
Here’s what I learned and how I solved the problem.
When you have not provided an explicit excerpt, WordPress creates one via wp_trim_excerpt2:
function wp_trim_excerpt($text = '') {
$raw_excerpt = $text;
if ( '' == $text ) {
$text = get_the_content('');
$text = strip_shortcodes( $text );
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]>', $text);
$excerpt_length = apply_filters('excerpt_length', 55);
$excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');
$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
}
return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);
}
The way wp_trim_excerpt gets called is not super intuitive, but looks like this:
the_excerpt3 calls get_the_excerpt4 via filter hook
wp_trim_excerpt is hooked into get_the_excerpt via a filter hook defined in /wp-includes/default-filters.php5
A quick glance at the code for wp_trim_excerpt reveals that strip_shortcodes is run immediately after getting the content of the post. Also, there is really no way to filter this out easily unless you rewrite the entire function, which is what I did:
remove_filter( 'get_the_excerpt', 'wp_trim_excerpt' ); //Remove the filter we don't want
add_filter( 'get_the_excerpt', 'fergcorp_wp_trim_excerpt' ) ); //Add the modified filter
add_filter( 'the_excerpt', 'do_shortcode' ); //Make sure shortcodes get processed
//Copy and paste from /wp-includes/formatting.php:2096
function fergcorp_wp_trim_excerpt($text = '') {
$raw_excerpt = $text;
if ( '' == $text ) {
$text = get_the_content('');
//$text = strip_shortcodes( $text ); //Comment out the part we don't want
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]>', $text);
$excerpt_length = apply_filters('excerpt_length', 55);
$excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');
$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
}
return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);
}
So there’s the solution. It’s definitely a bit longer than the way it used to work, but it should do just fine.
“Triple salchow!”
Note of Business: I’m testing out a new way of displaying pictures. Typically, I upload photos to Flickr and then include them here on the blog. It’s a time intensive processes that involves multiple steps, multiple applications, and lots of labor. I’ve eliminated some steps by designing a plugin that takes the Flickr Picture ID and grabs the photos and all the relevant stats, but it still requires that I copy and paste every single Flickr Picture ID I want displayed here.
This method was originally born Back In The Day™1 when WordPress didn’t have nearly as good as a media management system as it does now. Granted, I still think that WordPress has some work to do; but it’s getting there. If you have any thoughts, let me know. For comparison, see An Atkins Wedding!
circa 2005 ↩
I’ve been moving around some of the technological assets under my control. I completed a Registrar switch in May. I’ve been working the last month to move servers. I’m still with BlueHost because they are great, I just moved to a box with fewer people on it (i.e. less resources to share). I also get my very own IP address and SSL certificate!
I just completed the switch of AFdN (which was the last asset on the old server) this afternoon. Everything should be okay, but if not, please let me know.
For those interested, here’s what I did (over SSH from the new server):
ssh old_server.com 'cd ~/www/; mysqldump -u username -p mysql_wp > dump.sql;' rsync -av --exclude 'notthisfolder' -e ssh old_server.com:~/www/ ~/www/. mysql -u username_new -p mysql_wp < ~/www/dump.sql rm ~/www/dump.sql
Some resources I used:
Two comments from Sir James Dyson that resonate with me:
I don’t mind failure. I’ve always thought that schoolchildren should be marked by the number of failures they’ve had. The child who tries strange things and experiences lots of failures to get there is probably more creative.
We’re taught to do things the right way. But if you want to discover something that other people haven’t, you need to do things the wrong way. Initiate a failure by doing something that’s very silly, unthinkable, naughty, dangerous. Watching why that fails can take you on a completely different path. It’s exciting, actually. To me, solving problems is a bit like a drug. You’re on it, and you can’t get off. I spent seven years on our washing machine [which has two drums, instead of one].
In general, I don’t think we (as society) appreciate and accept failure as much as we should, or maybe we just mislabel them (i.e. call things failures that should be called something else).
Learning how (and when) to fail gracefully and with pride (instead of shame) has been a tough element to learn. However, I’ve found that being okay with failing has lots rewards that make me a happier person, in particular because I’m not as anxious anymore.
Whenever I help friends and family buy a new camera, they almost always turn to pixels as the dominating trade point. The reality is, that’s probably not the most appropriate measure of “bestness” and here’s why:
The metric most often used by camera manufacturers and marketers to tout their products has been pixel count. That’s a shame, but it was probably inevitable — it’s easy to measure, and consumers are used to the idea that more is better. However, the number of pixels is a measure of quantity, not quality.
This is a great article explaining in a mostly non-technical way why pixels aren’t all they’re cracked up to be.
Case in point: I can (and have) print a 30″ x 20″ from my eight-year-old 6.1 MP Nikon D70 that look great because it has a 23.7 mm × 15.6 mm1 sensor. If I were to print a picture at the same size using my year-old iPhone 4S with its 8 MP 4.54 mm x 3.42 mm2 sensor, it would look very noisy.