User login

Public

Exclude the current node from also showing up in a block View

  1. Add an argument for Node: nid
  2. Set 'Action to take if argument is not present' to 'Provide default argument'
  3. Set 'Default argument type' to 'Node ID from URL'
  4. Check 'Exclude the argument'

From http://drupal.org/node/131547

Remove ^M from the end of all lines in a file that some fool edited with a Windows program

Where foo is the file that has the control Ms:

cat foo | col -b > foo2; mv foo2 foo

For instance, to take a likely Drupal example:

cat page.tpl.php | col -b > page.tpl.php.fixed; mv page.tpl.php.fixed page.tpl.php

Alternately, to do a bunch of files at once, use the *nix find command and the more convenient one-command dos2unix line ending changer via the tofrodos package.

Install the prerequisites first if you need to:
sudo apt-get install tofrodos

Wanted: A Drupal module to prevent orphaned words

It would work as an input filter, and put in a non-breaking space between the last two words of every paragraph, so that one word would never be on the last line by itself.

Not entirely sold on the idea, aesthetically, but i'm surprised there's no module for that yet...

Clone a git repository that is behind basic HTTP authentication

git clone http://username:password@git.example.com:80/git/project.git

If you do not want to put your password directly in plain text, maybe leaving it out will cause you to be prompted for it.

Path to Drush

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

via http://www​.mediacurr​ent.com/bl​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.

Syndicate content