Mobile Browser Detector Using PHP

Detect mobile browser and mobile user agents with a simple yet powerfull PHP function. This small yet highly effective PHP script detects mobile phone browsers on your website so you can redirect them to your mobile website or show them a different template. A quick, easy to use, solid and dependable PHP function to detect mobile browsers like iPhones, iPads, Androids, Windows Phones, BlackBerry’s and Palm devices which visit your website. From old legacy devices through to today’s hottest smartphones, they’re all detected.

Running Tornado Web Server On Heroku

Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed. By using non-blocking network I/O, Tornado can scale to tens of thousands of open connections, making it ideal for long polling, WebSockets, and other applications that require a long-lived connection to each user. We can running the web server on Heroku cloud application platform that support Ruby, Node.js, Clojure, Java, Python and Scala.

Block Several Email Domains from WordPress Registration

There are many spammers out there trying to register account on WordPress site installation. We don’t know if the spam is a human or bot machine. There is no a perfect way for combating the spammers even by using CAPTCHA, email confirmation, logical questions, and many several process of registration functions. This tutorial will give a basic explanation on how to block several email domains from registering account on WordPress based site.

MySQL Wrappers for Python

MySQL is the widely used open-source relational database management system owned by Oracle Corporation. It is a popular choice of database for use in web applications, and is a central component of the widely used LAMP open source web application software stack (Apache, MySQL, Perl/PHP/Python). Applications which use MySQL databases include: TYPO3, MODx, Joomla, WordPress, phpBB, MyBB, Drupal and other software. MySQL is also used in many high-profile, large-scale websites, including Wikipedia, Google, Facebook, Twitte, Flickr and YouTube.

Creating First Python Application Using Google App Engine

In this post we will use App Engine services from Google that provides a free playground for us to develop Python web applications. Google App Engine (often referred to as GAE or simply App Engine) is a platform as a service (PaaS) cloud computing platform for developing and hosting web applications in Google-managed data centers. Applications are sandboxed and run across multiple servers. App Engine offers automatic scaling for web applications—as the number of requests increases for an application, App Engine automatically allocates more resources for the web application to handle the additional demand.

WordPress Get Total Comment Count

WordPress has builtin function wp_count_comments to count total comments for a given post id or all comments. The function will return totals of moderated, approved, spam, trash, post-trashed and total_comments. But we can’t use the function for special case like if we want to result total comments for single and multiple category or tag. We should build our own database queries to get the results. Below are code snippets collection to get the total post or site comments and some special cases.

WordPress Comment Form with Twitter Bootstrap 3 Supports

WordPress has a builtin function comment_form to output a complete commenting form for use within a template. We can copy the function and create custom styles for our need. But instead of creating a new function, we can use WordPress filter and action to change it. The main idea of this post is to add Bootstrap 3 supports for the generated comment form by changing the form classes and layout. We will use this Bootstrap example because it is pretty much similar with the WordPress comment form. All the codes below can be paste in the current theme functions.php.

Create Back To Top Button For WordPress

Imagine we read a long post content and when we almost at the bottom of the page, it can be very useful if there is a link or button we can click to go back or scroll to top. We can use the scroll to go to the top, but this is not a good way for very long content. Here is how to create the back to top link without plugin or editing current template files. We will use smooth scrolling effect with jQuery for better user experience to avoid shocking.

jQuery Selects Elements by Attribute Selector

[toc]We can add an identifier to a element using attributes. Some older browsers did not support attribute for the purpose of styling documents, but with jQuery we can employ them regardless of the browser being used. When using jQuery attribute selectors, we should account for attributes that have multiple, space-separated values. Since these selectors see attribute values as a single string, this selector, for example, $(“a[role=’myrole’]”), will select <a href=”#” role=”myrole”>some text</a> but not <a href=”#” role=”myrole foe”>Some text</a>.

The Best WordPress Plugin for Table of Contents

For a long post content, it is better if we use table of contents to map our article section. Using headings as the content section title will help our reader known what they read. There are many WordPress plugins that create automatic table of contents with standard or extensive features. This article lists the best WordPress plugin for creating table of contents. We will review it by feature, the ease to use, and performance.

Virtualenv On Windows

What is virtualenv? It is a tool to create isolated Python environments. It creates an environment that has its own installation directories, that doesn’t share libraries with other virtualenv environments (and optionally doesn’t access the globally installed libraries either). This tool can be installed on Microsoft Windows operating system.

Get the First Paragraph as an Excerpt for WordPress

WordPress by default will generate the auto excerpt from the content with 55 words and if the amount is greater than that, then the string ‘[…]’ will be appended to the excerpt. If the string is less than 55 words, then the content will be returned as is. In other case, if manual excerpt was added to the post, it will be used as is instead of creating the 55 words.