Archive for August, 2008
Aug 05 2008
I previously used the service from addthis but never really liked it so I created my own, you’re free to use it if you like. It’s a simple script that is quite easy (guess it depends on who you ask…) to use and that generates bookmark/share buttons for popular services such as delicious, digg, facebook, twitter and more.
Supports Delicious, Digg, StumbleUpon, Twitter, Technorati Favorites, Google Bookmarks, Facebook, Reddit, Diigo, Blogmarks, Blinklist and Magnolia
This is a sample of how the bookmark bar could look, it’s possible to re-arrange and remove individual services if wanted. The icons are courtesy of http://fasticon.com/freeware/index.php/web-2-icons/
Follow this guide to get your own bookmark bar, you need some knowledge of how to edit HTML.
If you ever worked with threads and particular work queues you know how convenient they can be.
Consider the following scenario. Actions and inputs from a web page triggers something that might take a (very) long time to execute and if executed during the browser session which besides annoying the user who has to wait for a page to load, might cause a time out and interrupt the processing. How do we solve this?
The preference system consists of multiple stores or trunks, each store is identified by a unique, arbitrary string and each store has multiple key-value pairs. The key-value pairs are dynamically created and flushed to database when the preference object is destroyed or when an explicit flush is requested.
This is an extensible object oriented wrapper around the MySQL and MSSQL (Microsoft SQL Server) interfaces provided by PHP. I’ve been using them for a while, it’s nothing new and no rocket science but others might find them useful.
Having a consistent interface will obviously help if you are using multiple types of database servers or someday would like to migrate to another SQL server (of course, weird and vendor specific SQL code could be a problem in this case). Other advantages are things like automatic disconnection on object destruction etc.
The foundation is an abstract class called SQLConnector and provides the basic interface. The class will connect to the database on creation and disconnect when the object is destroyed, it also implements __sleep and __wakeup so that it’s possible to serialize a SQL connection.
Because SQLConnector is abstract one can’t create objects directly from it, we’ll create child classes for each type of SQL-server we want to connect to. These objects will share the same interface and can be used interchangeably.