Cheat sheets are a compressed list of useful commands, functions, overall helping tips in order to help accomplishing a certain task. This GHOP task would be to create such a cheat sheet for a Drupal developer (or themer). To determine what should be included on the sheet is a difficult task, because one needs to focus on the most needed, and most often searched pieces of information.

The initial suggestion on what to include on a Developer's Cheat Sheet is as follows:

CVS part should include the following tasks:
- Checking out different versions of core
- Checking out modules to directories, with respect to branches, tags
- Overview of naming conventions for tags, branches

project maintainers part:
- create a project
- branching a project
- tagging a project
- checking out a given branch
- creating a patch
- merging a patch
- upgrading a module, what happens if we modified a file (M tag druing cvs up,
how to circumvent it)

Of course this list is probably incomplete, so please comment on what you would find useful to include. After finishing with the suggested items this task will be cleared up, and posted on google task tracker. The task is complete when a downloadable pdf and png is presented, is reviewed and accepted.

Useful examples on cheat sheets: http://www.ilovejackdaniels.com/cheat-sheets/

(of course a themers cheat sheet would be very useful too, but I have not much experience on that, so if you can give a draft of useful information that should be included there, please post it, and I will open a new task idea for that)

Comments

greggles’s picture

For cvs - http://drupal.org/handbook/cvs/quickstart will be helpful.

I'd also love to see API cheat sheets for the most popular theme functions, most popular taxonomy functions etc. To find which functions are most popular, use a tool (like grep) to check all core code and/or all contrib code for how often certain functions are used. If it's used a lot, it must be handy. I think we can leave it up to the student to find the right tool and regexp to find which function calls are most commonly used.

webchick’s picture

Ok, so:

a) Love this idea.
b) I think greggles's suggestions could easily be done as subsequent cheat-sheet tasks, "Themer cheat-sheet", "Drupal API cheat-sheet", "Drupal Hooks cheat-sheet" ... If someone wants to write those (or others) up, go for it (let's do a max. of 3 for now, until we see how they go)

For the developer cheat-sheet, here's what I'd like to see (this might actually be two cheat-sheets, or some of these might be ):

- CVS commands, both for checkout and project maintenance (or maybe just project maintenance if we want to keep it solely aimed at developers)
- List of most common hooks, along with their descriptions and reference to a place in either core or contrib that uses it. For example:

hook_block
Declare a block or set of blocks.

Example: user_block in user.modue, which declares a "Who's online" block as well as a "Login" block.

- A bulleted list of security guidelines from "How to write text securely"
- List of developer-related modules: Coder, Devel, etc.
- List of developer resources: coding standards, etc.
- Tips on how to write a good bug report or feature request/review a patch (maybe these go on a "Contirbutor" cheeat-sheet)

keith.smith’s picture

Also, as prior art related to FormAPI, this Lullabot cheat sheet is spiffy: http://www.lullabot.com/files/formapi.pdf

HedgeMage’s picture

I love it -- one addition, though.

Can we specify that cheat sheets should be US Letter sized (whether one or two sided)? Letter-sized content will fit on A4 paper, but the reverse isn't true. I hate finding a great cheat sheet only to be unable to print it because A4 paper is hard to find here and not all printers even handle it.

snufkin’s picture

#4: sure, I will do that. I did not realize there is also this incompatibility over the big pond.

About subsequent cheat sheets: I don't really want to let the imagination fly here _that much_, because we need clear deliverables. I would say limit the possibilities to developer (maintaining stuff, basics of modules), themer, and see what the students come up with. For any given topic one can go deeper and deeper, and who knows, maybe a student can manage to fit all the most important API and hook information into one page! I think we should try with these two, and if it works out well I will create another task for hardcore coding cheat sheet. How about that?

I would like to set the limit to one page, two only if its really useful information, but it would be needed to fill the pages.

So on the technical side: pdf or png, US letter size, one, max two pages. Topics: module developer and themer. Accepted if reviewers accept it.

dgeilhufe@yahoo.com’s picture

fyi
Existing prior art- developer cheat sheet: http://www.inmensia.com/files/pictures/internal/CheatSheetDrupal4.7.png
Maybe a good GHOP task would be to update this for D6. Since I'm not a developer, not sure if that is a useful task.

matt v.’s picture

For what it's worth, I just posted a Drupal Theme Developer's Cheat Sheet that I've been working on for a while. I'd still like to see one on Drupal-specific CVS commands or other developer topics though.

snufkin’s picture

That is a very handy theme developer cheat sheet indeed! (link correctly: http://www.minezone.org/blog/2007/12/18/drupal-theme-developers-cheat-sh...)

The CVS Cheat Sheet would be great, as webchick also proposed it on IRC. I will write that up soon.

dman’s picture

Possible features:

Cheat for File Permission repairs, eg

chmod -R 775 files
chmod -R 775 sites/*/files

Or whatever current best practice is.

Cheat for directory updates/synch

scp -r /var/www/dev-site/ user:pass@example.com:/www
; or 
rsync -vtru /var/www/dev-site/ user:pass@example.com:/www
; or
ftpsync -v  ignoremask=cvs /var/www/dev-site/ ftp://user:pass@example.com:/www

Cheat for site backup

tar -czf site-`date +%Y-%m-%d`.tgz /var/www/dev-site
mysql -u user --password=pass --execute="TRUNCATE cache; TRUNCATE cache_menu; TRUNCATE watchdog" database 
mysqldump -u user --password=pass database | gzip > data-`date +%Y-%m-%d`.sql.gz

...I'm sure others will have different preferences on invocations, but I've always found cheat sheets most useful for learning the names of commands that folk use to di the job ... so I can then at least find the man page.

snufkin’s picture

For a starter lets make it be only about CVS.

Title: Drupal CVS Cheat Sheet

Description: Cheat sheets are a compressed list of useful commands, functions, overall helping tips in order to help accomplishing a certain task. This GHOP task would be to create such a cheat sheet on using/maintaining/developing Drupal, and contributed modules via CVS. Using this cheat sheet these basic tasks should be able to be done without the need to lookup the handbook.

An initial suggestion on what should be included on this sheet:

CVS part should include the following tasks:
- Checking out different versions of core
- Checking out modules to directories, with respect to branches, tags
- Overview of naming conventions for tags, branches

project maintainers part:
- create a project
- branching a project
- tagging a project
- checking out a given branch
- creating a patch
- merging a patch
- upgrading a module, what happens if we modified a file (M tag druing cvs up,
how to circumvent it)
- moving directories/files (often a nasty thing because of lack of CVS analogue to "svn mv"

The task is complete when a sheet is assembled in US letter size, and a downloadable pdf and png is presented and accepted.

Resources:
* Useful examples on cheat sheets: http://www.ilovejackdaniels.com/cheat-sheets/

Primary contact:
* snufkin

wmostrey’s picture

CVS looks like a really good place to start with this, this will help a lot of people. I would state more clearly that you want the cheat sheet to like like that on your Resource, because currently that is not clear (at least, if that is how you want them to look). If there are more such tasks coming up, that might not be a bad idea.

snufkin’s picture

wmostrey: honestly I want to leave the room open to alternative designs to pop up, but in the task i underlined that there is a good design concept to be found under the resource. thanks for pointing this out.

Drupal Issue for the CVS sheet: http://drupal.org/node/203430

wmostrey’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.