How to Handle AdSense in Responsive Designs

Responsiveness is clearly the future of web design, but one little problem with is advertisements. Ad networks, Google AdSense includes, don’t take kindly to you simply hiding them at lower resolutions with display: none and calling it a day, since the ads still load and register as being displayed. You need to do something smarter.

Fortunately, you can get the viewport width just as easily in JavaScript as with CSS, and can display a different ad unit depending on the page width. This can only happen on page load, though, to comply with the AdSense terms of service. Otherwise you would be breaking the rules by scripting fake page loads, essentially.

You can see how to do it in the Labnol post How to Use Google AdSense Ads on your Responsive Website.

The Lost Type Co-op

Looking for some good, high-quality fonts? In a similar vein to the League of Moveable Type, the Lost Type Co-op provides a selection of elegant typefaces using a pay-what-you-want model. Many of the available fonts feature a “@font-face” badge that signifies that the creator…

Custom JavaScript Twitter Widgets in an API 1.1 World

Continuing their gradual shutdown of old APIs (following the launch of version 1.1 of their API), Twitter recently pulled the plug on their old-style widgets and the unauthenticated search API. This means if you had a fancy custom-designed JavaScript widget to show off your…

How to Enable Curly Quotes in Jekyll

I recently migrated one of my blogs from WordPress to Jekyll and painstakingly ported my custom theme to the new blog engine. I didn’t notice it at first, but Jekyll makes a major typographic faux pas by default: it uses ugly, straight “typewriter quotes”…

Solar: A Jekyll Theme Based on the Solarized Color Palette

I’ve been having fun playing around with Jekyll and Ruby lately, which has lead to a sudden increase in the number of repositories on my GitHub profile. After converting my personal blog and porting its theme over, I thought it would be fun to…

DigitalOcean Review

Since the beginning of April, this site has been hosted by DigitalOcean. I’ve been a longtime customer of VPS.net—from September of 2009 up until April of 2012—but the difference in service was so huge that I had to switch. While VPS.net was a good…

BlogBuzz June 8, 2013

CDNJS: The Missing CDN

The Google CDN is an awesome way to speed up page load times, but it only has a few of the most popular JavaScript libraries. That’s what CloudFlare is aiming to rectify with their CDNJS. They have a ludicrously long list of libraries—JavaScript, CSS,…

Find the Number of Lines in a Git Repository

Want to figure out how many lines of code are in your Git repository? I’ve had an alias in my .bashrc file for ages that does just that. It uses git ls-files to generate a list of files, which it then passes it to…

WordPress 4.0 Would Be a Good Chance for a Rewrite

It’s no secret that the WordPress codebase is a mess. It seems that not a week goes by without some blogger publishing a post criticizing it. Unfortunately, fixing it is no simple matter. One of the goals the WordPress project holds is to maintain…