Skip to content

Instantly share code, notes, and snippets.

@davereid
davereid / .gitconfig
Created June 1, 2011 23:44
git branch-diff
[alias]
branch-name = !git for-each-ref --format='%(refname:short)' `git symbolic-ref HEAD`
cd-root = rev-parse --show-cdup
branch-diff = !git format-patch --stdout $1 > `git cd-root``git branch-name`.patch
@davereid
davereid / gist:954384
Created May 3, 2011 22:18
Drupal 7: Entity and bundle select fields with AJAX dependent dropdown
<?php
function entity_bundle_ajax_form() {
$form['entity_type'] = array(
'#type' => 'select',
'#title' => t('Entity type'),
'#options' => array('' => t('- Select one - ')),
'#default_value' => '',
'#ajax' => array(
'callback' => 'entity_bundle_ajax_form_callback',