Skip to content

Instantly share code, notes, and snippets.

View rachellawson's full-sized avatar

Rachel Lawson rachellawson

View GitHub Profile
@rachellawson
rachellawson / gist:3533696
Created August 30, 2012 17:10
.profile create taxonomy terms
function mundi_install_tasks($install_state) {
$tasks = array (
'mundi_create_terms' => array(
'display_name' => st('Create taxonomy terms'))
);
return $tasks;
}
/**
* Implements hook_install_tasks() callback
@rachellawson
rachellawson / xxxxx.install
Created August 30, 2012 17:12
How to run another profile from this one...
/**
* Implement hook_install().
*
*/
function mundi_install() {
include_once DRUPAL_ROOT . '/profiles/standard/standard.install';
standard_install();
}
@rachellawson
rachellawson / gist:3553071
Created August 31, 2012 14:02
Why doesn't this return a date in September??
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$(document).ready(function() {
var _date = new Date();
_date.setMonth(8);
_date.setDate(10);
@rachellawson
rachellawson / gist:3621319
Created September 4, 2012 13:50
Adding current taxonomy terms to body.classes
/*
* Lookup the taxonomy terms that are relevant to the supplied node
*/
function taxonomy_node_get_terms($node, $key = 'tid') {
static $terms;
if (!isset($terms[$node->vid][$key])) {
$query = db_select('taxonomy_index', 'r');
$t_alias = $query->join('taxonomy_term_data', 't', 'r.tid = t.tid');
$v_alias = $query->join('taxonomy_vocabulary', 'v', 't.vid = v.vid');
@rachellawson
rachellawson / hook.profile
Created October 29, 2012 11:31
profile form defaults
/**
* Implements hook_form_FORM_ID_alter().
* Our usual defaults for a new site
*/
function hook_form_install_configure_form_alter(&$form, $form_state) {
$form['site_information']['site_name']['#default_value'] = 'Site name';
$form['site_information']['site_mail']['#default_value'] = 'site@email.com';
$form['admin_account']['account']['name']['#default_value'] = 'username';
@rachellawson
rachellawson / .gitignore_global
Created February 3, 2013 11:00
Ignore file tailored to ignore Drupal sites folder created locally by Acquia Dev Desktop when building projects locally
#Mac things
*~
.DS_Store
#Ignore folders created by Acquia Dev Desktop
/sites/*
!/sites/default
!/sites/all
@rachellawson
rachellawson / agile.md
Last active December 14, 2015 04:39
My Agile talk at DrupalCampLondon... yes, I really am going to talk without slides, if I don't chicken out...

#Agile Project Management: It’s not the what, it’s the why...

##Introduction Rachel Lawson, director at Open Development Limited previously working as Software Engineer etc at Napp Pharmaceuticals Worked in an Agile but highly regulated environment for 13 years

##Why this talk? Hear many people talking about some of the tools of Agile but little about the principles and the values of Agile For me, they are the big deal!

@rachellawson
rachellawson / .bash_profile
Created March 7, 2013 11:03
Bash Profile I use
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"
@rachellawson
rachellawson / dsdm_membership_line_item.module
Created March 14, 2013 22:06
My childish attempts at creating a custom line-type
<?php
/**
* @file dsdm_membership_line_item.module
* Defines the line-item-type for the DSDM Memberships
*
*/
/**
* This function simply returns information about the example to help the
@rachellawson
rachellawson / gist:7006752
Created October 16, 2013 12:14
find user accounts created by bots that have same first and last names and then disable
update users
join field_data_field_first_name first ON entity_id = uid
join field_data_field_last_name last on last.entity_id = uid
SET status = 0 where first.field_first_name_value = last.field_last_name_value;