Better Native PHP Syntax Support in Xcode

I’m a big fan of the Xcode IDE from Apple. Unfortunately, it is myopically focused on development for iOS and Mac OS X, using Objective-C. A long time ago, it was a lot more open. You could find a variety of plugins that would extend its functionality to include the projects you work with, outside of the Apple software ecosystem. But for the past several years Apple has made it difficult to extend the IDE beyond their intended purposes. I’m mainly a backend PHP developer, but I have been a long-time Mac user. This puts me in the position of having second-rate tools for the biggest reason I use my computer. Yes, there are IDEs for Mac OS X that focus on PHP, but they’re all cross-platform and written in Java, which is, itself, a second class citizen on the Mac platform.

I’ve suffered through using Netbeans, Eclipse, and PHPStorm for years, all the while yearning for a grown-up IDE like Xcode to do my job. No longer! With Xcode 4, Apple introduced CodeSnippets that allow a user to not only save commonly used code snippets to an easily accessible palette, but we can tokenize the snippets and define the prefix text to which Xcode’s autocomplete feature will respond. Type “fore…” and if you have a snippet called “foreach”, Xcode will offer up the helpful autocomplete list with your snippet. Hit tab or enter and the snippet will be inserted at the cursor. Hit tab again and you’ll be guided through the snippet’s tokens, one by one, allowing you to fill in the blanks.

With this in mind, I went to work creating over 5,000 snippets to cover the entirety of the PHP language. See my github repo here: Now I have native-like autocomplete for Xcode. I start typing “str” and here’s what I see:

Screen Shot 2013-06-07 at 6.21.41 PM

I tap enter and this is what results:Screen Shot 2013-06-07 at 6.23.58 PM

I type “if” and Xcode presents this:Screen Shot 2013-06-07 at 6.25.17 PM

Arrow down to ifelse and tap enter:Screen Shot 2013-06-07 at 6.26.30 PM

Each of those blue rectangular ovals is a tabable token, just waiting for you to enter your specifics, just like Xcode’s support for Objective-C. It’s a huge advancement in the arena of Mac PHP IDEs. It took me about 6 hours to put this whole thing together so I’m sure that it can get better. Feel free to fork my GitHub repo for PHP Xcode Support and help make PHP a first class citizen on the only great IDE for the Mac.

New Embedded YouTube Interface Very Leopard Inspired

I just downloaded the Safari 3 beta today and eventually made it around to viewing a YouTube video in a friend’s LiveJournal post. To my surprise, at the end, the video’s familiar Play Again and other navigation features had been transformed, as if inspired by the new Leopard Desktop that was shown off today.

You Tube Leopardized

Dock like icons adorned the bottom of the embedded window along with a nice reflective surface and even the bubbly mouse over effect! I thought perhaps it was a secret new player for Safari 3 only using the new h.264 encoded files, but confirmed that it does also look the same in IE and Firefox. But, oddly enough, only in videos embedded in a website.

This looks like a sign of bigger things to come from the partnership between Apple and Google. Besides that, Apple isn’t telling you about how much faster Safari 3 is than Safari 2. Especially its Flash support. I’d say it’s easily twice as fast! And don’t even get me started on the INCREDIBLE new page and source search features.

So go download the Safari Beta and check it out for yourself:

How to get HD content for your Apple TV

Last week I eagerly tore into my new Apple TV and started using it. It is the now main component of my entertainment center, especially since I can’t have both a DVD player and the Apple TV connected at the same time. I rip DVDs using my Dual 2ghz G5 and then stream them over the wireless G.

Other than that, I’ve been getting all of my entertainment from either the iTunes store or from podcasts. NBC Nightly News and CBS provide a light overview of the day’s events, I watch 1 or 2 episodes of the TED and CoolHunting (fascinating!) podcasts, and sprinkle in a few cartoons and animations, plus shorts from PBS, Discovery, National Geographic, and a handful of amateur science podcasts.

As for paid programming, The Daily Show and Colbert are daily requirements, and then Heroes, Lost, and BSG when they’re available. I still haven’t purchased a single movie from the iTunes store and likely won’t until they either make the pricing more reasonable or come up with a rental scheme since I usually only watch most movies once, I can’t justify paying $10 for a low quality, stripped down version of a similarly priced DVD!

I have the HD capable, widescreen TV, the Apple TV, the HDMI cable to get them talking to each other, the surround sound. So what’s missing? There’s no freaking HD content! Even the Apple movie trailers are in a grotesquely compressed, low res format.

Yeah, shocking. So I have done the legwork and pulled together a list of resources for getting a little 720p action from your new honey. If you’re able to find something I haven’t listed here, let me know and I’ll update this post.

They’ve got some great, free content over there in QT format.

Technology Evangelist
Fun tech geekery in glorious 720p. It’s a podcast!

The world’s first HD internet TV show. Chicks in bikinis. Site may not be wholly SFW.
These guys are marketing directly to you, you AppleTV owner you.

TrailerCast HD 720p
HD movie trailers! This is a direct link to the podcast in the iTunes store.

They’re now producing an HD podcast.

That’s enough to get you going. There are a couple more on similar subjects that I haven’t listed here because I couldn’t find a link to their website, but just do a search in the iTunes store for 720p and you’ll find them.


Reader Contributions:

Nasa in HD

Interview with John Hodgman

John Hodgman, the PC in the new Mac commercials, was interviewed this week by Engadget. He’s a really funny guy and somehow, even though he’s not the product being advertised, has become the star of those ads. Makes me wonder if there are any people out there thinking, “If I like the PC better in the Mac commercials, will I like a PC better in real life?” or is he just the likable, bumbling fool who you’d have a beer with but never trust with your data?

Here’s an excerpt:

Seth Stevenson over at Slate thinks that the ads have backfired because your, “humor and likability are evident,” and that he’d “much sooner associate with Hodgman than with Long [the guy who plays the ‘Mac’].” Are you becoming an icon for diehard PC users?

The villain of any story is often the most compelling character. Justin, who is brilliantly funny, of course must play the hero, and the Luke Skywalkers of the world always catch a certain amount of flack. It’s unfair, but inevitable, and I don’t think it has caused people to buy more PCs anymore than it caused people to root for the empire over the Jedi. The Jedi still are the best. And they don’t get viruses.

How did you maneuver me into a Star Wars discussion? Damn internet.

That is all.

The whole interview is here, and the Slate article is over here.

He’s also got a recurring role on The Daily Show, which is always hilarious.