#glare

Blog
$ grep -r notifications_subscription_list_form contrib
contrib/notifications/notifications.module: $form['#submit'][] = 'notifications_subscription_list_form_validate';
contrib/notifications/notifications.module: $form['#validate'][] = 'notifications_subscription_list_form_submit';
$ 

Submit as validate and validate as submit. This is going to be interesting as I dig into the code.

Git checkout local repo from N days ago

Blog
git checkout @{two.days.ago}

If only there were a way to checkout files from the fuyoocha.

git checkout @{two.days.fromnow}

or maybe

git checkout @{two.days.aftercompleting}

Drupal 7 - get all terms for a node

Blog
Okay, you can use api.drupal.org/field_view_field, if you know all the various fields a node is using for terms and term references (reference):
$terms = field_view_field('node', $node, 'field_tags');
If you don't, load them all in one fell swoop (with lots of caching, please):
/**
 * Likely in hook_preprocess_node.
 */
function mymodule_preprocess_node(&$vars) {

  $multi = array();

  // get all the terms for this node, add status if desired
  $results = db_query('SELECT tid FROM {taxonomy_index} WHERE nid = :nid', array(':nid' => $vars['node']->nid));

  // loop over the terms for the tids
  foreach ($results as $result) {
    $tids[] = $result->tid;
  }

  // load all the terms at once
  if (count($tids) > 0) {
    $terms = taxonomy_term_load_multiple($tids);

    // and do shit with them.
    foreach ($terms as $tid => $term) {
      // in this particular case, push them onto an array to track in google analytics.
      $multi[] = array('_trackEvent', 'terms', $term->vocabulary_machine_name, $term->name);
    }
  }

  drupal_add_js(array('multi' => $multi), 'setting');
}

Yeah, just F that S

Blog

I put not much into this one. Fucking migraine.

f-that-mock

Though, you have to admit, not a completely bad design given the headache I have right now.

Update: Matthew thinks grey would be good, so now available in asphalt, too:

f-that-mock-asphalt

Yesterday's shirt: Cup o' Morning Joe

Blog

Clearly I needed the coffee from yesterday's shirt to get me going. Yesterday was a rough day, most of it spent thinking, "uhhhhhhhhhhhhnnnnnnnnn," and some of it spent thinking "uuuuuuuuuggggggggggghhhhhh." Surely, you've had those kinds of days, too, right?

cup-of-morning-joe-mock-white

cup-of-morning-joe-mock

Given that the Giants won the World Series and the site the shirts is on is GroundR, which is an early 2000s version of "grounder," a baseball term, I keep thinking I really need to do a baseball-themed shirt. I'm a design behind, and would like to catch up. If only Matthew hadn't inspired my next shirt already. Hoping the migraine that is clearly on its way holds off just a little longer for me to get that design out...

Pages