Archive for July, 2007

Redirect a www prefixed site to a non-www prefix

Tuesday, July 10th, 2007
No Gravatar

I like clean URLs.

(more…)

Bookmark it del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Propeller | Yahoo


Nicer Pagination with ADOdb

Saturday, July 7th, 2007
No Gravatar

Or should that be Nicr? To follow in an annoying theme.

Olavo Alexandrino wrote a nice well rounded class for record set pagination in ADOdb. If you’ve ever used ADOdb’s version, you will know it is not very good, to say the least.

Although Olavo did a fantastic job on the logic, the presentation left a little to be desired from my perspective.
I am providing my modifed version for download below, it provides a few logic updates and better presentation.

(more…)

Bookmark it del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Propeller | Yahoo


Idiot Proof Lightbox

Saturday, July 7th, 2007
No Gravatar

I’ve just made some modifications to my Gallery code which is part of i9000’s small site CMS software.
It adds some client side logic to make sure the images Lightbox 2 creates fit the users screen perfectly. Previous to this some customers were complaining that the images they uploaded were too big for their visitor’s screen.

This allows us to present the largest possible image to the user without scrolling around the page.

(more…)

Bookmark it del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Propeller | Yahoo


Poor mans currency conversion

Tuesday, July 3rd, 2007
No Gravatar

I recently completed a project that required currency conversion. I was limited what I could get out through the corporate firewall, so I came up with this.
It connects to Yahoo! with curl and reads a CSV string into memory.

(more…)

Bookmark it del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Propeller | Yahoo


Read a file into an array

Tuesday, July 3rd, 2007
No Gravatar

Here’s something that puddled me for a while…

$filename = 'file.txt';
$file_handle = fopen($filename, 'r');
$data = '';
while(!feof($file_handle)){
$data .= fgets($file_handle, 1024);
}

Bookmark it del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Propeller | Yahoo


Converting XLS to CSV. Simple, eh? Well, sorta.

Tuesday, July 3rd, 2007
No Gravatar

I hate problems that can be solved really easily. (With a totally different set of tools). I needed to open Excel (XLS) files in PHP. Simple enough you think, IF you are using Windows.

IF I was using Windows, I would have a bunch of options open to me, I could use PHP’s COM & .NET functions. Or PHP’s ODBC functions. Or a selection of classess from PHP Classes. (more…)

Bookmark it del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Propeller | Yahoo


NTLM Authentication (Active Directory) on Apache (Linux)

Tuesday, July 3rd, 2007
No Gravatar

Here is a quick guide to enabling NTLM authentication for Apache 2.
I generally use Ubuntu, so I am a heavy apt-get’er, but I prefer to build my apache from source. (more…)

Bookmark it del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Propeller | Yahoo


Apache2 mod_deflate

Tuesday, July 3rd, 2007
No Gravatar

The mod_deflate module provides the DEFLATE output filter that allows output from your server to be compressed before being sent to the client over the network.

Lazy man’s description, your pages load quicker. (more…)

Bookmark it del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Propeller | Yahoo


Card Reader Annoyances

Tuesday, July 3rd, 2007
No Gravatar

My new Dell computer came with one of those 1,600 in 1 internal memory card readers. The 1,600 drives in ‘My Computer’ really irritated me.

OK, so I exaggerated slightly. But the extra 3 drives did irritate me. My cameras use SD cards so I can safely disable the ones I don’t use. (more…)

Bookmark it del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Propeller | Yahoo


Apache, JungleDisk and Port 80

Tuesday, July 3rd, 2007
No Gravatar

I was tearing what little hair I have trying to solve a very strange bug on Windows with Apache 2 & JungleDisk.
(Yes I use Amazon’s Simple Storage Service for all my backups).

I was getting the following errors in Event Log, for what appeared to be no reason.

The Apache service named reported the following error:
>>> (OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : make_sock: could not bind to address 0.0.0.0:80 .

The Apache service named reported the following error:
>>> Unable to open logs
(more…)

Bookmark it del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Propeller | Yahoo