Make websites on IE8 to look like IE7


Written on April 22, 2010 – 6:01 pm | by Rene

If your website is looking good on IE7 but on IE8 it looks like crap, it’s soved just adding one line of code to the header of your website, so it looks like IE7

  1.  
  2. <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
  3.  

Tags: , ,

Use google docs to embed PDF documents and PowerPoint presentations on your site


Written on April 22, 2010 – 5:46 pm | by Rene

If you want to embed a PDF file or a Powerpoint presentation on your site, a pretty easy way to do it, is just go to https://docs.google.com/viewer, introduce the pdf url, click on “Generate Link” and you will get a url to share with your users, where they can see the pdf file on the web or get the html code to embed on your web site

If you want to create the html code on you own is pretty easy just insert an iframe that points to http://docs.google.com/viewer and pass two parameters url=http://yousite.com/pdfile and embed=true and that’s it now you have a pdf embeded on your site

  1.  
  2. <iframe src="http://docs.google.com/viewer?url=http%3A%2F%2Fwww.mywebexperiences.com%2Fwp-content%2Fuploads%2F2010%2F04%2Fphp-cheat-sheet-v2.pdf&embedded=true" width="600" height="780" style="border: none;"></iframe>
  3.  

PHP Cheat Sheet (V2) Creative Commons License (Attribution, Non-Commercial, Share Alike).

Via : Embeddable Google Document Viewer

Tags: , , ,

Google Maps Operation aborted on IE


Written on October 30, 2008 – 10:33 pm | by Rene

If you are getting an annoying message like this

“Internet Explorer cannot open the Internet site” “Operation aborted”

When trying to see a web page that contains a google map. And right after the message pop ups Internet Explorer shows an empty page here are some tips to help you fixing this issue

First thing you’ll have to do. Is to move all the code used to generate the map to a function and call it once the page is loaded

  1.  
  2. function loadMap() {
  3.         // JS code to create your map
  4. }
  5. window.onload=function() {
  6.         loadMap();
  7. }
  8.  

If you are using prototype you can use

  1.  
  2. document.observe("dom:loaded", loadMap );
  3.  
  4. OR
  5.  
  6. Event.observe(window, ‘load’, loadMap, false);
  7.  

Or you can add an onload attribute to your body tag

  1.  
  2. <body onload="loadMap()">
  3.  

If you are using polylines you should add vml namespace to your header and should look like this

  1.  
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3.    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
  5. <style type="text/css">
  6. v\:* {
  7. behavior:url(#default#VML);
  8. }
  9. </style>
  10.  

Loading the javascript needed to generate the map as an external file , and adding defer attribute so internet explorer will wait until it loads the page before executing the Javascript. It has the same effect than moving your JS code to the bottom of the page.

  1.  
  2. <script src="maps.js" type="text/javascript"  defer="defer"></script>
  3.  

It can be also a problem with a base tag messing wiht IE more info on http://www.shauninman.com/archive/2007/04/13/operation_aborted

Protect web pages with username/password


Written on September 29, 2008 – 6:59 pm | by Rene

If there some web pages you want to protect with username/password, all you have to do is to create a file called .htaccess under the directory to protect with the following lines:

  1.  
  2. AuthUserFile /path/to/htpasswd/.htpasswd
  3. AuthGroupFile /dev/null
  4. AuthName "Restricted Directory"
  5. AuthType Basic
  6.  
  7. <Limit GET POST>
  8. require valid-user
  9. </Limit>
  10.  

Replace /path/to/htpasswd/ with the .htpasswd path.
Replace Restricted Directory with the text you want as title of the prompt window.

Then you have to create the .htpasswd file using the following command:

htpasswd -c .htpasswd user_name

Execute it under the directory to protect or add the full path to .httpasswd and replace user_name by the username you want to use, you will be asked to enter the password and the file will be created.

Notes: This instruction are for linux/unix systems using apache web server, the dot means hidden files on linux.

Prototype Compressed


Written on June 28, 2008 – 8:25 pm | by Rene

I am a prototype user, but i want to save some bandwidth using a compressed version, so i start looking for it and i found a compressed version called protopack it includes different versions, just spaces removed ( no eval required ), encrypted(eval required) and gziped version for both. i prefere the just spaces removed version since it dosen’t require use of eval.

Another good option is to use the Google AJAX Libraries API that serves a compressed version of prototype that will be cached by a year and sent with compression headers , you can include it using the full url or the Googles’s API

  1.  
  2. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js"></script>
  3.  
  4. OR
  5.  
  6. <script type="text/javascript" src="http://www.google.com/jsapi"></script>
  7. <script type="text/javascript">
  8. google.load("prototype", "1.6.0.2");
  9. </script>
  10.  
  11.  

You can find compressed versions of scriptaculous, jQuery, MooTools, dojo as well. The bad thing is there are no https support so it wont work for secure sites.

Google Developer Day 2008 – Mexico City


Written on June 24, 2008 – 8:46 am | by Rene

Yesterday, Monday 23 2008 I have the opportunity to assist to the Google Developer Day Mexico City, the first two talks were about Google and the Mexican market and an overview of their new product for developers ( android, maps, open social, etc. ) this first two talks were in Spanish, after a launch it was a breakout with 4 different options, the talks i have the opportunity to go were:

  • Open Social introduction by Chris Schalk: Open Social is a technology that allow us to create applications for social networks with the advantage it will run on every platform that supports open socials ( Hi5, Orkut, IGoogle, Linkedin ) the talk was about Were Open Social is going, what can we do and what to expect from it, Google friend connect,, how to create some basic application and how to implement on our how servers.
  • IGoogle + gadgets by Bruno Bowden: IGoogle is you own personalized start page where you can add a lot of gadgets to it ( weather, jobs gmail, etc. ) This talk was about creating gadgets for IGoogle , and the new support of Open Social and the new canvas mode
  • Gears by Dion Almaer: this was the talk i like the most, i really like the idea that we can use gears to create an offline version or speed a site up like wordpress.com is doing, but when i got home and try to install gears on my machine i realized that Linux 64 bits is not supported :-(
  • Google Maps API Advanced by Pamela Fox: This talks was about using tile layers with Google maps so we can use our own maps, images or anything we want to zoom in using Google maps, right now i am using Zoomifyer for this purpose but i hope with this info move to Google maps. pretty cool!

Test your sites on IE from linux


Written on June 3, 2008 – 11:12 pm | by Rene

I work all the time on Linux, but unfortunately there are some bugs that happened just for Internet Explorer so i used to reboot, test on windows, fix it, and then reboot and continue working on linux.

This process is annoying reboot, fix, test, etc. but thanks to Wine. We can install Internet Explorer on Linux, for that we can use:

IEs4Linux this script can install several versions of IE 5, 5.5, 6 even you can install IE 7 (not fully supported)

Here are some screenshots of the process and IE running

Another option is to use Wine-Doors, it’s an script that help us installing window’s software like Ares, Flash 8, Internet Explorer 6 etc.

wine-doors-3

With the previous options IE not always runs like on windows. There is another option running windows under Linux as a virtual machine for that purpose you can use virtual box, qemu, vmware.

My choose is Virtual Box Open Source Edition, here is a good tutorial on how to install it and some screenshots of my virtual box running IE6 and IE7

Virtual Box

Configure Apache to serve PERL pages ( Ubuntu )


Written on May 30, 2008 – 5:59 pm | by Rene

I just reinstalled my ubuntu distribution, and have to configure apache to serve perl pages outside of the cgi-bin directory, after a little bit of googling i found the solution.

You have to edit the /etc/apache2/apache2.conf and add to it the following lines.

  1.  
  2. AddHandler cgi-script .cgi .pl
  3. <Files ~ "\.pl$">
  4. Options +ExecCGI
  5. </Files>
  6. <Files ~ "\.cgi$">
  7. Options +ExecCGI
  8. </Files>
  9.  

Stop apache showing incomplete urls


Written on May 22, 2008 – 9:51 pm | by Rene

Apache was showing files even if i didn’t put the extension on the url, that behavior was messing with a mod rewrite rule i was working on. To solve this we just add the line below to the .htaccess file and that’s it apache will stop showing incomplete urls

  1. Options -MultiViews
  2.  

Tags: ,

Vaga – free icon set


Written on April 8, 2008 – 11:40 am | by Rene

Today i found on the web a free icon set called vaga, that you can use for personal or commercial projects, it contains 60 icons 16×16