Posts Tagged ‘snippets’

Calculate Central European Summer Time (CEST)

Tuesday, March 9th, 2010

Countries of the European Union add an hour to the time during summer to better seize sunlight, so for several months GMT 0 becomes GMT +1, GMT+1 becomes GMT-2 and so on. This is known as Central European Summer Time (CEST). This script takes a Unix timestamp and adds an hour to it (3600 seconds) if we are in this summer period.

Tags: ,
Posted in Snippets | No Comments »

Zodiac Signs

Tuesday, March 9th, 2010

Updated from the "Zodiac Signs" function already posted here. The other function had some overlapping month/day areas that would determine some birthdate/sign combinations incorrectly. (ie: 10/27 as Libra instead of Scorpio.)

Tags: ,
Posted in Snippets | No Comments »

OddEven Class

Tuesday, March 9th, 2010

Allows you to easily keep track of a series of items as either odd or even. Each time you check (using the "which" method) the counter increments so that the next time you check the state will have changed. This is the perfect class for using when you're outputting an HTML table and want to use different classes to differentiate between odd and even rows. Simply create a new instance and call OddEven->which() for each row!

Tags: ,
Posted in Snippets | No Comments »

File size of a string

Tuesday, January 12th, 2010

Using a string of text, find out how many kilobytes or bytes the string would and/or will take up in a file if it gets saved.

Tags: ,
Posted in Snippets | No Comments »

Mail from your php code

Wednesday, December 16th, 2009

This script will be used to mail someone from your code

Tags: ,
Posted in Snippets | No Comments »

MB CopyMCF-DIR :: Copying or Moving Files and Child Files from Source Dir to Destination Dir

Saturday, October 31st, 2009

Copying or Moving Files and Child Files from Source Dir to Destination Dir

Tags: ,
Posted in Snippets | No Comments »

Detect if a Date is a Holiday (Portuguese example)

Saturday, October 31st, 2009

Detect whether a a specific date is a holiday.

Tags: ,
Posted in Snippets | No Comments »

Really useful code for chatting

Friday, October 16th, 2009

Code for chatting with others across the internet.

Tags: ,
Posted in Snippets | No Comments »

Upper/Lower Case Accented Characters

Friday, October 16th, 2009

Convert a string with accented characters to uppercase or lowercase.

Tags: ,
Posted in Snippets | No Comments »

convert plain html into xhtml

Wednesday, September 2nd, 2009

Tries to make out of the given string a xhtml-compatible string, that means that the return-string could be wrapped within a xml.

Tags: ,
Posted in Snippets | No Comments »