Code

Introduction

When working with multiple terminal sessions, quickly identifying which process is running in each window becomes critical. By dynamically setting the window title to include the current running foreground process and its arguments, developers, system administrators, and power users can improve their workflows and...


Introduction

If you have ever tried to inspect an autocomplete dropdown, tooltip, popup, or similar dynamic elements in DevTools, you've probably hit this frustrating problem of them disappearing. This usually happens because the UI element is tied to focus, hover, or keyboard input listeners.

The moment you hit CTRL+SHIFT+C or even...


Introduction

During the development and testing phases of a website's frontend, finding and fixing horizontal overflow issues can be challenging.

In some cases, it might be easy via DevTools to find and select the element that is wider than the document is and then fixing its CSS accordingly.

Most times though such elements are...


Introduction

Custom website theme development in Drupal 7 is, basically, where you define how each element and part of the website will look to the end user. This is done via manipulating theme files and writing our own custom web theming code in HTML, CSS, and JavaScript.

Luckily for us, Drupal is a well organized framework and...


Introduction

If you want to declare an array as a constant in PHP, you need to look further than what PHP provides as standard. Technically, if you look at PHP's Constants Syntax, it's not possible to define an array as constant, except from PHP 5.6 onwards. As of this writing, PHP 5.6 is still not widely available, and hence here's...


Introduction

In a previous blog post, we explained what hierarchical paths are, gave examples, and solved a problem with the pathauto module of Drupal 7 that caused certain links to contain a buggy "front" slug.

In this blog post, we will go deeper into all the issues that come with implementing a proper URL paths hierarchy in Drupal...


Generating hierarchical paths in Drupal 7 based on the pathauto module is not an easy task. First, in a nutshell, hierarchical paths are ones that follow a certain hierarchy, a tree structure, or even called multi level or multi depth. For example...


Introduction

As soon as you start developing reliable websites in Drupal 7, the need to create custom modules arises. There will be plenty of situations where you need to create custom hooks to handle certain business requirements for your Drupal website; and those hooks have to live inside a custom module. For example, check our...


Preventing your Drupal 7 website editors from deleting content, under certain conditions, is not that difficult if you know the proper Drupal hooks to use. However, finding those hooks isn't easy and we're sharing this blog post with you in the hope that it will save you a few programming headaches...


If you're looking for a well written and tested function to recursively retrieve all child menu items in Drupal 7, you've come to the right place. All you have to do is pass it a valid node path such as 'node/123'.

The terminology you use might differ. You might call them sub menu links, deeper level menu links, sub nodes, or links...


The time() function in PHP returns the current Unix timestamp; which is the time measured in the number of seconds since the Unix Epoch. Very useful in certain cases, but not always. This function, like most other PHP functions, is also cross platform compatible as it works on Unix, Linux, Windows, and Mac.

PHP's microtime()...


Securing Zend Framework

If you have a PHP web application built using the Zend Framework, securing all its pages becomes very easy. You just go ahead and add the following tiny function to your Bootstrap file:

[CODE]

What this does is that it captures any non-secure request (Over plain HTTP) and redirects it to HTTPS (HTTP Secure). As...


Introduction

Generating ANSI (or ASCII) command line colors, or terminal colors, or whatever you call them, is easy with PHP. As I have said in my previous post, ANSI Command Line Colors under Windows, having colored text in the command line is a great help for spotting error or success messages. So here’s a quick and dirty function...


Introduction

Zend Framework is currently one of the best MVC-based frameworks in the PHP world. Zend_Mail is part of Zend Framework and it provides the ability to easily send email messages. If you’re like me, most web applications you have developed are setup to use Google Apps as their email provider. Here’s how to send email...


Introduction

You are programming in PHP and you have an array variable that you'd like to explore at different execution paths. Of course, the best way is to use a PHP debugger like xdebug or Zend Debugger, but, what happens when you're too lazy to install a debugger? What happens when you don't want or can't install a debugger and...


Hello World!
August 02, 2010

We are Online!

The ubiquitous Hello World post is here to stay. For the sake of programming traditions, we're not removing it. But we do promise that our next posts will be more useful.

Below is a list of Hello World program examples in our favorite programming and markup languages. Consult Wikipedia's Hello world program page if...