Posts about "Receptes"
Location bar as the new search bar
Just a pair of tips to do quicker searches in Firefox:
Type the query directly in the location bar. It will do a normal search in Google but if the first result is the "clear winner" you'll be redirected directly to it. That is, if you search for "olympic games" it's not clear what are y... (more)
Optimizing MySQL subqueries
Yesterday I was writing some SQL queries involving subqueries for a MySQL database when I saw it were being executed very poorly. This is an example of how it looked:
SELECT * FROM country WHERE id IN (
SELECT country_id FROM province WHERE id = 123
)
Nothing complicated over here... (more)
Seam carving, photo resizing gets smart
Seam carving is a photo resizing algorithm that takes into account its content to avoid ugly deformations. You can also mark some parts of the photo to avoid deforming it or to even remove it. There is a full explanation on this paper but it's presentation video is way more impressive:
... (more)
Update notifier for Ubuntu servers
Probably if you are running Ubuntu on your desktop you will be running the update notifier applet that notifies you about available updates of your installed packages. It is very handy as it is a maintenance job easy to forget.
The drawback of this utility is that it only runs on a desktop... (more)
Combine your feeds into one
One of the disadvantages of using different services to publish your contents (photos in Flickr, links in del.icio.us, posts in your blog, your status in Twitter, ...) is that you force your followers to subscribe to various feeds to track you.
A good way to solve it is to create a uni... (more)
Remove directory contents but not directory itself
$ find directory_name -mindepth 1 -maxdepth 1 -exec rm -rf {} \;
where -maxdepth 1 -exec rm -rf {} \; deletes the directory files while -mindepth 1 avoids deleting the directory itself. (more)
Reverse proxy for sites with HTTP authentication
Situation
You want to create a reverse proxy to a site that requires HTTP basic authentication (the typical dialog asking you for a user and password) without having to ask the user for this credentials.
This functionality is specially useful when you require multiple HTTP authenticatio... (more)
Como usar las baterías de Ion-Litio
No podia entender como, sólo al cabo de año y medio, la bateria de mi portátil, de marca y bastante caro, no aguantaba ni una hora sin un enchufe cerca. Pués hoy en Menéame he visto que hablaban de ello:
Baterías de Litio-Ion: Mitos y Leyendas.
Un rápido resumen de como utili... (more)
Creating a dynamic DNS with your own domain
Last week my ISP changed my home connection to a dynamic IP configuration. The fact is that I somehow needed to access to this connection so I've thought a dynamic DNS would solve the problem.
The solution was as simple as creating a free account in any of the dynamic DNS providers (I've c... (more)
Batch file encoding conversion with Vim
$ ex filename '+set fenc=utf-8' '+x'
It's basically the same to opening the file using vim, change its encoding (set fenc=utf-8), save (if needed) and quit (x).
The advantage over using other methods (like iconv) is that vim will try to detect automatically the current file encoding.
... (more)