Gmail Notifier Plus is a windows 7 only application that resides on your new taskbar. It provides you with the most basic of Gmail needs. Hovering over the icon will result in a popup window with which you can browse any new emails that you have and right clicking will pull up a jump list with tasks like “Compose”, “Go to Inbox” and even links to specific emails. If you’re a Gmail user on Windows 7, this application is definitely a must have.
Feature Friday – Rarst.net – PDF Creator
Whenever you need to make sure that something is going to look the same cross-platform (Linux, Windows, Mac) your best is always PDF’s. Most computers come with Adobe Reader or some equivalent to handle PDF files, and even gMail has incorporated its own online PDF reader. However, for some strange reason, windows doesn’t come with a way to change your files to PDF’s. There are numerous applications that do this, and PDF Creator is one of them. Check out the full post on Rarst.net
PDFCreator – virtual printer to create documents
I had thought for some time how should I organize jump from my report at work (beautiful mess of MySQL, PHP and my Google Charts class) to consolidated document.
I am no fan of PDFs, but they supposed to be made for such occasions. And aside from expensive editors fastest way to get PDF document is to use virtual printer like PDFCreator.
A Default Config.php For All Your Projects
Wheneve rI start on a php project, I include the latest version of my config.php file from my Snippets section. This file contains my most commonly used functions and serve as the base from which I build whatever website/application I am working on. Instead of re-writing my config files differently for each application, I have a common setup that works for me. Here’s what it looks like.
- Application Information
- Variables
- Functions
It’s very simple and I’ve included all the code below with numerous comments, as well as included the config.php file for download.
<?php /* * @file Config.php * @description contains all essential functions and configuration options */ /* * Logging Directory */ define('LOG_DIR','logs/'); /* * Enable Logging? */ define('LOG',true); /* * The database variables below configure the different databases. * To set the database use the $use variable * */ $db['dev']['host'] = 'localhost'; $db['dev']['user'] = 'root'; $db['dev']['pass'] = 'root'; $db['dev']['name'] = 'test_db'; $use = $db['dev']; /* * Default class loader. To ensure single instances of each class, never initialize a class * directly. Instead, use load_class(class_name) to initiate classes. * * @param string name of class to be loaded * @param string path to class with trailing slash included * @return object reference to object */ function &load_class($class,$dir = './'){ static $instance; if(!isset($instance[$class])){ if(file_exists($dir.$class.'.php')){ include($dir.$class.'.php'); $instance[$class] = new $class(); return($instance[$class]); } else error($class.' does not exist in the Library'); } } /* * Displays and optionally logs error messages * * @param string the message to be displayed * @param bool enables logging for particular message */ function error($message,$show = false){ if(LOG){ $file = LOG_DIR.''.date('d_m_y').'.log'; $fp = fopen($file,'a'); if(fwrite($fp,date('h:i:s a',time())."\t-\t".$message."\t".$_SERVER['PHP_SELF']."\r\n")){ fclose($fp); } } if($show){ echo '<div class="error">'.$message.'</div>'; } } ?>
The only things that I feel need some clarification is the load_class() function and the error() function. The load_class() function will accept two different arguments. The first one is necessary and is the name of the class to be loaded. The second is the path to the class. It is not required if the class is in the same directory as the page being run. You would use it like this:
<?php $myclass = load_class('myclass','path/to/class/'); ?>
The error() function also accepts two arguments. The first is the message that you want to be logged. The second is whether or not to force the system to display that particular message. Remember, you can still display a message a not log it. Logging is based on the LOG variable that is defined near the beginning of the file.
<?php error('This error message will be logged only!'); error('This error message will be logged AND displayed!',true); ?>

