Archivos de la categoría ‘Posts in English’

Remove Outline in Firefox (in anchor, inputs, buttons, etc) with CSS

Septiembre 30, 2009

Firefox most-pain-in-the-ass-for-developers ‘feature’ it’s to put an outline dotted in grey in every link, button or input we focus (or click).

This could be easily solved using a simple CSS line using Mozilla’s own pseudo-selectors:

a::-moz-focus-inner { border: 0;outline:0 }

That’s it. And be careful: there are two colons not just one. That works for links, but you can make it to every tag Firefox implements like buttons or input button or submit.

It may work just with ‘

outline: 0;

‘ but it’s been reported of this working bad with old versions of Firefox.

input::-moz-focus-inner { border: 0;outline:0 } // for all inputs
input[type=button]::-moz-focus-inner { border: 0;outline:0 } // for input tag type button
input[type=submit]::-moz-focus-inner { border: 0;outline:0 } // for input tag type submit
button::-moz-focus-inner { border: 0;outline:0 } // for button tag

Or you can just apply when it’s on focus:

input:focus::-moz-focus-inner { border: 0;outline:0 } // for all inputs on focus

Desactivar Flash y/o cuenta atrás en Photo Booth

Mayo 22, 2009

Pulsando SHIFT antes de apretar ENTER o hacer clic en el botón de sacar una foto evitamos que aparezca el Flash.

Y si usamos ALT/OPTION al hacer lo mismo desactivamos la cuenta atrás de tres segundos.

Por supuesto, ambas opciones son compatibles y pueden hacerse a la vez :-)

Safari 4 “ERROR_SEC”

Febrero 25, 2009

If you got this message trying to install Safari 4:

It’s not possible to installa Safari on this volume: ERROR_SEC

It means you have not an updated MacOSX. Simply that. Update to the latest release and it will be ok :-)

F de Fanboy

Febrero 15, 2009

Fanboys of the world. Unite. I’ve created this. The new Fanboy emblem.

fanboy

.htaccess – rewriteengine on doesn’t work

Noviembre 17, 2008

If when you start using the RewriteEngine On directive in .htaccess file you get an invalid error code, and Apache doesn’t seem to understand the Rewrite directives, you should find this in the error logs:

Invalid command ‘RewriteEngine’, perhaps misspelled or defined by a module not included in the server configuration, referer:

To solve this, you need to edit the httpd.conf and find the mod_rewrite module, and activate it:

LoadModule rewrite_module modules/mod_rewrite.so

If the line is disabled/commented (with a ‘#’), it just need to be removed. Restart Apache and everything should work now.

Get the number of Disqus comments with PHP (or any other language)

Agosto 21, 2008

Disqus a great service. I suppose it will take a few months until the whole ‘blogothingy’ realizes how important this is for all. Then, in less than a year from now any Internet giant will acquire them, i’m sure of it.

I’ve been playing with it from a time now and, as everyone should now, i really love APIs, but for the moment Disqus’ one is not ready yet.

So, I needed to get the number of comments of a thread dinamically to display the number outside the thread page and get some stats, but there’s no ‘direct way’ of getting them. Lucky me, I found a way.

Using Disqus’ Feedflare for Feedburner (Disqus > Your Panel > Tools > Feedburner) you’ll find a XML similar to this:

http://WEBSITE_NAME.disqus.com/~feedflare/comments_link.xml

This is an XML wich displays the number of comments in a Feedburner-Feedflare way. Pretty simple:

<FeedFlareUnit>
    <Catalog>
        <Title>Disqus Comments Link</Title>
        <Description>Display the number of comments for each post.</Description>
    </Catalog>
    <DynamicFlare href="http://disqus.com/forums/WEBSITE_NAME/%7Efeedflare/comments_link_dynamic.xml?url=${link}"/>
    <SampleFlare>
        <Text>17 Comments</Text>
</SampleFlare>
</FeedFlareUnit>

So, now we get a URL to display the number of comments of a given thread url with via HTTP GET:

http://disqus.com/forums/WEBSITE_NAME/%7Efeedflare/comments_link_dynamic.xml?url=${link}

That’s it all, replace ${link} with the URL of the thread and it will display the number of comments like this.

X Comment/s

So, now, if you now some basic programming, it’s easy to get the info.

function commentsNumber($website,$url) {
$c = file_get_contents('http://disqus.com/forums/'.$website.'/~feedflare/comments_link_dynamic.xml?url='.$url);
preg_match("#([0-9]+) (Comment|Comments)#",$c,$n);
return $n[1];
}

This will return ONLY the number of comments, but you can return $n[0] for example if you would like to get full string.

About Gigafollowers on Twitter

Julio 10, 2008

This is an open letter to Twitter staff.

Please, dear Twitter programmers, make something to avoid people following thousands and thousands of people just to make a few of them to follow him/her back and make spam…

I call this people Gigafollowers and I think I have a method to stop them: implementing “following ratios”.

Let’s say you have 40 followers and you are following 50 people, this is an average Twitter user, but, if you have 30 followers and you’re following 20k people… obviously, you’re a spammer.

So, I would handle this with a simple formula:

number of people allowed to follow = people following me * N

Where N is a fair number to multiply or power the number of people following myself. This way a Gigafollower has to have more people following him/her to continue spamming, and at least, they will be a bit more screwed.