Posting Source Code
Here at Automattic we’re allllll about sharing source code. We’re easy, we give it away.
Tragically, though, using WordPress.com it is really, really hard to post source code. You have to know about HTML encoding, pre and code tags, and if you want any slick highlighting you have to convert it before you post it. You have to jump through all sorts of hoops.
Isn’t this much cooler?
$features = file_get_contents( 'http://wordpress.com/features/' ); preg_match_all( '|<h3>(.*?)</h3>|is', $features, $why_wp_rocks ); foreach ( $why_wp_rocks as $slick_feature ) $hotness = $slick_feature; var_dump( $hotness );
If you want to know how to drop that science check out this FAQ entry, it’s as easy as a blog post on a Sunday. Like , we realize this feature will probably not appeal to many people, but if you’re the type that writes about programming your blogging life should be easier now.
Here’s another editing tip: if you press Shift + Enter it gives you a single line break instead of a double one.
Happy Labor Day!