Coding Archive

  • programming-php-thumbnail-with-php-logo-new

    Format bytes with PHP – B, KB, MB, GB, TB, PB, EB, ZB, YB converter

    Simple PHP function that formats the bytes to the desired form. Possible unit options are: Byte (B) Kilobyte (KB) Megabyte (MB) Gigabyte (GB) Terabyte (TB) Petabyte (PB) Exabyte (EB) Zettabyte (ZB) Yottabyte (YB) Function takes three parameter: (bytes mandatory, unit optional, decimals optional) PHP byteFormat...

    Full Story

  • programming-php-thumbnail-with-php-logo-new

    PHP: Loop through dates (from date to date) with strtotime() function

    This is very easy way loop through dates (from date to date) with PHP strtotime() function. This example only echo dates, but of course this model can be used more complicated situations. <?php // Set timezone date_default_timezone_set('UTC');   // Start date $date = '2009-12-06'; //...

    Full Story

  • postgresql-logo

    PHP Script to Generate PostgreSQL Table Partitioning (Part 2)

    As Part 1 (Howto create PostgreSQL table partitioning) shows, making of PostgreSQL partitioning needs a lot of SQL commands. So this Part 2 explains how SQL commands for PostgreSQL partitioning can be made with a simple PHP script. This example script make SQL for child...

    Full Story

  • console-thumbnail-new

    Google search from Linux and UNIX command line

    Today I started thinking that how cool is do some Google searches straight from command line. First I try to find some ready tricks from the Internet, but I couldn’t find quickly anything good. So I decide do a simple Bash function that can take...

    Full Story

  • programming-php-thumbnail-with-php-logo-new

    CSS compression with own PHP class VS CSSTidy

    It makes sense to optimize the site's cascading style sheets (CSS), as it pages load faster, and it reduce the amount of data transferred, and just combining css files could significantly reduce requests to server. So users benefit from faster page loads and webmaster of...

    Full Story

  • Prevent the browsers to use old cached CSS and JS files

    Prevent the browsers to use old cached CSS and JS files

    Browser cache is very useful when users download the same CSS and JS files multiple times. Some browsers, however, use the old CSS and JS files from the cache, even though they have been updated. This may lead to unpleasant situations, when the pages are...

    Full Story

Page 2 of 212