Recent Code News
I wrote a very thorough comment in response to the rather (unfortunately) ignorant and inflammatory blog post on DailyJS titled Static Site Generators for Yeoman, but it seems to have mysteriously disappeared. I didn’t intentionally delete it, at least.
Either way, here’s my original comment, in case you may have missed it.
“If you’re gonna hate, hate with some consistency.” (source)
Not just that, but he mentioned that he finds it amusing when, amidst hundreds of lines of otherwise pristine semicolon-less code, there is a single line that starts with a semicolon.
Then I decided to write a blog post. Although that’s mostly because I have a lot of work to do, and I’m an expert procrastinator.
Instead of posting a super-long comment on his blog, I figured I’d respond to his comments here.
You know the new Apple Retina MacBook Pro laptop? The one with the super-high resolution display? Well, I got one last week, and I spent all weekend updating my dotfiles to work with OS X 10.8 (Mountain Lion). And after a lot of wrangling with XCode, I finally managed to get everything working. Well, almost everything.
While using Gyazo, I’ve encountered one particularly annoying “Retina” related issue. I posted an article a few years ago about running Gyazo on your own server, and ever since then I’ve been running Gyazo without a problem. The first time I used it on the new laptop, however, I noticed that something odd was happening: every Gyazo screengrab on the new Retina screen was about twice as big as I expected.
Note that while this article addresses an issue within the context of using Gyazo, because it’s more of a general OS X issue, the solution presented herein can be useful in similar scenarios.
var statements were superfluous, instead opting for a single, combined
var statement with a comma-separated list of variable declarations and assignments whenever possible.
Just in case you don’t know what I mean, I’ll illustrate:
// Single, combined var statement. var foo = 1, bar = 2; // Multiple, individual var statements. var foo = 1; var bar = 2;
var statement with multiple declarations and assignments to multiple, individual
var statements, and the only responses I’ve been able to get seem entirely subjective:
- Multiple var statements are superfluous.
- Multiple var statements are noobish.
- Combined var statements look better.
var statements aren’t superfluous and they aren’t noobish. They reduce the effort it takes to maintain code.
grunt on the command line), who is already using it (the jQuery project for starters), and what its future looks like.
In addition, I’ll be in Phoenix, AZ next week for JSConf and will be talking about grunt for 15 minutes next Monday, on the “Twitter Track.” So if you want to learn more about how grunt works, first read my introducing grunt article. After you’ve done that, if you’re going to be at JSConf, come to my talk. And don’t be afraid to find me and ask me all about it!
Earlier this month, I spoke at the Boston jQuery Conference, where my talk on “Plugin Authoring Best Practices” was well received. It went so well that I’m going to be giving it talk again, but this time online, at the jQuery Summit!
Continue on for more information about my talks and a 20% off coupon code!
I’m very excited to be speaking at this year’s Boston jQuery Conference. I’ll be giving a talk entitled “Plugin Authoring Best Practices,” so be sure to sign up for the conference, come to my talk, and say hello!
Also, the day before the conference, I’m going to be giving our full-day Bocoup Beginner jQuery Training. If you’re new to jQuery, this training will help get you prepared for all the great talks that you’ll see over the weekend. The training is a good value, with all proceeds benefit the jQuery project.
I recently attended the jQuery Bay Area Conference, which was held at the Microsoft Silicon Valley Campus Conference Center in Mountain View, California. I decided to go not only from a personal “want to hang out with cool people” perspective, because I know many people who are active in the jQuery community, but also from a “Director of Training at Bocoup” perspective. The former is cool because it’s always nice to interact directly (ie. drink beers) with people with whom your only typical interaction is IM or IRC. The latter is cool because on the day before the conference, Bocoup donated a full day of Beginner jQuery training to a very appreciative group of attendees, with all proceeds going directly to the jQuery Project.
The overlay module allows the Drupal admin interface to appear seamlessly, as a modal window, on top of the current page, while maintaining that page’s context. This was, of course, a great idea, and one that jQuery BBQ made easy, with its built-in cross browser HTML5
onhashchange event and fragment management functions.
And now that Drupal 7 has finally launched, jQuery BBQ provides back button support in over 20,340 sites, not to mention the sites where it was already being used, of course.
Pretty sweet, huh?
As a change of pace, I decided to post this article to the Bocoup weblog. It’s actually my first article over there, so you should give it a read, and let me know what you think!
Read more about The “catch” with try…catch
In addition to providing some very thorough information about how this pattern actually works, I’ve actually made a recommendation on what we should call it, moving forward. Also, If you want to skip ahead, you can just check out some actual Immediately-Invoked Function Expressions, but I recommend reading the entire article.
In case you missed my previous blog post, I’m speaking at the upcoming jQuery Summit, a two-day online conference taking place on November 16th and 17th. I’ll be giving two talks, “Idiomatic jQuery” and “jQuery Pluginization” (one each day). In addition to my presentations, there will also be talks by a number of other well-known jQuery community members.
In addition, I promised that a few lucky winners would win a ticket for either the Designer or Developer tracks. So, with a little help from Brendan Eich, Ronald Fisher and Frank Yates, and without further ado…