##Drupal
cache busting in Drupal
drupal_flush_all_caches()
drupal_clear_css_cache()
drupal_clear_js_cache()
getting the full URI of an image
$uri = $value->image['uri'];
$wrapper = file_stream_wrapper_get_instance_by_uri($uri);
$path = $wrapper->getExternalUrl();
##drush
finding that enabled module
drush pml --pipe --status=enabled | grep "name of module"
counting enabled modules
drush pml --type=module --status=enabled | wc -l
##shell
empty a file
echo > /path/to/file.ext
finding a file
ls -aR | grep -B 25 "^needle.php"
##MySQL
Quickly create a database and user for testing
mysql -u root -p
create database name;
grant all on name.* to name@localhost;
set password for name@localhost=password('name');
##PHP
Handy function for dumping variables
function log_to_file($text) {
$f = fopen('/tmp/mylog.log', 'a');
fwrite($f, date('Ymd H:i:s - ') . print_r($text, true) . "\n");
fclose($f);
}