Entries by Carlos Escribano

I wrote a wiki page in siwapp’s project with some stuff I found on how to integrate Selenium RC with Symfony 1.2. You can see it here: How to write AJAX tests


Suppose we have HTML code with the following structure: <body> <a id="panel-previous" href="#">previous</a> <ul id="panel"> <li>ad</li> <li>adipisicing</li> <li>aliqua</li> <li>aliquip</li> <li>amet</li> <li style="display:none;">anim</li> <li style="display:none;">aute</li> <li style="display:none;">cillum</li> <li [...]


If you manage :focus CSS styles for certain input controls you may have noticed that Safari attempts against your pretty innovative design adding a blurry blue outline effect. You can avoid this adding this: input:focus { outline-width:0; ... } And that’s all.


Today I needed to access a webserver with phpMyAdmin configured as default page if no virtual host matched the requested one. It was configured to deny access from outside so my solution was to use a SSH tunnel: carlos$ ssh -L 10080:192.168.1.3:80 user@host So I can access phpMyAdmin writting this in my browser address bar: localhost:10080 That’s all!


Recently I discovered that Firefox lets you override alert and confirm window object methods. I tried this with prototype and surprisingly it just worked! (Note that it is not tested in IE or Opera and others yet, but it also works in Safari). <div id="test" style="background:red;color:white;display:none;"></div> <script type="text/javascript"> window.confirm = function (s) { alert(s); }; window.alert = function (s) [...]


You can see regular expression examples at this site. Very useful. This is the content: Examples Numeric Ranges Floating Point Numbers Email Addresses Valid Dates Credit Card Numbers Matching Complete Lines Deleting Duplicate Lines Programming Two Near Words


The concept around this is to serve a 1px image through a PHP script. This allows you to insert a new record or update an existing one about read mails. In your mail you only have to insert an image tag like this at the end of the template: <img src="<?php echo url_for('stats/image?bulletin='.$id, 'absolute=true') ?>" alt="px.gif" /> And [...]


Nuestros queridos amigos de Joomla / Joomla Spanish, ni sé ni quiero echar las culpas a nadie, se han olvidado un trozo de código en una query para borrar imágenes y saltaba el mensajito de: No tiene permiso para acceder a esta sección o algo similar. Lo que hay que hacer es, en la línea 251 del fichero [...]


Generating a CSV file from an action to bring it to the users of one of our websites I encountered myself with the problem of Symfony’s MVC model and decorator pattern. Although I was using echo statements directly, Symfony was waiting for the action to finish to send headers and allow the download, so the [...]


Cuando el nombre de la tabla en la base de datos difiere del nombre en el modelo de objetos, necesitamos obtener el “phpName”. Una forma de hacer esto, útil cuando solamente tenemos un nombre de tabla y un ID, es: $tabla = Propel::getDatabaseMap()->getTable($miNombreDeTabla); $phpName = $tabla->getPhpName() ? $tabla->getPhpName() : sfInflector::camelize($tabla->getName()); return call_user_func(array($phpName.'Peer', 'retrieveByPK'), $miID); Por si a alguien le [...]


Pegándome con el widget de Plaxo para obtener contactos de correo desde cuentas de servicios web públicos he necesitado sacar por un lado el nombre del “individuo” y por otro su dirección de email para insertarlo en unos controles de un formulario. Como no tengo ni idea de expresiones regulares, etc, etc, etc… me ha llevado [...]