Back to top


Greggles, Gregorybeans, Frijoles, Beans

Discover It Card: Followup and reviews

The Discover It card launched late in 2012 (I wrote about it earlier).

When it first came out there was a heavy promotion of the card via multiple channels. They had tv videos and articles were written about it

One of the most interesting things to me about the card is the design on the front of the card:

Discover it card design

It's so basic and they moved the numbers/expiration etc. to the back of the card. Here's a video showing an unboxing of the Discover it card:

You can see at 4 minutes into the video as he shows the card the front is just plain and simple. A very clean design!

Here were the items he described during unboxing the card:

  • No annual fee
  • No late fee (only affects credit cards)
  • No foreign transaction fee
  • Paying late won't increase APR
  • 1% cashback on most purchases, 5% rewards program for certain purchases
  • Talked to a real person within 3 minutes of calling the company
People Involved: 

Matching accented letters and other fun stuff in PHP regular expressions like preg_match

I recently had to validate that input text included only letters, apostrophes and spaces including various accented characters. This was surprisingly tough for me to figure out in PHP.

Some good resources:

Ultimately what worked for me:

People Involved: 

Helpful functions for writing Drush commands

There are lots of great tutorials out there for how to use drush, but not as many about how to write Drush commands. I periodically dig in and find useful drush functions, but then forget them a month later when I'm writing a new drush command.

So, here is a helpful list of Drush-specific functions that will make your life easier.

  • drush_log - note that the second argument is the type of notice and it can be a 'notice' by default or 'warning', 'error', or 'success'.
  • drush_confirm - ask people if they want to do something. Users can override this by adding a "-y"
  • drush_prompt - prompt the user for some input like a filename or a date value
  • drush_choice - send the user a list of prompts like the 'drush cc' command presents you a list of caches you might want to clear out.
  • drush_user_abort - break out of a command if a user aborts the operation.
  • drush_get_option - check if the user provided an option on the command line like -h
  • drush_set_error - throws an error so the user sees it and the drush script ends with an exit status of 1
  • drush_print - prints out information

Some helpful resources:

  • The website is of course full of useful information
  • The Commands doc page ships with drush and is available on
People Involved: 

The History of Drupalcamp Colorado

  • In July 2007 we had a Drupalcamp at an office in Boulder (photo) with about 15 people. This was intended to cover more advanced topics than we got into at a normal meetup.
  • In November of 2007 there was a last minute camp that turned into an issue queue tutorial led by ajk.
  • In 2008 the camp grew to about 100 people at Denver Open Media's facility on Santa Fe
People Involved: 

Super Simple - Embed your form into facebook pages

Today I needed to embed (iframe) a web page into facebook. Pretty simple idea, really - doing so should help improve conversion rates for visitors who are landing from Facebook. And, of course I want to do it as simply as possible so we can test the idea before investing more time into fancier features this might have (a facebook-like theme, facebookconnect to pre-fill user data, etc.)

So...I did a ton of searches for how to create embed a page in a very simple way. I don't want to use an SDK. I don't want to have any OAUTH or interactions. Just show my page inside the facebook header and sidebar! to do it.

Facebook Static HTML Iframe App

Well, several tutorials and videos recommended using a third party app that would insert my iframe inside of the Facebook page.

This is indeed a very popular path to take. There are dozens of apps in use by tens of millions of people each month. WAT?

Of course, Facebook Canvas apps are just do I need an APP to iframe my iframe? And how safe is your data when a 3rd party iframe is around your site? No, this solution simply will not do.

Make your own super simple Facebook App

Here's what you want to do.

  1. Go to Facebook Apps site. You might need to agree to some terms of service or something.
  2. Click "Create New App"
  3. Fill in the basic info - skip hosting.
  4. Fill in the "Basic Info" section. If you are unsure, leave it blank or read the help blurb. All you really need is a Display Name and Contact Email.
  5. Check the green box for "App on Facebook"
  6. Input your site URL for the Canvas URL and Secure Canvas URL. On October 1, 2013 all apps will be required to have https.
People Involved: 

Jenkins + Drush + Dropbox = Easily share sanitized database projects

I recently wrote about setting up Jenkins. My next step was making it do something useful to help our team become more efficient. In most any team it's likely that you'll get some folks for whom "just use drush sql-sync" is not a reasonble solution.

My goal: get a database backup into dropbox on a regular basis and make sure no sensitive customer data is in that backup.

Make a Database backup of the live site

We're running jenkins on a non-production server (for a variety of reasons). So, we get a backup of the live database into a temporary scratch database using the drush aliases feature. That process sanitizes it a bit using the sql-sanitize feature of drush. Then we dump out that database.

  1. Start with an up to date checkout of your live site's Drupal code
  2. Use the multisite feature and create a sites/ where the $databases array has a set of read-only credentials to the production database
  3. A second "site" at sites/example.scratch/settings.php
  4. Setup a Drush alias that points to those two sites inside the Drupal - be sure to use the 'uri' element so that drush knows which set of credentials to use inside the sites/ folder:

    $aliases[''] = array(
    'root' => '/var/lib/jenkins/example_scripts/example_com_checkout_for_drush/',
    'uri' => 'example.backup',
    $aliases['example.scratch'] = array(
    'root' => '/var/lib/jenkins/example_scripts/example_com_checkout_for_drush/',
    'uri' => 'example.scratch',
  5. The example.scratch credentials should point to a "scratch" database that is used just for these purposes.
  6. Finally a line in the Jenkins job to copy the database from the live site to the backup.
    drush sql-sync @sitename.backup
People Involved: 

Using Drupal's Meta tag module for Facebook Open Graph, Google rel=author, and Page titles

Meta tags have gone back and forth in terms of their usefulness for promoting your site. In the late 90s they were a way for nascent search engines to easily categorize sites, then they were abused for keyword stuffing unrelated to page content and their use waned, but they are back again with three major purposes: Facebook Open Graph, Google Authors and Page titles. These are not necessarily "SEO" purposes, but the goal is ultimately the same: making sure that your site puts its best foot forward to gain new visitors.

Metatag module setup

The basic Metatag module setup is pretty straightforward. Download the latest version from the metatag project page. If you don’t have them already you will need the CTools and Token modules.

Setting up Metatag for Facebook Open Graph

There were a few different things I wanted to achieve with the Facebook Open Graph support. Basically, whenever someone includes our page on Facebook I wanted to make sure that the title, description text, and image that Facebook pulled in were the best possible images. I expect that most of the "liking" will occur on our card landing pages. So, I enabled the "Meta tags: Open Graph" sub-module that is included in the main Metatag module. Then I added a meta tag default for the "Campaign" node type by clicking on the bright "Add a meta tag default" at the top of the page on the page at Administration - Configuration - Search and metadata - Meta tags.

People Involved: 


Subscribe to RSS - Greg