One of the important tasks in any web application is proper sanitization and standardization of data. Any data stored in a database should be in a standardized format, specially data that comes from a variety of sources.
Scrubbers or data cleaners are an important part of the data transformation process. Whenever you are involved in some data import or export process, data scrubbers can help you clean and standardize your data elements before storing.
Referrer spam has always been a nuisance, specially if you have some traffic restrictions on your hosting. The referral traffic robs your site from the precious bandwidth allocated (also know as Bandwidth Theft). Also with a large number of spam traffic, legitimate users will be greeted with a slow and sometimes non responsive site.
Htaccess enables one to block certain referrer sites and prevent referrer spam. The following post list some techniques to do so. One way to prevent referrer spam is to force a error and stop any further redirection. Note that the following requires that ‘mod_rewrite’ is enabled on your server.
Over the last few years I’ve received quite some queries regarding the article Downloading Gmail attachments using PHP published here. After procrastinating for some time (a long time actually), I’ve answered some of the queries in this updated post.
As mentioned in the earlier post, automatically extracting attachments from Gmail can be important for reasons where you need to process the attached files periodically with a CRON job or need to process the files programmatically. Also it can be useful for automatically archiving important attachments.
Bower is a package manager for the web and offers a generic solution to the problem of front-end package management. For example the Polymer library uses Bower for package management. In fact, the primary reason for me to install Bower was to use Polymer. The main difference between Bower and pther package managers is that Bower will manage any packages, even if that means HTML, CSS, or images. In this case, a package means any third-party code, usually publicly accessible from a Git repository.
A couple of years back if you needed to run PHP on Google App Engine you were required to use a open source tool like Quercus, a 100% Java implementation of PHP, to run your PHP applications on the App Engine. However, as you would have guessed, it was not easy to work as with using a native PHP implementation. Now that App Engine natively supports PHP and MySQL, you can easily write PHP applications.
Descriptive statistics can be quite useful for simple analysis of records in a database. For example, to calculate average numbers of sales or products for a particular duration, or the Variance of sales for a month etc.
We can easily calculate standard descriptive statistic measures in MySQL such as MEAN, SUM, STANDARD DEVIATION, VARIANCE, MIN and MAX using built-in functions. Below is a sample student table with student id and scores which we will use for calculating descriptive statistical measures.
Developers have a lot to consider when it comes to the user experience: making sure everything works, how intuitive it is to use, and that it beats the competition. But one thing that developers have to consider now on top of everything else is how to deliver all of these same variables in a pocket-sized, mobile format.
Having a mobile app is something that users expect from brands now, and it’s a big part because the rising level of reliance on mobile devices. Mobile functionality is something that’s impossible to ignore, and in order to develop properly for it, you need to understand who’s going to be using it.
With multiple versions of a site now common, it is important to redirect to the appropriate version depending on the type of device the user is using. For example if a user is viewing a website on a mobile device, we should be able to redirect to a mobile friendly version of our site. For this purpose we should be able to detect the device the user is using and act accordingly. This is where mobile detection libraries come in handy.
Date manipulation is a common programming task a developer does regularly and many times can get tricky and cumbersome. If youy web applications relies heavily on date manipulation on the frontend than moment.js is the library you have been looking for.
In short this is what you can do with moment.js
moment("20111031", "YYYYMMDD").fromNow(); // 2 years ago moment().endOf('day').fromNow(); // in 2 hours moment().startOf('hour').fromNow(); // 9 minutes ago moment().subtract('days', 6).calendar(); // Last Wednesday at 10:09 PM moment().add('days', 1).calendar(); // Tomorrow at 10:10 PM
The Web Speech Synthesis API allows your web apps to convert page text or any other predefined or dynamic text to be rendered to speech. Although currently supported only in Chrome 33, the api enables you to add nice accessibility support to your web apps. However, I’m hard-pressed to find a suitable application for the use of it, besides maybe online games and browser slideshows with background commentary. A demo is given below.