How to force a cache refresh on CSS and JavaScript files with PHP?

Posted by Danny Herran on Dec 30, 2012 in Backend, Frontend | 1 comment

cache-internet-explorer-ie

There is your client, complaining that they can’t see the changes you just made to their website. You explain them that they need to delete their browser cache in order to properly visualize the modifications. They said they don’t know how, and this is when you lose your patience and decide for a more radical solution. We are developers right? there has to be something easier than explaining the client how to delete their cache. Read on for more.

Mobile browser detection for WordPress – embedded is_mobile() function

Posted by Danny Herran on Mar 7, 2012 in Backend | 5 comments

Lets face it. Responsive design is here to stay and it is the solution to all of our nightmares regarding mobile web design. For those who are not aware of this technique, I invite you to read my other post where I explain what it is. But lets get to the point. Sometimes we need to add conditionals to our WordPress theme in order to detect if the visitor is visiting us from a mobile device, if so, we remove or add content. This is solved by using a custom made function called is_mobile() embedded into our functions.php. Read on for more.

How is responsive design the answer to mobile web consumption?

Posted by Danny Herran on Feb 13, 2012 in Frontend, Other Stuff | No comments

The number of people perusing the web on mobile devices is huge, nobody can say otherwise. Ericsson reported that in the past year, mobile traffic more than doubled. The number of users in the United States alone who use the internet via a mobile device grew 19% over the past year. The Times of India recently reported that the number of mobile phones in the United Kingdom is now greater than the number of people there; not only that, but 27% of the adult population in Britain now uses a smartphone. It’s becoming clear that mobile browsing isn’t only here to stay, but it’s here to change the way we consume media. What does this mean for content creators and designers? In short, we must adapt and begin thinking about content in a more inclusive fashion.

Load several instances of your Tweet, Like and +1 buttons asynchronously

Posted by Danny Herran on Sep 22, 2011 in Social Networking | No comments

In one of my blogs, I was having issues with page loading because the social buttons were locking the page when they were being rendered. This is a serious issue for the visitor, since most of them just want to get to the info quickly. This issue is very noticiable on blogs, where you have dozens of these little buttons spreaded across your index page. Lets see how to fix it.

Finding unique array combinations with PHP (permutations)

Posted by Danny Herran on Jun 23, 2011 in Backend | 6 comments

I was developing a website where people would place horse bets and the system should be able to calculate all the possible permutations based on the user selection. That means: finding all the possible combinations in a two dimensional array. I found a couple of functions but none of them would keep the array keys intact. So, I came up with this idea after a few gray hairs.

How to add a Twitter Poll to your website

Posted by Danny Herran on Jun 17, 2011 in Frontend, Social Networking | 1 comment

Twitter is great and with it comes great ideas from everywhere. Today, I decided to try a new kind of poll that I really liked and will boost your Twitter mentions a lot. I am talking about Twitter Polls. If you don’t know what it is, keep reading, you will enjoy it.

How to add the Google +1 button to your website

Posted by Danny Herran on Jun 2, 2011 in Other Stuff | No comments

Google Plus OneGoogle started rolling the +1 button as an experimental version of Google Search. Today, the +1 button is available to everyone and this means that “you” as a webmaster can add the +1 button to your website and let people share on Google your content.

Error Validation Class for CodeIgniter Reactor 2.0

Posted by Danny Herran on May 3, 2011 in Backend | 3 comments

CodeIgniter Error Validation Class CodeIgniter lacks of an error handling class for custom errors. The Form Validation class is very nice for forms, the logs are pretty useful as well, but what happens when we need to handle our own errors?. Currently there is no official solution for this so I decided to take the matter in my own hands.

I present you the Error Validation Class.

Alternate row colors with pure CSS3

Posted by Danny Herran on Apr 29, 2011 in Frontend | 6 comments

Pure CCS3 Alternate Row Colors CSS3 is here. All the modern browsers support it, even the infamous Internet Explorer in its 9th version. In this small article we will learn how to alternate row colors in a table, or any other HTML element with pure CSS3. The best part is that you will be able to do it in just 2 lines. No more PHP hacks or JavaScript chunky chunks.

Exporting your MySQL table data with PHPExcel + CodeIgniter

Posted by Danny Herran on Mar 8, 2011 in Backend | 33 comments

PHPExcel + CodeIgniter Most of the time my clients need to download data from their database tables. Exporting to CSV is a pain in the rear for users and it leads to confusion (you know the colon and semicolon stuff). Today, I decided to make a very small controller that is portable and efficient for exporting full MySQL tables to Excel 2003 using PHPExcel and CodeIgniter.

63% of web video is HTML5 friendly

Posted by Danny Herran on Mar 2, 2011 in Frontend | No comments

63% of web video is HTML5 friendly According to MeFeedia, from all the web videos around the net, 63% of them are HTML5 friendly. For those on iPad or iPhones, it believe this is a very good thing. Flash is a thing of the past for watching videos on your smartphone or personal computer, considering a year ago the percentage of HTML5 compatible videos was just about 10%.

Facebook PHP SDK and CodeIgniter for basic user authentication

Posted by Danny Herran on Feb 24, 2011 in Backend | 211 comments


With CodeIgniter 2, plugins are no longer an option. Usually you would just add the Facebook PHP SDK as a plugin and you were good to go, but now, you need to make a little modification to the SDK in order to use Facebook Connect on your CodeIgniter application. Lets start by explaining what is, how to get started and how to authenticate an user using the Facebook API.

CodeIgniter 2.0 is out with cool features!

Posted by Danny Herran on Feb 13, 2011 in Backend | 4 comments

I know its a bit late, CI 2.0 has been out since January 28th, 2011, but lets talk about it anyway and recapitulate some of the new features of this framework. The new stuff is great, and this time I believe it deserves a second look if you are not much into CI.

Let me thank in advance the guys of the CI team for their great work.