User login

Public

SEO and Meta Tags

(to a client, part of a long e-mail on doing their site. They had written that SEO would be easy because we could just grab the meta tags from the old site.)

A note on SEO:

Meta tags are, by and large, irrelevant to modern search engine results because they were abused so much in the past. The description meta tag, though, is quite important not for ranking, but because Google uses it as the text below the link that people can read before deciding to click through to your site or not.

Move spreadsheet rows or columns with drag & drop in OpenOffice on Mac OS X

fn control option are the keys to hold down while dragging and dropping to move and insert rows or columns in Open Office Calc on a Mac!

Auto-expand abbreviations in Vim

vim autocomplete, or really, autoexpand abbreviations

All about shortcuts as well as abbreviations: http://www.linux.com/archive/articles/54936

To set abbreviations only for insert mode (which seems a little safer) add to your .vimrc file (or in Agaric's case, an included .vimrc-agaric file with all our Drupal and other development-specific additions) abbreviations in the format iab abbr abbreviation.

Drupal's Enable hook can be tucked away in the .install file

A cool thing about hook_enable is that Drupal can find it in your .install file, even when the module has already been installed and you are just enabling it.

(As evidenced by implementation of hook_enable in comment.install and all over contrib dot install files.)

So you can keep it out of your main .module file and throw it in your .install file.

Drupal's hook_enable can be in .install.

Convert an associative array to variables with the names of the keys and the matching values

php turn an array into variables matching keys
php associative array to variables

The function you want is

<?php
 extract($array);
?>

http://us.php.net/extract

You can also do it the hard way.

bash "No such file or directory" error even though .bashrc has proper include path

bash "No such file or directory"

Every time I opened Terminal:

bash: /home/ben/.bashrc-agaric: No such file or directory

But my ~/.bashrc was clear of calling that file.

And source .bashrc produced no errors. So where was it still calling the old file path?

Answer:

sudo vi /etc/bash.bashrc

(On Ubuntu. The global bash file may be in other places also.)

Check to ensure at least one parameter passed in to bash script

bash script check for existence of any argument

if [ $# -ne 1 ]
then
echo "USAGE: scriptname arg1 arg2"
return
fi

Include another file in your Vim configuration file

To store your Vim settings in a different file (Agaric does this so that we can put all our "custom home" configuration type files easily in version control together) use the source command.

In .vimrc to include other file:

source /path/to/file/morvimconfig

In ben-agaric's case, the entire .vimrc file is only:

source /home/ben/customhome/.vimrc-agaric

PHP function to format seconds as hours:minutes:seconds

Could not find a built-in PHP function to convert seconds to minutes and such, so here's a utility function candidate. Seems it should be easier...

Syndicate content