Skip to content

Instantly share code, notes, and snippets.

View mikl's full-sized avatar

Mikkel Høgh mikl

View GitHub Profile
diff --git a/menu_block.module b/menu_block.module
index 3925cdd..486da40 100644
--- a/menu_block.module
+++ b/menu_block.module
@@ -275,6 +275,11 @@ function menu_tree_build($config) {
if (!empty($patterns[$config['menu_name']])) {
$config['menu_name'] = $patterns[$config['menu_name']];
}
+ // If no match was found, fall back to the first candidate.
+ // This is a changed behavior form the standard behavior of menu_block.
diff --git a/menu_block.admin.inc b/menu_block.admin.inc
index 98f3bbb..143ed9a 100644
--- menu_block.admin.inc
+++ menu_block.admin.inc
@@ -423,7 +423,7 @@ function menu_block_configure_form($form, &$form_state) {
'#default_value' => $config['sort'],
'#description' => t('Sort each item in the active trail to the top of its level. When used on a deep or wide menu tree, the active menu item’s children will be easier to see when the page is reloaded.'),
);
- $form['parent_mlid'] = array(
+ $form['parent'] = array(
@mikl
mikl / index.js
Last active August 29, 2015 14:00
/*
Copyright (c) 2014, Mikkel Hoegh <mikkel@hoegh.org>
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
var Hapi = require('hapi');
var Joi = require('joi');
From 8c40a37f625ac0c7ba9811628f49c5ff540954e9 Mon Sep 17 00:00:00 2001
From: Mikkel Hoegh <mikkel@hoegh.org>
Date: Thu, 25 Dec 2008 16:27:41 +0100
Subject: [PATCH] Display time now only displays minutes and hours.
---
apps/tracker/models.py | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/apps/tracker/models.py b/apps/tracker/models.py
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
SELECT n2.title, n1.title FROM content_field_session_presenters AS cfsp
INNER JOIN node AS n1 ON cfsp.field_session_presenters_nid = n1.nid
INNER JOIN node AS n2 ON cfsp.nid = n2.nid;
-- Start with the session CCK table
SELECT u.mail, n.title FROM content_type_session AS cts
-- JOIN the node table to get users.uid.
INNER JOIN node AS n ON (cts.vid = n.vid AND n.status = 1)
-- JOIN the users table to get e-mail, name, etc.
INNER JOIN users AS u ON (n.uid = u.uid)
-- LEFT JOIN the user role filtering on the DrupalCon attendee role.
-- This means that users WITHOUT this role will have a null value in the result set.
LEFT JOIN users_roles AS ur ON (u.uid = ur.uid AND rid = 5)
-- Filter on accepted sessions and a NULL value in the rid field.
%s/\vtlf. (\d+) (\d+),/\1\2,/gc
%s/, e-mail /,/gc
%s/\v, (\d\d\d\d) ([A-ZÆØÅÉ])/,\1,\2/gc
%s/\v^([a-zA-Z0-9.'æøåÆØÅéü' &\/\(\)-]+) (\d+),/\1, \2,/gc
%s/, \+/,/gc
%s/,/;/g
%s/\v^([^;]+);([^;]+) (\d\d\d\d\d\d)/\1, \2;\3/gc
%s/\v^([^;]+;[^;]+;[^;]+);([^;]+;\d\d\d\d)/\1, \2/g
-- Alias all the fields we want.
SELECT cts.field_session_day_value AS session_day,
cts.field_session_time_value AS session_time,
cts.field_session_room_value AS session_room,
n.title AS session_title,
pn.title AS presenter_name,
td.name AS track_name
-- Start with the session table
FROM content_type_session AS cts
-- Get the main node data to eliminate unpublished nodes and the author uid.