Optimizing TwentyEleven for Adsense

Well… this one is pretty descriptive. You simply need to edit the file ‘style.css’, and update the following code:

[cc lang=”css”]
.one-column #page {
max-width: 960px;
/* max-width: 690px; */
}
[/cc]

You’re also probably gonna need to set the Default Layout to ‘One Column’, and remove the right side widgets.

That way, Adsense’s best size (728×90) will fit riiight above or below every post. Which makes it look nice, i dare to say!.

Make your Website load Faster!

I had to optimize a website, a couple days ago. My goal was to lower the time required to load the website. So… i spent quite some time doing a quick research… and found this awesome tool, which by the way is free!.

Screen Shot 2013-01-21 at 11.08.54 AM

It’s called ImageOptim. You simply drag & drop the assets you’d like to compress, and the guy will do the rest. I’ve been able to compress most of the images i’ve got, to 50% of their original size.

So now… my websites load super fast. If you’re running Windows (or Linux)… you could try ImageMagick. Which, by the way, is excellent as well.

Adding Adsense to your blog

This is probably trivial to everyone around, but i’d like to share it anyways.

  1. Signup for an account here: adsense.google.com
  2. Wait till you get the first ‘Site in Review’ mail.
  3. Once you got access to the Adsense main page, hit ‘My Ads’, and create a brand new ad.
  4. Copy the source code for the ad!.
  5. Install the required plugin…
    1. If you’re using WordPress, i suggest you try this plugin: http://wordpress.org/extend/plugins/quick-adsense/
    2. If you’re using Blogger, just hit the settings, it’s already integrated.
  6. Setup QuickAdsense (or Blogger). If you dare, you can always simply inject the ad-code yourself.

No matter what, please, remember the adsense guidelines. It’s pretty simple… don’t click your own ads, and.. don’t steal content!. That includes youtube music videos, and piracy.

Got it?

Encode your email in base64, and confuse spammers!

How many of you run a website? come on! raise your hands!. Most of you should know, at this point, that publishing your email (in raw) is a pretty bad idea. Spammers, scammers, and whatsoever will target you, almost for sure.

So what can you do?. Well.. you can try encoding your email in base64!. Which means that… the browser will understand your email, it’ll get printed… but any automated spider-bot will fail to search ‘@gmail’… at least without consuming quite a lot of CPU power.

So… if you’re still interested, try this link. I’ve found it really helpful!.

Fixing ñ characters in code-igniter

It seems this is one of the oldest issues of PHP develoment, right?. I’ve developed a PHP website, based on codeigniter framework (and a mysql database), and i ran into a lot of problems with the ñ, not showing up well in google.

Here’s what i’ve done to fix this problem:

  1. Set the database collation / columns to utf8_general_ci (by means of phpmyadmin).
  2. In codeigniter’s ‘config.php’ file.
    [cc lang=”php”]$config[‘charset’] = ‘UTF-8’;[/cc]
  3. In codeigniter’s ‘database.php’:
    [cc lang=”php”]$db[‘default’][‘char_set’] = ‘utf8’;
    $db[‘default’][‘dbcollat’] = ‘utf8_general_ci’;[/cc]
  4. In the ‘general’ html-rendering, before anything else gets echo’ed (beware, i’m using HTML5.. HTML4 is different):
    [cc lang=”html”][/cc]
  5. And finally… in my .htaccess file:
    [cc lang=”bash”]AddDefaultCharset UTF-8[/cc]

I hope this helps. I’ve spent many hours reading… testing… and a couple days waiting for Google’s update!.

%d