:  @c0772 Oi - how did it taste going in to the fermenter? #homebrew in reply to c0772 3 days ago

Pear DB and “DB Error: already exists” On Insert

Posted June 23, 2010  |  Filed in: PHP, mysql    

Note that this post relates to using a MySQL database in conjunction with the PEAR DB module, or any other PEAR module that depends on DB - like DB_TABLE (which I’ve been enjoying).
You might run into this error if you switch over from using PHP’s built-in MySQL functions, over to a database abstraction layer, which [...]

Fancybox: Reload Parent Page When Closed

Posted June 15, 2010  |  Filed in: jquery    

How to get that darn parent page to refresh itself when you close Fancybox.

TextExpander Stopped Working? Try this.

Posted June 2, 2010  |  Filed in: OS X, gtd    

Suddenly I noticed that my beloved TextExpander just stops working/expanding for no apparent reason. Restarting the app didn’t work, but what does work is restarting Firefox.
I guess there’s some conflict between Firefox version 3.6.x and the TextExpander engine. So the quick fix seems to be to just restart Firefox when this happens.
Evidently, this isn’t fixed [...]

Baiduspider, Twiceler, and Yeti - Bad Robots!

Posted April 2, 2010  |  Filed in: Apache    

One of the websites I manage had been experiencing tremendous use in bandwidth. “Sweet!” we thought, a solid boost in traffic is a good thing. But as time went by, it kept going up and up in an unreal way - something was awry. After checking the log files, I saw that the 3 bots [...]

Drupal - Select List “default_value”

Posted March 29, 2010  |  Filed in: Drupal    

After beating my head against the desk the past hour, I finally figured out that to set a default value on a plain select list, you need to use “#value” and not “#default_value”. So, for example, say I have an array of banks consisting of the bank id and the bank name, like so:
$banks = [...]

Sizing and Positioning Fancybox

Posted February 15, 2010  |  Filed in: jquery    

You’ve probably seen Fancybox all over the place. In a way, it’s the living-successor of ThickBox and Lightbox.
I was recently on a project where I had to both size and place it. Sizing it it easy. Say you have a link tag with an id of opener, like this:
<a id=”opener” href=”http://www.google.com”>Google</a>
To create and size the [...]

Drupal: Redirecting a User After Login

Posted January 7, 2010  |  Filed in: Drupal    

This has me beating my head on the desk a bit. I’m coding up a Drupal 6 module, and wanted to redirect the user after logging in, depending on what role they belong to.
In this example, let’s say I have a role called “treasurer” - and anyone that’s logged in and not a treasurer is [...]

Tweeting from Launchbar

Posted December 7, 2009  |  Filed in: OS X    

I’ve been checking out Launchbar, thinking replacing my beloved Quicksilver because supposedly it is not being worked on much anymore. While viewing these very helpful Launchbar Video tutorials, I noticed one of them was about Tweeting from Launchbar. For firing off a quick tweet, this is very handy.
However, I had problems getting the script mentioned [...]

Finding Duplicates in MySQL

Posted November 25, 2009  |  Filed in: mysql    

I get quite a few Excel files from clients that need to get cleaned up and inserted in to MySQL. Sometimes the import goes smoothly, sometimes it doesn’t. This last time, I had 3,741 rows in an Excel file, but somehow wound up with 3,751 rows in the database - what went wrong? Don’t know, [...]

Easily Search a Twitter Stream

Posted November 18, 2009  |  Filed in: twitter    

I occasionally see people wondering how to search their Twitter stream, or anybody’s Twitter stream for that matter. Sure, you can easily search all of twitter for something, but what about limiting a search to a particular user? Twitter’s search features are pretty hit or miss for such specific searches, so as long as the [...]

Options:

Size

Colors