PinoyTech.org

CodeIgniter, Kohana, Mootools, jQuery and CSS

List dates between specified dates

Posted by teejay on March 14, 2010

I recently had the need to list dates between specified dates for an application. I created a function for doing some sort of date lister. I just wanted to share it.

The Right Way to Get a File Extension in PHP

Posted by teejay on November 29, 2009

I made a recent search on retrieving file extensions in PHP.

I found out that a lot have been re-inventing the wheel. They have been creating code for functionality that PHP already has. This is one example of re-inventing the wheel

function get_file_extension($file_name) 
{
    return substr(strrchr($file_name,'.'),1);
}

Another example was this:

function file_extension($filename)
{
    return end(explode(".", $filename));
}

PHP already has a function that does the same thing and more.

How to Disable Image Caching

Posted by teejay on November 28, 2009

Browser caching is useful. It lets you load pages faster by storing cache-able files on your computer. If you have a slower internet connection, this will most likely be helpful to you.

However, the problem arises if you a programmer that needs images to be fresh. I've recently creating a image manipulation program and needed to the images NOT to cache. Here's a trick to do this:

Check One Check All Using jQuery

Posted by teejay on November 25, 2009

an image of a table with checkboxes

Today, we will be writing a jQuery Example of our Check One Check All functionality using Mootools

Check One Check All Using Mootools

Posted by teejay on November 24, 2009

an image of a table with checkboxes

Imagine going through a 25 item per page application and you need to check them all. Wouldn't it be a good thing if you have the functionality of a check one/check all for checking all those checkboxes? If yes, you would agree that this should be on every appropriate web application.

Add Icons to External Links with Mootools and CSS

Posted by teejay on November 17, 2009

A trend going on around on websites are putting icons on links that point to web pages externally. If you want that on your site, this simple script will dynamically take care of that for you with the help of Mootools, a compact Javascript Framework and some CSS.

How to Gzip your Site

Posted by teejay on November 16, 2009

Gzipping as many file types as possible is an easy way to reduce page weight and accelerate the user experience. -Yahoo Developer Network Blog

Gzip is one of the most popular ways to compress site components resulting in a faster loading website or webpage.

Do you want to speed up your website via gzip.? Who doesn't want that? So, here's a way.

CodeIgniter AJAX Helper

Posted by teejay on November 13, 2009

This is a quick post on how to recognize AJAX Requests.

<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

function is_ajax()
{
    return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest';
}

?>