This recipe is perfect for a quick dinner using leftover pork or chicken. The homemade Chipotle BBQ sauce is a perfect blend of sweet and spicy. And don't be afraid to get creative with the toppings!

2 and 1/2 pounds boneless pork or chicken
1 medium onion, diced
1 large potato
2 large carrots
2 teaspoons minced garlic
1 cup chicken broth
2 tablespoons packed brown sugar
1 tablespoon chili powder
1 teaspoon salt
1 teaspoon ground cumin
1/8 taspoon ground cinnamon
  1. Peel and dice the onion.
  2. Slice the potato and carrots

This snippet demonstrates how to create the CSS3 style sticky notes similar to those found on this site.

See a demo at

Personalized pancake

If you are a regular user of Microsoft's Windows operating system, then you have undoubtably been greeted with this popup:

Many languages support a control structure called the switch statement that is an alternative for if/else-if. Python, however, has no switch statement. Does that mean we must always resort to using a sequence of if/elif? Not necessarily! Python uses one of the most efficient hashing algorithms for it's dictionary type. We can use a dictionary to create a type of switch statement that is both efficient and very elegant. Consider the following sequence of if/elif to find a holiday for a given month.

Sometimes it is necessary to remove all (or some subset of) xml style tags (eg. <p></p>) from a string. If you're familiar with PHP, then you probably already know about the strip_tags() function. Here is a simple equivalent to strip_tags() written in Python.

Recently, while writing some automated tests for, I ran into some issues with CKEditor. We use CKEditor as the default wysiwyg editor on the site. When you configure CKEditor you attach it to a normal textarea element that is then hidden and replaced by the CKEditor field. In this post I will demonstrate how I implemented an custom element class to interact with CKEditor as if it were any other field.

By default Drupal sends an email as soon as you make a call to drupal_mail(). For relatively small sites this may never be a problem. However, if you run a large site with many users, then you need to develop a stratagy for controling how much mail gets sent at a given time. Imagine that you have a site where users can subscribe to be notified by email everytime you post a piece of content. When you have thousands of users subscribed, a ton of mails will be sent immediatly and php may time out as Drupal tries to process all of the subscriptions at once.


Subscribe to Caleb Thorne RSS