March 2011

Getting around FreshBooks’ recurring.update ‘frequency’ issue

I’m writing a few scripts which interacts with the FreshBooks API using a modified (by me) version of the Freshbooks PHP Library by Milan Rukavina. Using this library, to update anything, you first call the get() method which populates the appropriate class (e.g., FreshBooks_Client for clients and FreshBooks_Recurring for recurring profiles) attributes with the data. […]

Setting a Symfony database connection as default

The title of this post is a lie… There’s technically isn’t any way to set a database connection as the default one in Symfony (1.4, anyway). However, there is a nifty trick to making it the default. What is the default database connection? In Symfony, what I call the default database connection is the sfDatabase […]

Get parent function using debug_backtrace()

Sometimes, you need to know the name of the function that called the function you’re currently in. In my case, it’s a logging method in a class. PHP has the magical constant __FUNCTION__ that gives you the name of the current function, but nothing to get the calling function. You can use debug_backtrace() to get […]

A tragedy in Japan

Unless you live under a rock, you know about the magnitude 9.0 earthquake that hit Japan around 3 p.m. local time. The quake has caused many deaths, partial nuclear meltdowns, volcanic eruptions, and so much more. In fiscal terms, the Nikkei has dropped almost 5% since it reopened after the earthquake and forecasters are already […]

Reverse pattern matching in MySQL

Say, for instance, you have a table of patterns (in my case: billing rates by telephone prefix) and you need to compare a string (in my case: a telephone number) against the rates. Which should be returned is a single pattern which best matches the string so more specific patterns would be allowed. Here’s my […]

Get the last day of the month

Just ran into an issue where I needed to know the last day of the month in PHP. Sure enough, there’s a way. date(’Y-m-d’,strtotime(’+1 month’,strtotime(date(’m’).’/01/’.date(’Y’).’ 00:00:00’))-1); That line will output something like 2011-03-31. If you need just the Unix timestamp, you can just remove the date function. It’ll output something like 1301633999, which is 2011-03-01 […]

Creating database connections on-the-fly in Symfony

Symfony doesn’t have a documented way of created dynamic database connections. If I had to take a guess, it’s because database connections in Symfony don’t interact directly with the abstraction layer–the part that actually talks to the database–but instead interacts with the ORM layer–the part that turns results from the database into the objects you’re […]

Secure browsing and IM with Tor

The first I heard of the Tor network was on this TWiT episode when Xeni Jardin was talking about browsing privately outside (and inside) the US using Tor. We have a very secure firewall at work by one of the better companies in the industry, which blocks certain sites and ports including IM. So, what’s […]

A PHP autoloader

Today I started working on a small-scale business rule management system in PHP for a project. Part of it was creating an autoloader script which you place into the directory of files and include it into your PHP script. It’ll iterate through all the files in the directory and subdirectories to include all the PHP […]

Last.fm interface from fmTuner (modified by me).

Twitter interface from HL Twitter.

Dedicated to my mom, Sharon. May she rest peacefully.
Love you always. (March 23, 1965 - November 12, 2011)

Unsupported Browser!

My site is designed for and currently displays best with modern browsers (and it looks like you don't have one!).

Everything should still function properly, but you won't be able to see all the fancy effects, text, or the way I intended my design to look.

Consider trying the latest version of either Firefox or Chrome... I think you'll like it!

Logan Bibby

P.S.: You can continue viewing my site by clicking the "close" link and you'll never see this again. :)