User login

how to

Create rewrite rules from new and old URLs using the power of Vim to munge text

As part of the move of Agaric content from to, we needed to create a bunch (1,592 to be precise) redirects that look like this one:

RewriteRule ^nice-menus-drop-down-bug [NC,R=301,L]

Stefan, in his wizardry, had already pulled a tab-separated-value file of the old path to the new URL, so that what we had was:


Path to Drush

export PATH=$PATH:/usr/local/share/php/drush

via http://www​.mediacurr​​ogs/learni​ng-how-ins​tall-drush​-non-admin​-rights-se​rver

Harmless Git weirdness: git rm -r does not delete physical files, but doesn't list them as untracked either

Somehow, in git 1.6, after running git rm -r example to get rid of a directory (called example), it leaves the files there but from then on ignores them. git status lists nothing, ls shows the directory example is still there, and then rm -rf example removes the directory and git status still shows nothing.

Much smarter command line history up/down behavior - with search

You may know about ctrl+shift+R for reverse case-insensitive search (or whatever it stands for) and that is still useful if you remember one very unique keyword from the middle of a command.

Drupal Hooks: A Brief Introduction

Hooks in Drupal are a way of triggering code to run based on naming convention.

This simple and powerful system is a key way in which you or other developers can extend Drupal.

There's more than one way to span a date...

In theory you can put HTML code right into a custom date format declaration. Actually, this did not quite work for some reason... somewhere in class year the code just gave up and pled for mercy.

\<\d\i\v \c\l\a\s\s\="\m"\>M\<\/\d\i\v\>\<\d\i\v \c\l\a\s\s\="\d\y"\>d\<\/\d\i\v\>\<\d\i\v \c\l\a\s\s\="\y\r"\>Y\<\/\d\i\v\>

Slick top-level-domain style URLs for your local development sites on Ubuntu (and Mac OS X running Ubuntu in a VM)

In order for the cool style addresses for sites you are developing locally (rather than from my Mac OS X environment as well as Ubuntu running in a virtual machine, this method uses the IP address available locally that you can find out by typing ifconfig in a shell terminal. It's what follows the text "inet". With luck that is a stable IP address, running in bridged mode (i think) with VMWare Fusion this seems to be working so far. The problem with bridged mode is that it only works with your own internet connection.

Get a Git diff of the previous commit

Getting a diff (patch-file style display of changes) from a your most recent commit is useful when you commit and it lists three lines changing in a file instead of one. Of course, you should have run git diff --cached before git commit -m "I know what I'm doing.", but when you haven't, or have another reason to take one step back in the history of your work, here is the command that saves looking up the git commit hash.

git diff HEAD^ HEAD

Override Panels 3 layout theme templates

To theme a panels layout you simply copy a .tpl.php file from modules/panels/plugin/layouts/[tempate_name]/panels-[template-name].tpl.php
to your theme directory (or any subdirectory of your theme directory.

Note that the CSS file is not overridable the same way.

Boost caching: what refreshes it and how?

A normal (node) page triggers the Drupal-integrated Boost cache to expire and replace the page whenever you edit it. Editing a view unfortunately does not have such triggers. In this case the views are attached to a node, so simply resaving the node rebuilds the cache.

In most cases the view itself will not be modified, rather, you will add or edit a node associated with a view which also refreshes the cache for that views pages. (Note this takes a bit of processing to look up, and i don't think it will apply for blocks.)

Syndicate content