Drush

If you are running into this error while using drush

Directory ..../drush/cache/default exists, but is not writable. [error] Please check directory permissions.

Run this to solve it


sudo drush version
sudo chown -R $USER ~/.drush

Some clever functions to check current users, subscribe to organic group etc

I have been building a custom module that has Inviting users to a group feature in it. So there are this helper functions that are very useful.

user_load_by_mail($invitee_email)

will check if there is a user with specific mail, returning false if it is not, returning user object if there is one user with that email

Drupal 301 redirect to another domain

This is not so much drupal but sometimes you will move your drupal site to other domain, so then to have your home and all other pages properly redirected add this code to your .htaccess file

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.some-domain.co/$1 [R=301,L]

Advanced modal forms - modal windows with CTools (singe and multistep)

So I client of mine wanted to use popups :) but not just ordinary popups, he wanted to put there, login, registration, node adding, notificiations, user invites for OG, simple menus and even FB login and registration. We also needed to save some user choices before the login/registration and act upon them after the user logs in.