jesus.perezpaz.es

Articles

Configure subdomain as “CDN” in NGINX (+ WordPress & W3 Total Cache configuration)

UPDATE: CORS (Cross-origin resource sharing) added to the “fake” CDN. Based on: https://gist.github.com/alexjs/4165271 In a typical scenario, you serve your webpage from single domain, that includes all yours “server generated” pages and also the images and assets (javascript, css and other files) of your site. This can slow down your page speed. Most of the […]

View more

WordPress NGINX configuration

I’ve been installing some wordpress sites in my new VPS running with NGINX. Install wordpress with Nginx is not as complicated as it might seem but you have to do some configurations to increase security and to make it work with cache plugins. As cache plugin I’ve chosen W3 total cache because the “Page Cache”, […]

View more

FamFamFam flags sprite (with compass)

Creating css sprites is an amazing feature in compass. There is a tutorial to use compass to generate css sprites in the compass documentation. The famfamfam icon flags are 247 icons — in GIF and PNG formats — representing most countries in the world as small pixel icons. These flag icons are available for free […]

View more

Auto-generated cache.manifest in PHP

If you don’t want to read the entire entry, you can get the code (and propose changes, of course) in github: https://github.com/tx2z/autogenerated-cache.manifest-php A very interesting thing in HTML5 is the possibility of create offline applications or web pages through the cache.manifest file. This pages can be read by the user when he don’t have an Internet connection, that […]

View more

Saas @mixin for change measures for responsive desing

Working in my last project I needed to change the measure  of some elements to the 60% to adapt them to mobile browsers. At the beginning I’ve tried to do it with CSS ‘rem’ units but it didn’t seems to work as expected in Android browser :S (it works great in last ios6, firefox mobile, and chrome and firefox desktop. I’ve […]

View more

Capture simple, double, triple, long and right clicks in the same element with jQuery

This is a simple code snippet to capture simple, double, triple, long and right clicks in an element with jquery. This is really a mix of: https://github.com/pisi/Longclick https://gist.github.com/399624 To use it you have to add jquery (http://jquery.com/) and the plugin jquery.longclick (https://github.com/pisi/Longclick) to your page. and then you can use the code bellow to capture clicks: The code is […]

View more

google-webfont download – userscript to download google fonts

I’ve done a little userscript that add a download link to fonts in google webfonts page (http://www.google.com/webfonts) This script generate a download button for every font in google webfont page, so you can download easily the font to use it offline without generate a Collection. The script can be found and installed here: http://userscripts.org/scripts/show/154563 It need […]

View more

Attributes(ids or names) with square brackets and jquery

I have this problem the other day. I wanted to select with jquery an div witch id was “Customer[Main][Last_Name]” and, well, if you try to do it, it’s not possible :S Yep, “id” and “names” attributes can’t contain ‘[]’s in HTML, but some developers in my company don’t know (or don’t want to know ¬¬) that…  If you can change […]

View more