Mini tutorial: creating patterns

Someone just posted a question about a certain brush/pattern, and by the time I responded the entry was deleted. So I will post the comment for future references for anyone else; think of it as a mini-tutorial, but not. :P

The effect in question was one similar to the one in these icons (by me), with the diagonal lines:

* * *

If it is a brush, you can easily get by without it by creating a pattern. See here and here for instructions.

For that particular one, you'll want to open a new document that's 3x3 to 4x4 pixels, and create a line using the pencil tool diagonally across the image. Define as pattern, and voila. You can use layer effects to make it opaque or whatever.