Category Archives: Snippets

Realtime Stats in MongoDB Example (PHP)

Ok so you’ll remember some time ago I talked about realtime statistics in MongoDB, right? Well here is a working version. This script basically records the basic statistics on videos. So this time I am going to skip why and how I made my document structure and just show you my document structure: This may [...]

PHP convert duration timestamp to date() syntax

I fond out while using: That it actually returns incorrectly. It would keep returning an extra hour. I found this was due to DST. So I quickly put my thinking cap on and botched together this: This function will now correctly convert any timestamp into the needed date notation with fear of DST or other [...]

PHP Upload Progress bar V2

Updated: The new update can now handle stopping uploads as well and extra validation and more robust scripting. Some of you will notice a long time ago I wrote a post on creating a upload progress bar in PHP. Well I have finally got round to recreating this script and I can thankfully say it [...]

PHP List of timezones (Not sorted by country)

PHP List of Facebook recognised IM Clients

PHP Countries and their call codes with two letter abbreviations

Mongo DB User session management script v3

Basic State Controller for a checkout

Get Tweets and cache in XML whilst staying under the API Limit

Edit: Added security features for judging when malicious tweets with dead links enter the XML. These links are designed to break XML web services to harm a site. We now test the xml and if it validates then write it to file. The view: The controller: The model:

Custom Error Handler Example

Follow

Get every new post delivered to your Inbox.