Some People Have Two Problems

Some people, when confronted with a problem, think, “I know, I’ll use regular expressions.” Now they have two problems. Some people, when confronted with a problem, think, “I know, I’ll use binary.” Now they have 10 problems. Some people, when confronted with a problem, think, “I know, I’ll use threads.” Now two they hav erpoblesms. […]

Your First Python Package

Creating a Python package, as I’ve found out while writing this post, is much more easy than I expected. Or, atleast, as far as I’m concerned. This “guide” will get you as far as your first distributable. Other meta data, registering and uploading to PyPi, and such can be found at various resources across the […]

Changing application names in Symfony

It’s generally frowned upon in Symfony to change your application’s name. To be honest, I thought it was just going to be a lot of hassle. Thankfully, it wasn’t and here’s how to do it: First, rename the application directory to reflect your new application’s name. The directory will be in < sf_root >/apps/. In […]

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 […]

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);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 […]

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 […] 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. :)