Better Google Analytics JavaScript that doesn’t block page downloading
If you saw Steve Souders’ March 5 talk at Google and have ever used Google Analytics, then you were probably amused when he used GA’s JavaScript insertion code as his “wrong” counterexample. Well, at least I was, and somebody else mentioned it in the Q&A so I figure I’m not the only one.
The GA insertion code that Google gives you to put on your site does a couple of bad things: First, it uses document.write, and second, it loads ga.js directly, which blocks browsers from doing any page rendering or downloading of other page components (images, scripts, stylesheets) during the whole time it takes ga.js to download and execute. In other words, Google Analytics makes your pages load slower!
Using Steve’s best practices, I’ve coded up a better version that does DOM insertion of the script tag and uses the “script onload” technique to initialize the tracker, so that it doesn’t block I/O, and you can inline it anywhere on the page or even load it from an external file. You can choose to lazy-load GA whenever you want — for instance, even after window.onload fires — so that it’s totally asynchronous and doesn’t interfere with page rendering at all. more …
Optimize all your PNG and JPEG images with one command using imgopt
Here’s something useful for the web developers out there. It’s a script I’ve been using for a while that makes it super-easy to losslessly compress entire folders of PNG and JPEG files for the web.
If you’re familiar with PNG optimization, then you know about programs like advpng, optipng and pngout that optimize and recompress PNG files, making them much smaller than the likes of Photoshop can. My shell script combines all three of these utilities to achieve minimum file size, while hiding their command-line syntax and adding the ability to recursively process entire directory trees.
And, it works with JPEGs, too! It uses jpegtran (included with libjpeg) and another small utility I’ve included to optimize and strip all metadata from JPEG files. Since my script searches directories recursively, all you need to do is type, say, imgopt myproj/htdocs and it’ll take care of your entire website.
All compression is lossless, which means no pixels are changed and no information is lost, the files just get smaller — chances are your layout can shrink by as much as 50%, which is like getting free bandwidth, and it means your site will snap into place that much faster for users. more …
Update to HTML Minify for WordPress and WP Super Cache
No big news here, but I’ve got an updated patch if you want to use my mod to add Minify to WordPress and WP Super Cache. For more information, check out my original explanation and instructions post, which I’ve updated with links to the new files. more …
Review/first impressions of Poker Copilot software for Mac OS X
I’m not an expert poker player, haven’t used a lot of other poker tracking software, and have only been using Poker Copilot for a week, so I’m not going to do an exhaustive review, just share some first thoughts. (If you are an expert, please chime in!)
Poker Copilot is currently the only actively developed poker software for Mac OS X folks like me, since Mac Poker Pro is apparent abandonware and Poker Tracker’s Mac port has been repeatedly postponed. Given that, I can say first of all, without hesitation, that Copilot is absolutely worth a look if you’re on a Mac and not using any analysis software at all (it’s a snap to download and install, and you can use it for 30 days without registering). It works with both PokerStars and Full Tilt Poker (the only two online poker rooms with native Mac software). more …
How to losslessly concatenate / merge MP3 files
You’d think it would be very easy to combine multiple MP3 files into one, while preserving all the ID3 tag metadata and without re-encoding the audio (which is lossy). Well, it actually isn’t that hard at all, but since Google couldn’t find the answer for me, I thought I’d write it up. more …
How to transfer domains away from GoDaddy
It’s Super Bowl Sunday, a day I particularly enjoy transferring domain names out of GoDaddy, the registrar that once tempted me with low prices but now mostly just annoys me. Here’s how to move your domains to a new registrar quickly, easily and without fouling anything up (you don’t want your website to disappear!) in the process. more …
Ornament Creme Eggs are here
It’s true, the fabulous ornament creme egg of last year is back, and I just picked up a bundle of them for only 39 cents an egg at Walgreens (they were marked at 2/$1), so now my head is floating and my muscles are twitching from all the cremey goodness.
If you only know about the regular, easter-timeĀ Cadbury creme egg, never fear, these are 100% the same as the easter eggs — still laid by a bunny in the 1.2-oz. size that Cadbury moved to a couple of years ago, only with a red wrapper instead of the regular one. They aren’t supposed to hang on your tree or any nonsense like that. more …
FCC opens up spectrum for public use
We all won a huge victory yesterday when the FCC allocated a huge swath of radio spectrum for public use, which means that after analog TV goes away, any company or hobbyist will be able to use these frequencies. It’s a much wider range of spectrum than what’s available for public use today (the narrow frequencies things like your cordless phone and 802.11 wifi use), so a whole new class of high-bandwidth applications is going to become possible.
What does that mean exactly? Well, the most awesome part is that we don’t even know yet. But don’t be surprised to see, say, 1-gigabit wifi that makes 802.11 look like dial-up or wireless HDMI so that the video game or Hulu video you were about to see on your laptop screen shows up on your flat screen TV, too. Imagine the data connection and streaming video on your mobile phone 100 times faster, and imagine not having to go through one of the big 4 wireless carriers to get it! more …
Minify for WordPress and WP Super Cache
I’ve integrated Minify and all its bandwidth-saving goodness into WP Super Cache, everyone’s favorite way of sending WordPress pages as super-fast static HTML, thereby saving visitors having to hit up the PHP interpreter (ugh!) or WordPress itself (double ugh!).
What does this mean? Well, it means your HTML (and gzipped HTML) pages can be 5-20% smaller with just a few minutes’ setup. If that sounds good, skip to the install instructions. If you want to hear more blabber first, read on. more …
Gzip compression levels for static-cached HTML
I was reading through the source of WP Super Cache recently, and noticed that it was using a gzip compression level of “1″ (the lowest) to compress its static-cached HTML pages. Level 1? Why not 3 or 6 (the default) or 9?
These pages are compressed and saved once on the server, and then sent many times to user’s browsers. So, what compression level makes the most sense for pre-compressed HTML? more …
